How about:
as.numeric(t.test(rnorm(12))[[1]])
- Original Message -
From: "Chuck Cleland" <[EMAIL PROTECTED]>
To: "christopher ciotti" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, April 16, 2004 6:25 PM
Subject: Re: [R] t.test & forma
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.stri
How about this?
t.test(x)[[1]]
The result of t.test(x) is a list and "statistic" is the first
component of that list.
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:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tony Plate wrote:
> 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
Thanks for the quick response.
- --
chris ciotti ([EMAIL PROTECTED])
P
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
-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