I was using the Smarket Datadata in the ISLR package for logistic regression (in R) and facingfind the below error:
below. If i am puttingI use the belowfollowing command i am getting, I get the error (warning):
glm.fit1 = glm(Direction~. - Direction, data = Smarket, family = "binomial") Warning messages: 1: glm.fit: algorithm did not converge 2: glm.fit: fitted probabilities numerically 0 or 1 occurred
glm.fit1 = glm(Direction~. - Direction, data=Smarket, family="binomial")
Warning messages: 1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
howeverHowever if i am running thisI run the following command, i amI do not seeingsee any error:
glm.fit=glm(Direction∼Lag1+Lag2+Lag3+Lag4+Lag5+Volume , + data=Smarket ,family =binomial )
glm.fit = glm(Direction∼Lag1+Lag2+Lag3+Lag4+Lag5+Volume, data=Smarket,
family=binomial)
Although both the commands looks same to me (excluding the Directiondirection)
and 2nd finding:
, the outputoutputs are also different in both the cases.
So, my questions are
- Why i am I getting the warning if both the commands are same. 2) why?
- Why is the output is also different.?
Thanks for the help.