Learn R Programming

auditor (version 0.2.1)

plotPrediction: Predicted response vs Observed or Variable Values

Description

Plot of predicted response vs observed or variable Values.

Usage

plotPrediction(object, ..., variable = "Observed response")

Arguments

object

An object of class modelAudit.

...

Other modelAudit objects to be plotted together.

variable

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).

See Also

plot.modelAudit

Examples

Run this code
# 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