After fitting a GLM to the training data set, I want to plot the residuals of the testing set but using the same coefficients. So far, my method is to get the testing set predictions, then calculate the residuals (actual - fitted), and then plot residuals ~ fitted:
predict.glm.face4 <- predict(glm.face4, type = "response", newdata = face.Test)
residuals <- face.Test$FACE - predict.glm.face4
plot(residuals ~ predict.glm.face4)
This is ugly, and I don't think it's correct either. What I would like to use is something like:
plot(glm.face4, newdata = face.Test)
but I don't believe newdata
works as a parameter here.
Comments
Post a Comment