From p.dalgaard at biostat.ku.dk  Fri Mar 24 21:36:53 2006
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 24 Mar 2006 21:36:53 +0100
Subject: [Rd] How to capture t-score and p-values from t.test
In-Reply-To: <136753ACA3E9A5498440B172A77F4BF20A5D331B@whexchmb15.bsna.bsroot.bear.com>
References: <136753ACA3E9A5498440B172A77F4BF20A5D331B@whexchmb15.bsna.bsroot.bear.com>
Message-ID: <x2pskb7f6i.fsf@turmalin.kubism.ku.dk>

"Bernzweig, Bruce (Exchange)" <bbernzwe at bear.com> writes:

> 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.
> 
>  
> 
> In the example below, the t value is -4.0441 and the p-value is 0.006771
> 
> How can I assign these values to two variables, let's say tVal and pVal?
> 

tt <- t.test(d[1], d[2], var.equal=TRUE)

tt$statistic
tt$p.value

unclass(tt)
names(tt)

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



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