Learn R Programming

auditor (version 0.3.0)

plotModelPCA: Principal Component Analysis of models

Description

Principal Component Analysis of models residuals. PCA can be used to assess the similarity of the models.

Usage

plotModelPCA(object, ..., scale = TRUE, invisible = "none")

Arguments

object

An object of class modelAudit or modelResiduals,

...

Other modelAudit or modelResiduals objects to be plotted together.

scale

A logical value indicating whether the models residuals should be scaled before the analysis.

invisible

A text specifying the elements to be hidden on the plot. Default value is "none". Allowed values are "model", "observ".

Value

ggplot object

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)
library(randomForest)
rf_model <- randomForest(prestige~education + women + income, data = Prestige)
rf_au <- audit(rf_model, data = Prestige, y = Prestige$prestige)
plotModelPCA(lm_au, rf_au)

# }

Run the code above in your browser using DataLab