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!

有帮助吗?

解决方案

Do you have NA in your variables? If so, you'll get NA for predict value.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top