If your data is all numeric, then the easiest way might be just to use matrix computations:
pred <- cbind(1, data) %*% coef
where data is n x k matrix, coef is a vector of length k+1, and the intercept is the first element of coef.
hope this helps,
Tony Plate
At Tuesday 10:04 AM 1/6/2004 -0500, Alexander Wise wrote:
Hello, this probably seems like an odd question, but...
If I have the formula and the coefficients for a linear model that I would like to apply to some data using predict() -- is there a way I construct an object of type lm such that predict() will work with it? Or another way besides predict()?
Alexander Wise Senior Software Engineer http://laser.cs.umass.edu
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Tony Plate [EMAIL PROTECTED]
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html