Так что это очень простой вопрос, просто не могу понять это.
Я запускаю logit с помощью функции glm, но продолжаю получать предупреждающие сообщения, относящиеся к независимой переменной. Они хранятся как факторы, и я изменил их на числовые, но не повезло. Я также закодировал их в 0/1, но это тоже не сработало.
Пожалуйста, помогите!
> mod2 <- glm(winorlose1 ~ bid1, family="binomial")
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
Я тоже пробовал в Zelig, но похожая ошибка:
> mod2 = zelig(factor(winorlose1) ~ bid1, data=dat, model="logit")
How to cite this model in Zelig:
Kosuke Imai, Gary King, and Oliva Lau. 2008. "logit: Logistic Regression for Dichotomous Dependent Variables" in Kosuke Imai, Gary King, and Olivia Lau, "Zelig: Everyone's Statistical Software," http://gking.harvard.edu/zelig
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
EDIT:
> str(dat)
'data.frame': 3493 obs. of 3 variables:
$ winorlose1: int 2 2 2 2 2 2 2 2 2 2 ...
$ bid1 : int 700 300 700 300 500 300 300 700 300 300 ...
$ home : int 1 0 1 0 0 0 0 1 0 0 ...
- attr(*, "na.action")=Class 'omit' Named int [1:63021] 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 ...
.. ..- attr(*, "names")= chr [1:63021] "3494" "3495" "3496" "3497" ...