Learn R Programming

CDLasso (version 1.1)

print.cv.logit.reg: Print results of Greedy Coordinate Descent for Logistic Regression

Description

Print short summary of results of cross validation for Greedy Coordinate Descent for Logistric Regression.

Usage

"print"(x, ...)

Arguments

x
Output of cv.logit.reg. Must be of class "cv.logit.reg"
...
N/A

Details

print.cv.logit.reg produces output from cv.logit.reg.

References

Wu, T.T., Chen, Y.F., Hastie, T., Sobel E. and Lange, K. (2009). Genome-wide association analysis by lasso penalized logistic regression. Bioinformatics, Volume 25, No 6, 714-721.

See Also

cv.logit.reg

Examples

Run this code
set.seed(101)
n=250;p=50
beta=c(1,1,1,1,1,rep(0,p-5))
x=matrix(rnorm(n*p),p,n)
xb = t(x) %*% beta
logity=exp(xb)/(1+exp(xb))
y=rbinom(n=length(logity),prob=logity,size=1)

rownames(x)<-1:nrow(x)
colnames(x)<-1:ncol(x)
lam.vec = (0:15)*2

#K-fold cross validation
cv <- cv.logit.reg(x,y,5,lam.vec)
plot(cv)

#Lasso penalized logistic regression using optimal lambda
out<-logit.reg(x,y,cv$lam.opt)

#Re-estimate parameters without penalization
out2<-logit.reg(x[out$selected,],y,0)
out2$estimate

Run the code above in your browser using DataLab