質問

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