plot_qq_normality | R Documentation |
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.
plot_qq_normality(.data)
## S3 method for class 'data.frame'
plot_qq_normality(.data)
.data |
The output of |
A ggplot
object.
Kutner, M., Nachtsheim, C., Neter, J. and Li, W. (2005). Applied Linear Statistical Models. ISBN: 0-07-238688-6. McGraw-Hill/Irwin.
calculate_residuals()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.