Dear all,
 
the following example somehow uses the "old data" (X) to make the predictions, 
but not the new data Xnew as intended.
 
y <- rnorm(100)
X <- matrix(rnorm(100*10), ncol=10)
lm <- lm(y~X)
Xnew <- matrix(rnorm(100*20), ncol=10)
ynew <- predict(lm, newdata=as.data.frame(Xnew)) #prediction in not made for 
Xnew
 
How can I foce predict.lm to use use the new data?
 
Thank you very much for your efforts in advance!
 
Best,
 
Martin

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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