On Jul 12, 2011, at 9:53 AM, Heiman, Thomas J. wrote:

Hi,

I am trying to do a lasso regression using the lars package with the following data (see attached):

Nothing attached. (And now you have also sent an exact duplicate.)

snipped failed attempt to include data inline that was sabotaged by using HTML mail



#load Data
crs<- read.csv("file:///C:/temp/Horse//horseracing.csv<file:///C:\temp\Horse\horseracing.csv >", na.strings=c(",", "NA", "", "?"), encoding="UTF-8")

This looks wrong. Your data had no commas in it and you are also setting na.strings to include commas. If I am wrong then you should provide dput on crs instead of


#    # define x and y
x= x<-crs[,9]    #predictor variables
y= y<-crs[1:8,]  #response variable


library(lars)
cv.lars(x, y, K=10, trace=TRUE, plot.it = TRUE,se = TRUE, type="lasso")

and I get:

LASSO sequence
Error in one %*% x : requires numeric/complex matrix/vector arguments

Any idea on what I am doing wrong?  Thank you!!

Sincerely,

tom



        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to