Main function of the package
sstn()
: This is the primary function of the package, which performs the SSTN to assess whether a given numeric sample originates from a normal distribution. The function returns a \(p\)-value indicating the significance of the deviation from normality.
Below, we provide a brief example of how to use the
sstn()
function.
set.seed(123)
# Sample from standard normal (null hypothesis true)
x <- rnorm(100)
res <- sstn(x)
#> SSTN
#> --------------------------------------------------
#> Number of summands: M = 1
#> Test statistic: 0.00227
#> p-value: 0.70800
res$p_value
#> [1] 0.708
# Sample from Gamma distribution (null hypothesis false)
y <- rgamma(100, 1)
res2 <- sstn(y)
#> SSTN
#> --------------------------------------------------
#> Number of summands: M = 13
#> Test statistic: 0.41964
#> p-value: 0.00000
res2$p_value
#> [1] 0