Do you have NA
in your variables? If so, you'll get NA
for predict value.
logistic regression predicts "NA" probability in R - why?
-
09-07-2023 - |
문제
I have run a logistic regression in R using the following code:
logistic.train.model3 <- glm(josh.model2, family=binomial(link=logit), data=auth, na.action = na.exclude)
print(summary(logistic.train.model3))
My response variable is binary, taking on values of 1 or 0.
when I look at the summary, everything looks fine, every variable has a coefficient.
However, when I try to output the predicted probabilities using the following code:
auth$predict.train.logistic <- predict(logistic.train.model3, type = "response")
Almost 20% of my predictions are "NA". How can this be? What is going on? Thanks in advance!
해결책
제휴하지 않습니다 StackOverflow