Learn R Programming

SciencesPo (version 1.3.9)

agostino: D'Agostino test of skewness

Description

Performs the D'Agostino test for skewness in normally distributed data.

Usage

agostino(x, alternative = c("two.sided", "less", "greater"))

Arguments

x
A numeric vector of data values.
alternative
A character string specifying the alternative hypothesis, must be one of '"two.sided"' (default), '"greater"' or '"less"'. You can specify just the initial letter.

Details

Under the hypothesis of normality, data should be symmetrical (i.e. skewness should be equal to zero). This test has such null hypothesis and is useful to detect a significant skewness in normally distributed data.

References

D'Agostino, R.B. (1970). Transformation to Normality of the Null Distribution of G1. Biometrika, 57, 3, 679-681.

Examples

Run this code
set.seed(1234)
x = rnorm(1000)

skewness(x) # is data normal?

agostino(x)

Run the code above in your browser using DataLab