[R] t.test & formatting question

Tony Plate tplate at blackmesacapital.com
Sat Apr 17 01:19:44 CEST 2004


as.numeric() (and its siblings) strip the names from vectors, e.g.:

 > as.numeric(t.test(rnorm(1001))$statistic)
[1] -0.6320304
 >

hth,

Tony Plate

At Friday 05:14 PM 4/16/2004, christopher ciotti wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hello all -
>
>
>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
>
>- --
>chris ciotti (chris_ciotti at yahoo.com)
>PGP ID: 0xE94BB3B7
>
>
>-----BEGIN PGP SIGNATURE-----
>Version: PGP 8.0
>
>iQA/AwUBQIBotlkgIqbpS7O3EQIt7ACdEhhoM3tqqmDae71Rdo/eHg2TvoQAoLSw
>8QjwkHENOjjs5mzCWlXSTQXO
>=LvW5
>-----END PGP SIGNATURE-----
>
>______________________________________________
>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