calc_normal_tests: Tests of normality

View source: R/calc_normal_tests.R

calc_normal_testsR Documentation

Tests of normality

Description

Performs the following tests of normality given a data.frame and column:

  • Shapiro-Francia test for the composite hypothesis of normality,

  • (Robust) Jarque-Bera test of normality,

  • Shapiro-Wilk test of normality,

  • Anderson-Darling test for the composite hypothesis of normality,

  • One–sample Kolmogorov-Smirnov test.

Stata recommends to use the Shapiro-Francia test whenever possible. Note that NAs are removed by default.

  • Null hypothesis: the data follows a normal distribution.

  • Alternative hypothesis: the data does not follow a normal distribution.

Usage

calc_normal_tests(data, var)

Arguments

data

A tibble or data frame.

var

A numeric vector of data values.

Value

A tibble

Examples

library(dplyr)
library(tibble)
data <- tibble::tibble(
  x = c(rnorm(99, mean = 5, sd = 3), NA),
  y = runif(100, min = 2, max = 4),
  z = rnorm(100, mean = 2, sd = 3))

calc_normal_tests(data = data,
                  var = x)

calc_normal_tests(data = data,
                  var = y)


calc_normal_tests(data = data,
                  var = z)

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.