Learn R Programming

normality (version 0.0.3)

D.Agostino_Pearson_test: D'Agostino–Pearson K2 Normality Test

Description

The D'Agostino–Pearson chi-squared (K2) test is a moment-based omnibus test for normality.

Usage

D.Agostino_Pearson_test(
  x,
  alpha = 0.05,
  alternative = c("two.sided", "less", "greater"),
  silent = FALSE,
  summary = TRUE,
  misc = FALSE
)

Value

A list

Arguments

x

Numeric vector. Must have length at least 20.

alpha

Numeric (default: 0.05). Significance level for hypothesis testing. Must be between 0 and 1.

alternative

Character (default: "two.sided"). Specifies the alternative hypothesis. Available options are c("two.sided", "less", "greater"). Note that this option is only applied to the skewness and kurtosis components of the test.

silent

Logical (default: FALSE). If FALSE, results are printed to the console.

summary

Logical (default: TRUE). Produce a summary table.

misc

Logical (default: FALSE). Output other unimportant parameters.

Details

It evaluates the null hypothesis that the data come from a normal distribution by combining standardized measures of skewness and kurtosis into a single chi-squared test statistic.

References

D’Agostino, R.B., Belanger, A., D’Agostino, R.B., 1990. A Suggestion for Using Powerful and Informative Tests of Normality. Am. Stat. 44, 316–321. https://doi.org/10.1080/00031305.1990.10475751

Examples

Run this code
out <- D.Agostino_Pearson_test(rnorm(50))
print(out$summary)

Run the code above in your browser using DataLab