Forums | OpenR

OpenR: R & Statistics /
Question for ANOVA Post-hoc test


Xingyu Hu's profile picture
Posts: 2

02 April 2023, 8:50 PM

In this week's lecture,  we used the `pairwise.t.test()` function to conduct one step Bonferroni t-test. The `p.adj` parameter in this function is set to `none` in the lecture material. But after reading the function documentation, it seems that `none` does not adjust p-values for multiple comparisons. So should I change the method to `bonferroni`?

pastedImage.png

Peng Zhao's profile picture
Posts: 128

07 April 2023, 1:11 PM

Either is fine. When you use p.adj = "none", you compare the p values with alpha/m (0.0167 in this example):

>
pairwise.t.test(dtf2$wg, dtf2$diet, pool.sd = FALSE,var.equal = TRUE, p.adj = "none") Pairwise comparisons using t tests with non-pooled SD data: dtf2$wg and dtf2$diet diet1 diet2 diet2 0.0018 - diet3 0.0010 0.2879 P value adjustment method: none


When you use p.adj = "bonferroni", you compare the p values with alpha (0.05 in this example):

>
pairwise.t.test(dtf2$wg, dtf2$diet, pool.sd = FALSE,var.equal = TRUE, p.adj = "bonferroni") Pairwise comparisons using t tests with non-pooled SD data: dtf2$wg and dtf2$diet diet1 diet2 diet2 0.0055 - diet3 0.0030 0.8636 P value adjustment method: bonferroni


The p-values in the latter is just 3 times the former ones.

 

2 results