[R] t.test & formatting question

Robert W. Baer, Ph.D. rbaer at atsu.edu
Sat Apr 17 04:42:42 CEST 2004


How about:
as.numeric(t.test(rnorm(12))[[1]])

----- Original Message ----- 
From: "Chuck Cleland" <ccleland at optonline.net>
To: "christopher ciotti" <chris_ciotti at yahoo.com>
Cc: <R-help at stat.math.ethz.ch>
Sent: Friday, April 16, 2004 6:25 PM
Subject: Re: [R] t.test & formatting question


>    Sorry, I should have checked that more closely.  I see that
>
> t.test(rnorm(12))[[1]]
>
>    retains the "t".
>
> christopher ciotti wrote:
> > ...
> > I'm trying to format some data where I only need one of the values
> > returned from a test, say a t-test in this instance.  I have the
following:
> >
> >  > R.version.string
> > [1] "R version 1.9.0, 2004-04-12"
> >  > x <- rnorm(1001)
> >  > t.test(x)$statistic
> >        t
> > 0.5555321
> >  >
> >
> > Any easy way (other than straight calculation) to get the t-statistic
> > w/o the 't' above it?  TIA
> > ...
>
> -- 
> Chuck Cleland, Ph.D.
> NDRI, Inc.
> 71 West 23rd Street, 8th floor
> New York, NY 10010
> tel: (212) 845-4495 (Tu, Th)
> tel: (732) 452-1424 (M, W, F)
> fax: (917) 438-0894
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list