|
尊楼主之需, 按所给数据计算如下. 请搂主注意一下这个数据是否是你要求的, 即"不良反应的总例数是包含了过敏反应的例数".
> dt2
反应
组别 过敏 其他不良 无不良
对照组 2 38 460
实验组 0 14 486
>
> chisq.test(dt2)
Pearson's Chi-squared test
data: dt2
X-squared = 13.7915, df = 2, p-value = 0.001012
Warning message:
In chisq.test(dt2) : Chi-squared approximation may be incorrect
>
> fisher.test(dt2)
Fisher's Exact Test for Count Data
data: dt2
p-value = 0.0004289
alternative hypothesis: two.sided
>
> chisq.test(dt2, simulate.p.value=T)
Pearson's Chi-squared test with simulated p-value (based on 2000
replicates)
data: dt2
X-squared = 13.7915, df = NA, p-value = 0.0009995
|