Re: [R] glmnet package: penalty.factor option

From: Breheny, Patrick <patrick.breheny_at_uky.edu>
Date: Wed, 27 Apr 2011 14:06:35 -0400

Have you tried:

pen <- rep(1,ncol(X))
pen[c(1,5,7)] <- 0
fit <- glmnet(X,y,penalty.factor=pen)

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Brian H. Chen Sent: Wednesday, April 27, 2011 12:01 PM To: r-help_at_r-project.org
Subject: [R] glmnet package: penalty.factor option

Anyone have experience specifying the "penalty.factor" option in the "glmnet" command?

I have 3 variables (out of a million genotype variables) that I want to force into the model (i.e., set penalty factor to 0), but I can't figure out how to do that.

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 27 Apr 2011 - 18:25:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Apr 2011 - 19:00:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive