bws_test {BWStest} | R Documentation |
Perform the Baumgartner-Weiss-Schindler hypothesis test.
Description
Perform the Baumgartner-Weiss-Schindler hypothesis test.
Usage
bws_test(
x,
y,
method = c("default", "BWS", "Neuhauser", "B1", "B2", "B3", "B4", "B5"),
alternative = c("two.sided", "greater", "less")
)
Arguments
x |
a vector of the first sample. |
y |
a vector of the second sample. |
method |
a character string specifying the test statistic to use. should be one of the following:
Only Neuhauser's test supports one-sided alternatives. |
alternative |
a character string specifying the alternative hypothesis,
must be one of “two.sided” (default), “greater” or
“less”. You can specify just the initial letter.
“greater” corresponds to testing whether the survival function
of |
Value
Object of class htest
, a list of the test statistic,
the p-value, and the method
noted.
Note
The code will happily compute Murakami's B_3
through B_5
for large sample sizes, even though nominal coverage is not achieved.
A warning will be thrown. User assumes all risk relying on results from this
function.
Author(s)
Steven E. Pav shabbychef@gmail.com
References
W. Baumgartner, P. Weiss, H. Schindler, 'A nonparametric test for the general two-sample problem', Biometrics 54, no. 3 (Sep., 1998): pp. 1129-1135. doi:10.2307/2533862
See Also
bws_test
, bws_stat
,
murakami_stat
, murakami_cdf
.
Examples
# under the null
set.seed(123)
x <- rnorm(100)
y <- rnorm(100)
hval <- bws_test(x,y)
# under the alternative
set.seed(123)
x <- rnorm(100)
y <- rnorm(100,mean=1.0)
hval <- bws_test(x,y)
show(hval)
stopifnot(hval$p.value < 0.05)
# under the alternative with a one sided test.
set.seed(123)
x <- rnorm(100)
y <- rnorm(100,mean=0.7)
hval <- bws_test(x,y,alternative='less')
show(hval)
stopifnot(hval$p.value < 0.01)
hval <- bws_test(x,y,alternative='greater')
stopifnot(hval$p.value > 0.99)
hval <- bws_test(x,y,alternative='two.sided')
stopifnot(hval$p.value < 0.05)