I am having a problem running logistic regression for my data, first I used glm function in r but got the following warning:
Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred
Now I am trying to do glmnet because the data is very sparse:
x = data[, 2:27]
y = data[, 1]
y = as.matrix(y)
fit = glmnet(x, y, family = "binomial")
But I get the following error which I do not understand:
Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs, :
(list) object cannot be coerced to type 'double'