Hi here is the code as example
lars is in package lars
> x<-matrix(rnorm(20*5,0,1),20,5)
> bs<-matrix(sample(seq(1:10),5),5,1)
> er<-rnorm(20,0,1)
> y<-x%*%bs+er
> lobj<-lars(x,y,type="lasso")
> names(lobj)
[1] "call" "type" "df" "lambda" "R2"
[6] "RSS""Cp
Hi I am a newbie in R.
I have data with dim of 20.
How to use lm if i want to do regression with the whole design matrix? My y
is the first column.
the left are xs.
Thanks a lot.
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-do-linear-regression-when-dimension-is-high-tp
2 matches
Mail list logo