Werner, You could set 0 to that regressors you don't want to consider for prediction.
da <- expand.grid(A=1:20, B=rnorm(20, 4, 0.2), C=10^seq(1,2,l=20)) da$y <- rnorm(da$A, 0, 0.3) m0 <- lm(y~A+B+C, data=da) new <- da new$C <- 0 predict(m0)[1:5] predict(m0, newdata=new)[1:5] At your disposal. Walmes. ----- ..oooO .................................................................................................. ..(....)... 0ooo... Walmes Zeviani ...\..(.....(.....)... Master in Statistics and Agricultural Experimentation ....\_)..... )../.... walmeszevi...@hotmail.com, Lavras - MG, Brasil ............ (_/............................................................................................ -- View this message in context: http://n4.nabble.com/Remove-term-from-formula-for-predict-lm-tp1017686p1017759.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.