问题描述
我试图找出患有和未患有疾病的个体在严重程度分层方面是否存在显着差异。这是我的桌子的样子。
我进行了 Fisher 测试并获得了显着的 p 值
然后我进行了成对的fisher测试和fisher.multcomp测试,但我对解释结果感到困惑。
我对pairwise/multcomp 测试正在运行哪些比较感到困惑。例如,成对 Fisher 检验中的第一行是否表示患病者和未患病者的轻度和中度病例数之间存在显着差异?
解决方法
在运行卡方检验时,您可能会遇到预期频率小于 5 的情况。如果我没记错的话,可以在这种情况下使用 Fisher 检验。
此成对检验显示了显着性,仅考虑变量中的两个组并忽略其他组的观察结果。它给出了变量中所有可能的水平组合的 p 值。
在这个例子中:
# Fisher's test ingoring third row,Severe (Inclusing mild and moderate only)
> fisher.test(table1[-3,])
data: table1[-3,]
p-value = 0.01356
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.08293417 0.82733771
sample estimates:
odds ratio
0.2709515
> fisher.test(table1[-2,])
data: table1[-2,]
p-value = 3.881e-06
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.0005229306 0.1980644402
sample estimates:
odds ratio
0.02454
> fisher.test(table1[-1,])
data: table1[-1,]
p-value = 0.008936
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.001895554 0.703424501
sample estimates:
odds ratio
0.08829437
您可以观察到这些 p.values 与您拥有的相同。