Displaying 1 result from an estimated 1 matches for "gamnet".
Did you mean:
gadnet
2011 May 01
1
Different results of coefficients by packages penalized and glmnet
...of$fullfit)
pena.fit2<-penalized(HRLNM,penalized=~CN+NoSus,lambda1=opt$lambda,model="logistic",standardize=TRUE,steps=20)
plotpath(pena.fit2)
pena.fit2<-penalized(HRLNM,penalized=~CN+NoSus,lambda1=opt$lambda,model="logistic",standardize=TRUE)
coef(pena.fit2)
#lasso using gamnet
library(glmnet)
factors<-matrix(c(CN,NoSus),ncol=2)
colnames(factors)<-c("CN","NoSus")
glmn.fit2<-glmnet(x=factors,y=HRLNM,family="binomial")
cvglmnet<-cv.glmnet(x=factors,y=HRLNM,family="binomial",nfolds=5)
plot(cvglmnet)
cvglmnet$lambda.min
whic...