Logistic Regression on factor: Error in eval(family$initialize) : y values must be 0 <= y <= 1
问题 Not able to fix the below error for the below logistic regression training=(IBM$Serial<625) data=IBM[!training,] dim(data) stock.direction <- data$Direction training_model=glm(stock.direction~data$lag2,data=data,family=binomial) ###Error### ---- Error in eval(family$initialize) : y values must be 0 <= y <= 1 Few rows from the data i am using X Date Open High Low Close Adj.Close Volume Return lag1 lag2 lag3 Direction Serial 1 28-11-2012 190.979996 192.039993 189.270004 191.979996 165.107727