문제

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