公众号-科研私家菜学习记录(2)

2021-08-04  本文已影响0人  明眸意海

泊松回归

  1. 分析代码:
data(Affairs, package="AER")
summary(Affairs)
table(Affairs$affairs)

# fit full model
fit.full <- glm(affairs ~ gender + age + yearsmarried + children + 
                  religiousness + education + occupation +rating,
                data=Affairs,family=poisson())
summary(fit.full)
  1. OR值计算
# interpret coefficients
coef(fit.reduced)
# OR值 回归系数的反对数
exp(coef(fit.reduced))
# OR值的置信区间
exp(confint(fit.reduced))
# OR值和置信区间
exp(cbind(OR = coef(fit.reduced), confint(fit.reduced)))
上一篇下一篇

猜你喜欢

热点阅读