plot_qq_normality: Create a Quantile-Quantile (Q-Q) Plot

View source: R/linreg-plots.R

plot_qq_normalityR Documentation

Create a Quantile-Quantile (Q-Q) Plot

Description

A QQ plot is useful for visually inspecting if a linear regression model violates the Normality assumption of its residuals. The plot plots the theoretical quantiles of a standard normal distribution on the x-axis and the sample quantiles of the residuals on the y-axis. If more than just a few of the points fall outside of the confidence band, the assumption is likely violated.

Usage

plot_qq_normality(.data)

## S3 method for class 'data.frame'
plot_qq_normality(.data)

Arguments

.data

The output of calculate_residuals().

Value

A ggplot object.

References

Kutner, M., Nachtsheim, C., Neter, J. and Li, W. (2005). Applied Linear Statistical Models. ISBN: 0-07-238688-6. McGraw-Hill/Irwin.

See Also

calculate_residuals()

Examples

library(tidytest)

mod_lm_fit <- lm(mpg ~ disp + wt + hp, data = mtcars)

pred_vs_resid_tbl <- calculate_residuals(mod_lm_fit)

plot_qq_normality(pred_vs_resid_tbl)


RobbyLankford/tidytest documentation built on Jan. 27, 2024, 7:36 a.m.