Holm sidak adjustment using R

蓝咒 提交于 2019-12-24 11:28:13

问题


I am very new to using R. I'm running an ANOVA with two factors (interaction) with success. Next I would like to conduct between groups comparisons. I know this is possible using the TukeyHSD command. However, our research group has previously used SigmaPlot to run statistics, which uses the Holm-Sidak method. So my supervisor would like me to run Holm-Sidak on R so that we can compare results and make sure they're the same.

Does anyone know how to do this? I've tried searching online and can't find the answer to this. It seems like I need to input unadjusted p-values so that I can run some code and return the adjusted p-values, but I'm confused as to where these unadjusted p-values are supposed to come from. Do they come from running pairwise tests first?

I'd appreciate any guidance on this.


回答1:


There's code from Pierre Legendre that performs Holm-Šidák adjustments for ANOVA in R:

Sidak <- function(vecP)
#
# This function corrects a vector of probabilities for multiple testing
# using the Bonferroni (1935) and Sidak (1967) corrections.
#
# References: Bonferroni (1935), Sidak (1967), Wright (1992).
#
# Bonferroni, C. E. 1935. Il calcolo delle assicurazioni su gruppi di teste. 
# Pp. 13-60 in: Studi in onore del Professore Salvatore Ortu Carboni. Roma.
#
# Sidak, Z. 1967. Rectangular confidence regions for the means of multivariate 
# normal distributions. Journal of the American Statistical Association 62:626-633.
#
# Wright, S. P. 1992. Adjusted P-values for simultaneous inference. 
# Biometrics 48: 1005-1013. 
#
#                  Pierre Legendre, May 2007
{
k = length(vecP)

vecPB = 0
vecPS = 0

for(i in 1:k) {
   bonf = vecP[i]*k
   if(bonf > 1) bonf=1
   vecPB = c(vecPB, bonf)
   vecPS = c(vecPS, (1-(1-vecP[i])^k))
   }
#
return(list(OriginalP=vecP, BonfP=vecPB[-1], SidakP=vecPS[-1]))
}

Alternatively, you could probably use the package dunn.test. It performs multiple comparisons of the type you want, though on rank sums, and has an option for Holm-Šidák adjustments with "method = sidak".



来源:https://stackoverflow.com/questions/31968549/holm-sidak-adjustment-using-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!