Jini
Jini

Reputation: 43

Holm sidak adjustment using R

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.

Upvotes: 2

Views: 5674

Answers (1)

Yuri Robbers
Yuri Robbers

Reputation: 291

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".

Upvotes: 2

Related Questions