使用R调整Holm sidak [英] Holm sidak adjustment using R

查看:381
本文介绍了使用R调整Holm sidak的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用R非常陌生.我正在通过两个因素(交互作用)成功运行ANOVA.接下来,我想进行组间比较.我知道使用TukeyHSD命令是可能的.但是,我们的研究小组以前使用SigmaPlot来运行统计数据,该统计数据使用Holm-Sidak方法.因此,我的主管希望我在R上运行Holm-Sidak,以便我们可以比较结果并确保它们相同.

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.

有人知道该怎么做吗?我尝试在线搜索,但找不到答案.似乎我需要输入未调整的p值,以便我可以运行一些代码并返回调整后的p值,但对于这些未调整的p值应该从何而来,我感到困惑.它们首先来自成对测试吗?

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?

我对此表示感谢.

推荐答案

Pierre Legendre 对R中的ANOVA执行Holm-Šidák调整:

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]))
}

或者,您可能会使用软件包 .它可以对所需类型进行多次比较(尽管以排名总和为单位),并且可以通过"method = sidak"进行Holm-Šidák调整.

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

这篇关于使用R调整Holm sidak的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆