Plot of predicted response vs observed or variable Values.

plotPrediction(object, ..., variable = NULL, smooth = FALSE,
  abline = FALSE)

Arguments

object

An object of class modelAudit or modelResiduals.

...

Other modelAudit or modelResiduals objects to be plotted together.

variable

Only for modelAudit objects. Name of model variable to order residuals. If value is NULL the data is ordered by a vector of actual response (y parameter passed to the audit function). One can also pass any name of any other variable in the data set. If variable = "" is set, unordered observations are presented.

smooth

Logical, indicates whenever smooth line should be added.

abline

Logical, indicates whenever function y = x shoul be added. Works only with variable = NULL which is a default option.

See also

Examples

library(car) lm_model <- lm(prestige~education + women + income, data = Prestige) lm_au <- audit(lm_model, data = Prestige, y = Prestige$prestige) plotPrediction(lm_au, variable = "prestige", abline = TRUE)
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, variable = "prestige", smooth = TRUE)