Re: [R] intercept in lars fit

2007-11-25 Thread Uwe Ligges
Young Cho wrote: > I am trying to extract coefficients from lars fit and can't find how to get > intercept. E.g. Are we talking about the function lars() from package "lars"? > y = rnorm(10) > x = matrix(runif(50),nrow=10) > X = data.frame(y,x) > fit1 = lars(as.matrix(X[,2:6]),as.matrix(X[,1]

[R] intercept in lars fit

2007-11-23 Thread Young Cho
I am trying to extract coefficients from lars fit and can't find how to get intercept. E.g. y = rnorm(10) x = matrix(runif(50),nrow=10) X = data.frame(y,x) fit1 = lars(as.matrix(X[,2:6]),as.matrix(X[,1])) fit2 = lm(y~.,data=X) Then, if I do: > predict(fit1,s=1,mode='fraction',type='coefficients')