Skip to contents

This function gets the distance and p-value from a Kolmogorov-smirnov test for selected distributions against a continuous input variable. Possible distributions include "normal", "lognormal", "gamma", "exponential", and "all".

Usage

multiks_cont(var, distributions = "all")

Arguments

var

The variable to perform ks tests against

distributions

The distributions to test x against

Value

A dataframe with the distance and p value for each performed ks test

Examples

multiks_cont(iris$Sepal.Length)
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#>   Distribution Distance PValue
#> 1       Normal    0.089  0.181
#> 2    Lognormal    0.088  0.192
#> 3        Gamma    0.087  0.209
#> 4  Exponential    0.522  0.000

multiks_cont(iris$Sepal.Length, c("normal", "lognormal"))
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#> Warning: ties should not be present for the one-sample Kolmogorov-Smirnov test
#>   Distribution Distance PValue
#> 1       Normal    0.089  0.181
#> 2    Lognormal    0.088  0.192