【发布时间】:2020-04-07 09:28:27
【问题描述】:
我有一个日期集 plink.raw,我正在测试制造商 CN00020133(具有三个级别 0、1、2)是否与 phenotype5 相关联。我想使用 GLM 或 Fisher 提取测试比较 0 vs 1 和 2 vs 1:
table(plink.raw$phenotype5,plink.raw$CN00020133)
1 0 2
0 3559 0 7
1 14806 54 123
-
使用 GLM 测试,我可以看到 0 与 1 的 p 值为 0.912894。
plink.raw$CN00020133 <- factor(plink.raw$CN00020133, levels=c("1","0","2")) univariate=glm(phenotype5 ~ relevel(CN00020133,ref ="1"), family = binomial, data = plink.raw) summary(univariate)呼叫:
glm(formula = phenotype5 ~ relevel(CN00020133, ref = "1"), family = binomial, data = plink.raw)偏差残差:
Min 1Q Median 3Q Max -2.4173 0.6564 0.6564 0.6564 0.6564系数:
Estimate Std. Error z value Pr(>|z|) (Intercept) 1.42555 0.01867 76.361 < 2e-16 *** relevel(CN00020133, ref = "1")0 13.14051 120.12616 0.109 0.912894 relevel(CN00020133, ref = "1")2 1.44072 0.38902 3.703 0.000213 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 18158 on 18548 degrees of freedom Residual deviance: 18114 on 18546 degrees of freedom AIC: 18120 Number of Fisher Scoring iterations: 13 -
但如果我使用 Fisher 精确检验对其进行测试,0 与 1 的 p 值为 4.618e-06。
Convictions <- matrix(c(0, 54, 3559, 14806), nrow = 2,dimnames = list(c("control", "case"),c("del/dup", "normal_copy"))) fisher.test(Convictions, alternative = "less") Fisher's Exact Test for Count Data data: Convictions p-value = 9.048e-06 alternative hypothesis: true odds ratio is less than 1 95 percent confidence interval: 0.0000000 0.2374411 sample estimates: odds ratio 0
【问题讨论】: