KSLTest: Kolmogorov-Smirnov-Lilliefors Test

View source: R/normal_Tests.R

KSLTestR Documentation

Kolmogorov-Smirnov-Lilliefors Test

Description

This function computes the Lilliefors variant of the one-sample Kolmogorov-Smirnov test.

Usage

KSLTest(data, alpha = 0.05, j = 1, warn = T)

Arguments

data

The data of a univariate distribution for which the test statistic is computed (vector)

alpha

The two-sided decision threshold used for hypothesis-testing (scalar)

j

The # hypotheses tested; used to compute a Bonferonni correction, if applicable; should remain at its default if multiple testing is not an issue (scalar)

warn

Used for printing a warning message when negative values are imputed to 0.0 (boolean)

Details

Molin & Abdi's (1998) algorithmic approximation of p-values is used for hypothesis-testing. Note that this algorithm requires the imputation of 0.0 for negative output when p-values would otherwise be low in value (< 0.001) using other methods. A similar issue with extremely large values requires the imputation of 1.0 for values larger than 1.0 when p > .99.

Value

An object including the test statistic, p-value, and a significance flag (list)

References

Lilliefors, H.W. (1967). On the Kolmogorov-Smirnov Test for Normality with Mean and Variance Unknown. Journal of the American Statistical Association, 62, 399-402.

Molin, P., & Abdi, H. (1998). New Tables and numerical approximation for the KolmogorovSmirnov/Lillierfors/Van Soest test of normality.

Examples

values <- rnorm(100)
x <- KSLTest(data = values)

Rita documentation built on March 18, 2022, 6:36 p.m.

Related to KSLTest in Rita...