[R] calculating p-values from t-values for a Bonferroni adjustment

Ben Bolker bolker at ufl.edu
Tue Jul 28 04:10:23 CEST 2009




NativeBuff2003 wrote:
> 
> I am performing a sequential bonferroni adjustment on the results of an
> ANCOVA but the equation I have for calculating p-values from the t-values
> is not working.  I can't seem to find it anywhere else. This is the code I
> have now: 2*(1-pt(t,df)) where t=t-value and df=degrees of freedom from
> the ANCOVA. Is there an error in the code? maybe another way to find the
> p-values? Help!
> 

Please tell us what "not working" means and give a reproducible (?) example,
etc., as discussed
in the posting guide.  Perhaps you have redefined the pt() function by
accident?

 Works fine for me, e.g. 

> 2*(1-pt(2,10))
[1] 0.07338803

2*pt(abs(x),df,lower.tail=FALSE)  would be slightly more general/accurate.

   Ben Bolker

-- 
View this message in context: http://www.nabble.com/calculating-p-values-from-t-values-for-a-Bonferroni-adjustment-tp24689680p24691288.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list