Displaying 1 result from an estimated 1 matches for "larsdata".
Did you mean:
labdata
2013 Mar 19
1
Lars package
...I withhold some data. With the data that wasn't withheld, I create the model. Now, what I'm not being able to do is apply the model back to the data that I withheld.
Any suggestions?
Here it goes the code:
require(lars)
x <- as.matrix(lars.input[c(1:152)])
y <- lars.input[,c(149)]
larsdata <- as.data.frame(cbind(y,x))
attach(larsdata)
lars.model <- lars(x,y)
fit <- predict.lars(lars.model,x)$fit
plot(y ~ fit[,ncol(fit)])
#so far, so good
fit2 <- predict.lars(lars.model,withhold)$fit
plot(withhold$logBA ~ fit2[,ncol(fit2)])
#this is when the mess shows up
Thanks!
__...