[R] t-test pvalue
gcoppola at ucla.edu
Thu Dec 30 02:40:54 CET 2004
I have some t-test values, and I am trying to obtain the associated p-values.
Is 'pt' the right command? I wonder why 1) it returns different values for
x and -x, and 2) how to obtain a 2-sided p-value.
example [R version 2.0.1, WinXP]:
#if t=2.23 (df=10), the expected p-value is 0.05 for 2-sided and 0.025 for
pt (-2.23,10) #or pt (2.23,10,lower.tail=FALSE)
 0.02492124 #as expected
The opposite happens starting from negative t-test values.
Should I convert in negative values my t-test values, and leave
Thanks and happy new year
More information about the R-help