[R] FW: lasso regression

Patrick Breheny patrick.breheny at uky.edu
Tue Jul 12 18:12:52 CEST 2011

On 07/12/2011 09:53 AM, Heiman, Thomas J. wrote:
> #    # define x and y
> x= x<-crs[,9]    #predictor variables
> y= y<-crs[1:8,]  #response variable

This cannot be correct.  The response variable is a vector, while the 
predictor variables form a matrix.  You have the response variable 
consisting of only the first 8 observations, then all the columns. 
Perhaps you mean:

X <- crs[,1:8]
y <- crs[,9]

If this is not the case, please include the output of


and then tell us which variable is your response.

Patrick Breheny
Assistant Professor
Department of Biostatistics
Department of Statistics
University of Kentucky

More information about the R-help mailing list