Plot of predicted response vs observed or variable Values.
plotPrediction(object, ..., variable = NULL, smooth = FALSE,
abline = TRUE, split = "none")
An object of class modelAudit or modelResiduals.
Other modelAudit or modelResiduals objects to be plotted together.
Only for modelAudit objects. Name of model variable to order residuals. If value is NULL data order is taken. If value is "Observed response" the data is ordered by a vector of actual response (y
parameter passed to the audit
function).
Logical, indicates whenever smooth line should be added.
Logical, indicates whenever function y=x should be added.
Character. If "model" plot will be splitted by model.
# NOT RUN {
library(car)
lm_model <- lm(prestige~education + women + income, data = Prestige)
lm_au <- audit(lm_model, data = Prestige, y = Prestige$prestige)
plotPrediction(lm_au)
library(randomForest)
rf_model <- randomForest(prestige~education + women + income, data = Prestige)
rf_au <- audit(rf_model, data = Prestige, y = Prestige$prestige)
plotPrediction(lm_au, rf_au)
# }
Run the code above in your browser using DataLab