[R] how to interpret t.test output

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Aug 10 00:22:45 CEST 2008


Felipe Carrillo wrote:
> Hi Ted:
> Thanks for your prompt reply and explanation. 
> That's what I was wondering, why would one need to test mu=0 ,which is the t.test default. But reading Peter Dalgaard's book and looking at some examples online, I saw t.test being used like that; t.test(datasetname) with no other arguments
Umm, in ISwR, I  can see

t.test(bmi, mu=22.5)
t.test(bmi, mu=22.5)$p.value
t.test(daily.intake,mu=7725)
t.test(daily.intake,mu=7725)
t.test(expend~stature)
t.test(expend~stature, var.equal=T)
t.test(pre, post, paired=T)
t.test(pre, post) #WRONG!
t.test(log10(diameter)~glucose)

None of those are of the form t.test(mydata). 

You might occasionally want to  test for mu=0, for instance in 
t.test(post-pre), which is  just another way of doing the paired t test. 
mu=0 is the default because zero is the only value that "sticks out" as 
a potentially  hypothesized value (in particular, it is stable to 
scaling of the data).

If you see cases where mu is not specified and the default 0 is not 
interesting as a null hypothesis, then maybe the author was not 
interested the test at all (e.g. the confidence interval is still useful).

-- 
   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



More information about the R-help mailing list