Thank you for the fast help!

I am not sure though if I understand the predict.lm business. The newdata
that I would make predictions from consists of six matrices, one for each
variable. Do I cbind the matrices like you suggest for the regression and
then convert them to a dataframe? How does R know which column in the matrix
I created with cbind belongs to which variable in the regression?

One last question. If I use predict.lm without newdata it gives me as many
data points as were used for the regression. However, in my matrices I have
rows of NA for days without observations. My problem is now that if
predict.lm only gives me the datapoints used for regression I can not match
them to the actual observations days anymore. Is there anyway of keeping the
original matrix and put the predicted value in it?

Thanks again, Frauke






--
View this message in context: 
http://r.789695.n4.nabble.com/correlating-matrices-tp4643660p4643858.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.

Reply via email to