Learn R Programming

normality (version 0.0.1)

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

Description

The D'Agostino–Pearson Chi-square (K2) test is a statistical test for assessing whether a sample comes from a normal distribution. It combines information from skewness (asymmetry) and kurtosis (tail heaviness) into a single omnibus test statistic.

Usage

D.Agostino_Pearson_test(
  x,
  alpha = 0.05,
  alternative = c("two.sided", "less", "greater"),
  min_n = 20
)

Value

A list:

  • is_normal: Is the input data normally distributed?

  • method: The name of the test.

  • alpha: Significance threshold (default: 0.05).

  • alternative: The alternative hypothesis (H1) to test.

  • summary_table: Statistic summary, if any. Mostly output as a data frame.

  • statistic: The value used to calculate p-value.

  • pvalue: The p value.

  • confidence_interval: The lower and upper bound of confidence interval (CI).

Arguments

x

A numeric vector.

alpha

Significance threshold (default: 0.05).

alternative

Character (default: "two.sided). The alternative hypothesis (H1) to test. Available options are c("two.sided", "less", "greater"). Note that, this is only applied on skewness and kurtosis test.

min_n

Integer. The minimum observations required (default: 20).

References

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

Examples

Run this code
D.Agostino_Pearson_test(cholesterol)

Run the code above in your browser using DataLab