residual_plots: Creates residual plots

View source: R/residual_plots.R

residual_plotsR Documentation

Creates residual plots

Description

residual_plots creates a four-pack of plots similar to the residual plots returned by Minitab. Plots include (1) a Normal QQ plot of the residuals, (2) a residuals vs fitted values plot, (3) a histogram of the residuals, and (4) a plot of residuals vs order. The 4th plot (residuals vs order), assumes the data.frame supplied is already in order.

Usage

residual_plots(x, ...)

Arguments

x

A data.frame object (such as that returned from df_from_model) that contains two columns, the first of which is the residuals, and the second is fitted values.

Value

Residual plot(s) useful for checking model assumptions.

See Also

plot.lm, gg_residual_plots, df_from_model

Examples

data(npk)
npk.aov <- aov(yield ~ block + N*P*K, npk)
summary(npk.aov)
npk.aov1 <- aov(yield ~ block + N + K, data = npk)
summary(npk.aov1)
summary.lm(npk.aov1)
model.tables(npk.aov1, type = "means", se = TRUE)
plot(npk.aov1)

npk.table <- df_from_model(npk.aov1, type = "rstandard")
residual_plots(npk.table)

rm(list = c("npk", "npk.aov", "npk.aov1", "npk.table"))


jjw3952/mcotear documentation built on Sept. 2, 2023, 10:30 a.m.