[R] predict.lm with matrix as newdata

From: Marlin Keith Cox <marlinkcox_at_gmail.com>
Date: Fri, 15 Feb 2008 10:24:47 -0900


Z is a matrix and when I run the following line, it creates a prediction estimate using each column, how can I get it an estimate for each individual number. I have tried changing Z to a data.frame, but this does not do it either.

model.lm<-lm(w~x)

pred.est <- predict.lm(model.lm, data.frame(x=Z))

Thanks in advance,
keith

-- 
Keith Cox, Ph.D.
Sitka Sound Science Center
Fisheries Biologist
P.O. Box 464
Sitka, Alaska, 99835

907 752-0563
marlinkcox_at_gmail.com

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_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.
Received on Fri 15 Feb 2008 - 19:38:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 16 Feb 2008 - 12:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive