I am trying to use glmnet
from the glmnet
package to run a LASSO regression.
I am using the following command:
library(glmnet)
glmnet(a,b,family="binomial",alpha=1)
And am getting the error:
> Error in if (!all(o)) { : missing value where TRUE/FALSE needed
a
is a matrix, with numerical values.
b
is a vector with a factor as values.
However, b
has some missing values. I am suspecting this might be what is causing the error. However, I don't see an option to exclude NA
s in the glmnet documentation.