check_normality: Check the normality assumption of a vector

Description Usage Arguments Value Author(s) See Also Examples

View source: R/check_normality.R

Description

Check the normality assumption of univariate data or model residuals using graphical methods.

Usage

1
2
check_normality(x, panel = TRUE, na.rm = FALSE, title = NULL,
  shapiro.test = FALSE)

Arguments

x

numeric vector

panel

logical, if TRUE a multi-panel graphic is produced, otherwise each graphic is printed individually.

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

Value

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

Author(s)

Michael Malick

See Also

dnorm pnorm density plot.ecdf shapiro.test

Examples

1
2
3

michaelmalick/r-malick documentation built on May 22, 2019, 9:51 p.m.