我正在对一些数据进行logit回归。我的因变量是二进制变量,除了一个自变量外,所有变量都是二进制变量。
当我运行回归时,stata删除了我的许多自变量并给出了错误:
“变量名称”!= 0完美地预测失败 删除“变量名称”,不使用“一个数字”
我知道的一个事实是,有些变量不能很好地预测失败。换句话说,因变量可以接受自变量的值1或0的值1。
为什么会发生这种情况,我该如何解决?
发布于 2018-02-19 13:20:46
双变量交叉表没有显示问题。试试这个:
http://www.stata.com/support/faqs/statistics/completely-determined-in-logistic-regression/index.html
首先,确认这是共线发生的情况。(对于您的数据,将x1和x2替换为模型的自变量。)
- the extremes of p will be almost 0 or almost 1 tab pattern if p < 1e-7 // (use a value here slightly bigger than the min)
- or in the above use "if p > 1 - 1e-7" if p is almost 1 list x1 x2 if pattern == XXXX // (use the value here from the tab step)
- the above identifies the covariate pattern
- note that there is collinearity \*You can omit the variable that logit drops or drop another one.
您可能希望也可能不希望包含完美预测结果的协变量模式。这取决于(3)的答案。如果完美地预测结果的协变量模式是有意义的,那么您可能希望将这些观察排除在模型之外:
logit y x1 if pattern ~= XXXX
在这里有人会报告
馀下数据的最佳模型是....xyz。
https://stackoverflow.com/questions/44371631
复制相似问题