Learn R Programming

DFA.CANCOR (version 0.4.3)

NORMALITY: Univariate and multivariate normality

Description

Produces tests of univariate and multivariate normality using the MVN package.

Usage

NORMALITY(data, groups, variables, verbose)

Value

The returned output is a list with the following elements:

descriptives

descriptive statistics, including skewness and kurtosis

univariate_tests

the univariate normality tests

multivariate_tests

the multivariate normality tests

Arguments

data

A dataframe or numeric matrix where the rows are cases & the columns are the variables.

groups

(optional) The name of the groups variable in the dataframe,
e.g., groups = 'Group'.

variables

(optional) The names of the continuous variables in the dataframe for the analyses, e.g., variables = c('varA', 'varB', 'varC').

verbose

Should detailed results be displayed in the console?
The options are: TRUE (default) or FALSE.

Author

Brian P. O'Connor

Details

If "groups" is not specified, the analyses will be run on all of the variables in "data". If "variables" is specified, the analyses will be run on the "variables" in "data". If "groups" is specified, the analyses will be run for every value of "groups". If verbose = TRUE, the displayed output includes descriptive statistics and tests of univariate and multivariate normality.

References

Doornik, J. A. & Hansen, H. (2008). An Omnibus test for univariate and multivariate normality. Oxford Bulletin of Economics and Statistics 70, 927-939.

Henze, N., & Wagner, T. (1997), A new approach to the BHEP tests for multivariate normality. Journal of Multivariate Analysis, 62, 1-23.

Johnson, R. A., & Wichern, D. W. (2007). Applied Multivariate Statistical Analysis (3rd. ed.). New Jersey, NJ: Prentice Hall.

Korkmaz, S., Goksuluk, D., Zararsiz, G. (2014). MVN: An R package for assessing multivariate normality. The R Journal, 6(2), 151-162.

Mardia, K. V. (1970), Measures of multivariate skewnees and kurtosis with applications. Biometrika, 57(3), 519-530.

Mardia, K. V. (1974), Applications of some measures of multivariate skewness and kurtosis for testing normality and robustness studies. Sankhy A, 36, 115-128.

Royston, J. P. (1992). Approximating the Shapiro-Wilk W-Test for non-normality. Statistics and Computing, 2, 117-119.

Shapiro, S., & Wilk, M. (1965). An analysis of variance test for normality. Biometrika, 52, 591611.

Szekely,G. J., & Rizzo, M. L. (2017). The energy of data. Annual Review of Statistics and Its Application 4, 447-79.

Tabachnik, B. G., & Fidell, L. S. (2019). Using multivariate statistics (7th ed.). New York, NY: Pearson.

Examples

Run this code
# data that simulate those from De Leo & Wulfert (2013)
NORMALITY(data = na.omit(data_CANCOR$DeLeo_2013[c(
          'Unprotected_Sex','Tobacco_Use','Alcohol_Use','Illicit_Drug_Use',
          'Gambling_Behavior','CIAS_Total','Impulsivity','Social_Interaction_Anxiety',
          'Depression','Social_Support','Intolerance_of_Deviance','Family_Morals',
          'Family_Conflict','Grade_Point_Average')]))

# \donttest{
# data from Field et al. (2012)
NORMALITY(data = data_DFA$Field_2012, 
          groups = 'Group', 
          variables = c('Actions','Thoughts'))

# data from Tabachnik & Fidell (2013, p. 589)
NORMALITY(data = na.omit(data_CANCOR$TabFid_2019_small[c('TS','TC','BS','BC')]))

# UCLA dataset
UCLA_CCA_data <- read.csv("https://stats.idre.ucla.edu/stat/data/mmreg.csv")
colnames(UCLA_CCA_data) <- c("LocusControl", "SelfConcept", "Motivation",
                             "read", "write", "math", "science", "female")
summary(UCLA_CCA_data)
NORMALITY(data = na.omit(UCLA_CCA_data[c("LocusControl","SelfConcept","Motivation",
                                         "read","write","math","science")]))
# }

Run the code above in your browser using DataLab