[Rd] How to capture t-score and p-values from t.test

Gordon K Smyth smyth at wehi.EDU.AU
Sun Mar 26 15:06:42 CEST 2006


> Date: Sat, 25 Mar 2006 16:57:50 -0400
> From: Kjetil Brinchmann Halvorsen
> 	<kjetilbrinchmannhalvorsen at gmail.com>
> Subject: Re: [Rd] How to capture t-score and p-values from t.test
> To: "Bernzweig, Bruce \(Exchange\)" <bbernzwe at bear.com>
> Cc: r-devel at r-project.org
>
> Bernzweig, Bruce (Exchange) wrote:
>> When I do t.test on two distributions (see example below), it outputs
>> numerous data about the t.test.
>>
>> What I'd like to do is individually capture some of this data and assign
>> it to other variables.
>>
>> However, I am unable to find anything in the help section.
>
> t.test returns an object of class "htest", but ?htest :
>  > ?htest
> No documentation for 'htest' in specified packages and libraries:
> you could try 'help.search("htest")'
> but that does not do anythinh eiather.
>
> Some time ago, I wrote a helpfile for htest, but that was rejected,
> since "S3 classes are not usually documented".
>
> Kjetil

The "htest" object created by t.test() is fully documented in the "Value" section of
help("t.test").  In effect, this defines what a "htest" object is understood to be.

help.search("htest") brings up a list of every function which produces an "htest" object.

Gordon



More information about the R-devel mailing list