Displaying 1 result from an estimated 1 matches for "predmatrix".
Did you mean:
pdmatrix
2010 Aug 17
3
predict.lm, matrix in formula and newdata
Dear all,
I am stumped at what should be a painfully easy task: predicting from an lm object. A toy example would be this:
XX <- matrix(runif(8),ncol=2)
yy <- runif(4)
model <- lm(yy~XX)
XX.pred <- data.frame(matrix(runif(6),ncol=2))
colnames(XX.pred) <- c("XX1","XX2")
predict(model,newdata=XX.pred)
I would have expected the last line to give me the