Skip to main content
Post Closed as "Not suitable for this site" by Tim, Michael R. Chernick, gung - Reinstate Monica, whuber
edited tags; formatted; edited for English
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

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

  1. Why i am I getting the warning if both the commands are same. 2) why?
  2. Why is the output is also different.?

Thanks for the help.

I was using the Smarket Data in ISLR package for logistic regression (in R) and facing the below error:

If i am putting the below command i am getting 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

however if i am running this command, i am not seeing any error:

glm.fit=glm(Direction∼Lag1+Lag2+Lag3+Lag4+Lag5+Volume , + data=Smarket ,family =binomial )

Although both the commands looks same to me(excluding the Direction)

and 2nd finding:

the output are also different in both the cases.

  So, my questions are

  1. Why i am getting the warning if both the commands are same. 2) why the output is also different.

Thanks for the help.

I was using the Smarket data in the ISLR package for logistic regression (in R) and find the error below. If I use the following command, 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

However if I run the following command, I do not see any error:

glm.fit = glm(Direction∼Lag1+Lag2+Lag3+Lag4+Lag5+Volume, data=Smarket, 
              family=binomial)

Although both the commands looks same to me  (excluding the direction), the outputs are different. So, my questions are

  1. Why am I getting the warning if both the commands are same?
  2. Why is the output also different?
Source Link

R logistic regression

I was using the Smarket Data in ISLR package for logistic regression (in R) and facing the below error:

If i am putting the below command i am getting 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

however if i am running this command, i am not seeing any error:

glm.fit=glm(Direction∼Lag1+Lag2+Lag3+Lag4+Lag5+Volume , + data=Smarket ,family =binomial )

Although both the commands looks same to me(excluding the Direction)

and 2nd finding:

the output are also different in both the cases.

So, my questions are

  1. Why i am getting the warning if both the commands are same. 2) why the output is also different.

Thanks for the help.