Data Driven Smooth Test for Two-Sample Problem
Source:R/ddst.twosample.test.R
ddst.twosample.test.RdPerforms data driven smooth test for the classical two-sample problem. It is a special case of data driven test for k-samples. Detailed description of the test statistic is provided in Wylupek (2010).
Usage
ddst.twosample.test(
x,
y,
d.N = 12,
c = 2,
B = 1e+05,
compute.p = TRUE,
alpha = 0.05,
compute.cv = TRUE
)Arguments
- x
a (non-empty) numeric vector of data
- y
a (non-empty) numeric vector of data
- d.N
an integer specifying the maximum dimension considered, only for advanced users
- c
a calibrating parameter in the penalty in the model selection rule
- B
an integer specifying the number of runs for a p-value and a critical value computation if any
- compute.p
a logical value indicating whether to compute a p-value or not
- alpha
a significance level
- compute.cv
a logical value indicating whether to compute a critical value corresponding to the significance level alpha or not
References
Data-driven k-sample tests. Wylupek (2010) https://www.jstor.org/stable/40586684?seq=1
Examples
set.seed(7)
# H0 is true
x <- runif(80)
y <- runif(80)
t <- ddst.twosample.test(x, y)
t
#>
#> Data Driven Smooth Test for Two-Sample Problem
#>
#> data: listxy, c: 2, d.N: 12
#> WT = 0.108, T = (1, 1)
#>
plot(t)
# H0 is false
x <- runif(80)
y <- rexp(80, 1)
t <- ddst.twosample.test(x, y)
t
#>
#> Data Driven Smooth Test for Two-Sample Problem
#>
#> data: listxy, c: 2, d.N: 12
#> WT = 22.785, T = (3, 3)
#>
plot(t)