Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Is there a function in R that outputs residual plots of the validation set?

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