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@gmail.com [[alternative HTML version deleted]]
Marlin Keith Cox wrote:> 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))That's what I do and it always worked for me. Can you please specify a reproducible example that shows what you got and tells us exactly what you expected? BTW: It is expected that you call the generic predict() rather than its particular method. Uwe Ligges> Thanks in advance, > keith >