[R] glm.fit: fitted probabilities numerically 0 or 1 occurred & glm.fit: algorithm did not converge

Shivi Bhatia shivipmp82 at gmail.com
Fri Aug 12 11:10:49 CEST 2016

Hi Team,

I am creating *my first* Logistic regression on R Studio. I am working on a
C-SAT data where rating (score) 0-8 is a dis-sat whereas 9-10 are SAT. As
these were in numeric form so i had as below created 2 classes:

new$survey[new$score>=0 & new$score<=8]<- 0
new$survey[new$score>=9]<- 1
This works fine however the class still shows as "numeric" and levels shows
as "NULL". Do i still need to use "as.factor" to let R know these are
categorical variables.

Also i have used the below code to run a logistic regression with all the
possible predictor variables:
glm.fit= glm(survey ~ support_cat + region+ support_lvl+ skill_group+
application_area+ functional_area+
          repS+ case_age+ case_status+ severity_level+
          sla_status+ delivery_segmentation, data = SFDC, family = binomial)

But it throws an error:-
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred

I checked online for the error and it says:
"glm() uses an iterative re-weighted least squares algorithm. The algorithm
hit the maximum number of allowed iterations before signalling convergence.
The default,
documented in ?glm.control is 25."

Kindly suggest on the above case and if i have to change my outcome var as

Thank you, Shivi

	[[alternative HTML version deleted]]

More information about the R-help mailing list