Does Quasi Separation matter in R binomial GLM?

坚强是说给别人听的谎言 提交于 2019-12-02 11:35:33

You have constructed an interesting example but you are not testing a model that actually examines the situation that you are describing as quasi-separation. When you say: "when x1=1 and x2=1 (obs 3) the data always fails.", you are implying the need for an interaction term in the model. Notice that this produces a "more interesting" result:

> summary(glm(cbind(fail,nofail)~x1*x2,data=data,family=binomial))

Call:
glm(formula = cbind(fail, nofail) ~ x1 * x2, family = binomial, 
    data = data)

Deviance Residuals: 
[1]  0  0  0  0

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.367e-17  1.414e-01   0.000        1
x1           2.675e-17  2.000e-01   0.000        1
x2           2.965e-17  2.000e-01   0.000        1
x1:x2        2.731e+01  5.169e+04   0.001        1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 1.2429e+02  on 3  degrees of freedom
Residual deviance: 2.7538e-10  on 0  degrees of freedom
AIC: 25.257

Number of Fisher Scoring iterations: 22

One generally needs to be very suspect of beta coefficients of 2.731e+01: The implicit odds ratio i:

 > exp(2.731e+01)
[1] 725407933166

In this working environment there really is no material difference between Inf and 725,407,933,166.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!