Possible Duplicate:
Why am I getting “algorithm did not converge” and “fitted prob numerically 0 or 1” warnings with glm?
I am trying to to fit glm using the following data with response variable y1
as categorical.
The code is giving me the following Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred
Sometimes, it does give me error
glm.fit: algorithm did not converge
From the data it is evident that there is a clear relation between predictor and response variable.
Is the 'did not converge' error because of less number of data points?
glm
is converting the response variable into factor as shown below. Is this normal?Having an
x1
andx2
value, how can I know the response?x1 = c(runif(10,50,100) , runif(10,101,150) ) x2 = c(runif(10,1,50) , runif(10,51,100) ) y1 = c(rep('n',10), rep('y',10)) tmpData = data.frame(x1,x2,y1) tmpData str(tmpData) model <- glm(formula = 'y1~x1+x2', family=binomial(), na.action=na.omit, data=tmpData) summary(model) >str(tmpData) 'data.frame': 20 obs. of 3 variables: $ x1: num 97.9 90.3 62.1 76 63.5 ... $ x2: num 18.6 49.4 21.2 47.7 24.8 ... $ y1: Factor w/ 2 levels "n","y": 1 1 1 1 1 1 1 1 1 1 ...