Description Usage Arguments Value Author(s) See Also Examples
View source: R/check_normality.R
Check the normality assumption of univariate data or model residuals using graphical methods.
1 2 | check_normality(x, panel = TRUE, na.rm = FALSE, title = NULL,
shapiro.test = FALSE)
|
x |
numeric vector |
panel |
logical, if |
na.rm |
logical, should NA values be removed |
title |
string, optional plot title placed on top outside margin |
shapiro.test |
logical, should a Shapiro-Wilks test be run |
Prints a series of plots:
Histogram |
Histogram of data with empirical density overlay (red) and a theoretical normal PDF overlay (grey) |
QQ plot |
Normal QQ plot |
CDF |
Empirical (red dots) and theoretical normal (grey line) cumulative distributions |
If shapiro.test
, then the results of the test are returned
Michael Malick
dnorm
pnorm
density
plot.ecdf
shapiro.test
1 2 3 | check_normality(rnorm(100))
check_normality(rnorm(100), panel = FALSE)
check_normality(rlnorm(100), title = "Title")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.