Description Usage Arguments Details Value Source References See Also Examples
Perform a one-sample two-sided exact Kolmogorov-Smirnov test, similarly to
ks.test
from package stats
, but using an improved
routine.
1 | ks.test.imp(x, y, ...)
|
x |
a numeric vector of data values. |
y |
either a numeric vector of data values, or a character string
naming a cumulative distribution function or an actual cumulative
distribution function such as |
... |
parameters of the distribution specified (as a character
string) by |
This routine is equivalent to ks.test(x, y, ..., exact=TRUE)
but uses
an improved method based on pkolmim
. For more details about
the arguments, please refer to the documentation for ks.test
.
A list with class "htest"
containing the following components:
statistic |
the value of the test statistic. |
p.value |
the p-value of the test. |
alternative |
"two-sided". |
method |
a character string indicating what type of test was performed. |
data.name |
a character string giving the name(s) of the data. |
The two-sided one-sample distribution comes via Carvalho (2015).
Luis Carvalho (2015), An Improved Evaluation of Kolmogorov's Distribution. Journal of Statistical Software, 65/3, 1–7. http://www.jstatsoft.org/v65/c03/.
pkolmim
for the cumulative distribution function of
Kolmogorov's goodness-of-fit measure.
1 2 3 4 5 6 7 8 9 | x <- abs(rnorm(100))
p.kt <- ks.test(x, "pexp", exact = TRUE)$p
p.ktimp <- ks.test.imp(x, "pexp")$p
abs(p.kt - p.ktimp)
# compare execution times
x <- abs(rnorm(2000))
system.time(ks.test.imp(x, "pexp"))
system.time(ks.test(x, "pexp", exact = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.