Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tukey HSD post-hoc test on a prop.test(..) in R

Tags:

r

posthoc

I'm doing a prop.test() on 3 groups:

data = data.frame(a = c(85*0.3412,85*(1-0.3412)),b = c(203*0.2217,203*(1-0.2217)), c = c(231,197))
prop.test(t(data))

The p.value is very low (1.041e-13). I want to know which pair of groups show a significant difference of proportion.

I thought I could run the following code ....

library(agricolae)    
HSD.test(prop.test(t(data)))

... but it is not working because HSD.test can only deal with aov or lm object.

What solution do I have left ? No matter if the solution implies a Bonferroni (or other) correction instead of a Tukey correction.

like image 916
Remi.b Avatar asked Nov 18 '25 00:11

Remi.b


1 Answers

This does a Bonferroni-Holm adjustment by default; see the documentation for other options.

> pairwise.prop.test(t(data))

    Pairwise comparisons using Pairwise comparison of proportions 

data:  t(data) 

  a      b      
b 0.0490 -      
c 0.0025 3.1e-13

P value adjustment method: holm 
like image 164
Aaron left Stack Overflow Avatar answered Nov 19 '25 14:11

Aaron left Stack Overflow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!