I am running a regression with 67 observasions and 32 variables. I am doing variable selection using cv.glmnet function from the glmnet package. There is one variable I want to force into the model. (It is dropped during normal procedure.) How can I specify this condition in cv.glmnet?
Thank you!
My code looks like the following:
glmntfit <- cv.glmnet(mydata[,-1], mydata[,1])
coef(glmntfit, s=glmntfit$lambda.1se)
And the variable I want is mydata[,2].