normality: Normality Tests for variables within a data frame

Description Usage Arguments Value References Examples

View source: R/normality.R

Description

The normality function is used to perform normality tests on a set of variables in a data.frame. This can include by group normality tests when including a vector of categorical variables in the groupby= argument. The Shapiro-Wilk Test for normality will be performed in all cases. If the sample size of all groups >= 20, then the D'Agostino Omnibus normality test will also be performed.

Usage

1
normality(data, vars, groupby = NULL, energy = FALSE, R = 2000)

Arguments

data

a data.frame containing columns of variables.

vars

a vector of variable names existing in the dataframe to perform normality tests on.

groupby

an optional vector containing factor names within a dataframe used for by group processing.

energy

a TRUE/FALSE boolean value indicating whether or not to perform the energy test (Székely and Rizzo) with bootstrap p-values.

R

the number of boostrapped resamples. Unused if energy=FALSE.

Value

A list containing normality tests results for each variable listed in the vars statement.

References

Szekely, G. J. and Rizzo, M. L. (2005) A New Test for Multivariate Normality, Journal of Multivariate Analysis, 93/1, 58-80, http://dx.doi.org/10.1016/j.jmva.2003.12.002.

Rizzo, M. L. (2002). A New Rotation Invariant Goodness-of-Fit Test, Ph.D. dissertation, Bowling Green State University.

J. P. Imhof (1961). Computing the Distribution of Quadratic Forms in Normal Variables, Biometrika, Volume 48, Issue 3/4, 419-426.

D'Agostino R.B., Pearson E.S. (1973); Tests for Departure from Normality, Biometrika 60, 613–22.

D'Agostino R.B., Rosman B. (1974); The Power of Geary's Test of Normality, Biometrika 61, 181–84.

Shapiro S.S., Francia R.S. (1972); An Approximate Analysis of Variance Test for Normality, JASA 67, 215–216.

Shapiro S.S., Wilk M.B., Chen V. (1968); A Comparative Study of Various Tests for Normality, JASA 63, 1343–72.

Examples

1
normality(data=mtcars, vars=c("mpg","disp"), groupby=c("vs"))

jprice80/fullprocs documentation built on June 13, 2020, 11:09 p.m.