[R] basic question about t-test with adjusted p value
Joshua Wiley
jwiley.psych at gmail.com
Sat Aug 7 22:16:49 CEST 2010
On Sat, Aug 7, 2010 at 1:08 PM, <Josef.Kardos at phila.gov> wrote:
> I have read the R manual and help archives, sorry but I'm still stuck.
>
> How would I do a t-test with an adjusted p-value?
>
> Suppose that I use t.test ( ) , with the function argument alternative =
> "two.sided", and data such that degrees of freedom = 20. The function
> calculates a t-statistic of 2.086, and p-value =0.05
>
> How do I then adjust the p-value? My thought is to do
> p.adjust (pt(2.086, df=20),"BH")
> but that doesn't change anything (returns 0.975)
>
> what is the procedure? I'm sorry if there is a basic concept that I am
> missing here...
These adjustments are generally designed to control a family wise or
experiment wise error rate. If you only have one p-value, then the
adjustment is equivalent to the unadjusted. The argument n defaults
to length(p) (which is the length of the first argument). Here are
some examples:
> p.adjust(p = 0.975, method = "BH")
[1] 0.975
> p.adjust(p = 0.975, method = "BH", n = 1)
[1] 0.975
> p.adjust(p = 0.975, method = "BH", n = 5)
[1] 1
HTH,
Josh
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/
More information about the R-help
mailing list