Performs a two-sample Kuiper test using bootstrap resampling to test whether two independent samples come from the same distribution.
Kuiper2gof(
x,
y,
alternative = c("two.sided", "less", "greater"),
nboots = 2000,
keep.boots = FALSE
)An object of class "htest" containing:
The observed Kuiper statistic.
The p-value computed from the bootstrap distribution.
The specified alternative hypothesis.
A character string describing the test.
(If requested) A numeric vector of bootstrap statistics.
Numeric vectors of data values for the two samples.
Character string indicating the alternative hypothesis. Must be one of "two.sided", "less", or "greater".
Integer. Number of bootstrap resamples to compute the empirical null distribution (default: 2000).
Logical. If TRUE, returns all bootstrap test statistics.
The Kuiper test is a nonparametric test similar to the Kolmogorov–Smirnov test, but sensitive to discrepancies in both location and shape between two distributions. This implementation uses bootstrap resampling to estimate the p-value.
The two.sided test uses the sum of maximum positive and negative ECDF differences.
The greater and less options use one-sided variations.
If the observed test statistic exceeds all bootstrap values, the p-value is set to 1 / (2 * nboots) to avoid zero.
set.seed(123)
x <- rnorm(100, 0, 4)
y <- rnorm(100, 2, 4)
Kuiper2gof(x, y)
Run the code above in your browser using DataLab