Learn R Programming

iprior (version 0.6.5)

plot: Plots for ipriorMod objects

Description

Three plots are produced by default: Plot of fitted regression curve, plot of fitted values against residuals, and a QQ-plot of the residuals. Note that The plots of fitted regression line can be shown only if the explanatory variable is of dimension one (i.e. only p = 1 explanatory variable used).

Usage

# S3 method for ipriorMod
plot(x, plots = c("all", "allinone", "fitted",
  "diagnostic", "residuals", "qqplot"), own.labels = FALSE, ...)

Arguments

x

An object of class ipriorMod.

plots

Option to control which plots to show. The options are:

allinone

All three plots are shown one one screen.

fitted

Only the fitted regression curve is shown.

diagnostic

The two diagnostic plots are shown.

residuals

Only the plot of fitted against residuals shown.

qqplot

Only the QQ-plot of the residuals is shown.

own.labels

Logical, useful when categorical variables has factor names which are long, because these are used as the points of the plots.

...

No further arguments are passed, so this is not used here.

Examples

Run this code
# Straight line regression (Canonical RKHS)
mod.orange <- iprior(circumference ~ age, Orange)
plot(mod.orange)

# Multilevel model type plots (Canonical + Pearson RKHS)
mod.tooth1 <- iprior(len ~ ., ToothGrowth)
mod.tooth2 <- iprior(len ~ . ^ 2, ToothGrowth)
par(mfrow = c(1,2))
plot(mod.tooth1, plots = "fitted")  # random intercept
plot(mod.tooth2, plots = "fitted")  # random slopes & intercept

# One-dimensional smoothing (FBM RKHS with Hurst coef. 0.5)
mod.cars <- iprior(dist ~ speed, cars, model = list(kernel = "FBM"))
plot(mod.cars, plots = "fitted")

Run the code above in your browser using DataLab