数据如图所示
| 组别 | 例数 | 干预结果 | | | | |
| | 临控 | 显效 | 有效 | 无效 | |
| 治疗组 | 30 | 17 | 8 | 3 | 2 | 2 |
| 对照组 | 30 | 8 | 9 | 5 | 8 | 1 |
这是我使用的程序,我的目的是想得到一个OR值,就是看看治疗组和对照组的一个总体的干预效果如何。
library(nnet)
library(MASS)
library(epicalc)
C=rep(c(1,0),4)
M=c(0,0,1,1,2,2,3,3)
F=c(2,8,3,5,8,9,17,8)
mydata=data.frame(cbind(C,M,F))
mydataM=ordered(mydata$M)
log<-glm(C~mydataM,weight=F,family=binomial,data=mydata)
summary(log)
可是我的结果是这样的:我的目的是
Call:
glm(formula = C ~ mydataM, family = binomial, data = mydata,
weights = F)
Deviance Residuals:
1 2 3 4 5 6 7 8
2.537 -1.889 2.426 -2.168 3.473 -3.384 3.621 -4.270
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.315283 0.314072 -1.004 0.3154
mydataM.L 1.523487 0.634382 2.402 0.0163 *
mydataM.Q -0.001957 0.628144 -0.003 0.9975
mydataM.C 0.214872 0.621845 0.346 0.7297
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 83.178 on 7 degrees of freedom
Residual deviance: 75.445 on 4 degrees of freedom
AIC: 83.445
Number of Fisher Scoring iterations: 4