bws_test | R Documentation |
Perform the Baumgartner-Weiss-Schindler hypothesis test.
bws_test(
x,
y,
method = c("default", "BWS", "Neuhauser", "B1", "B2", "B3", "B4", "B5"),
alternative = c("two.sided", "greater", "less")
)
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 |
Object of class htest
, a list of the test statistic,
the p-value, and the method
noted.
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.
Steven E. Pav shabbychef@gmail.com
W. Baumgartner, P. Weiss, H. Schindler, 'A nonparametric test for the general two-sample problem', Biometrics 54, no. 3 (Sep., 1998): pp. 1129-1135. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2533862")}
bws_test
, bws_stat
,
murakami_stat
, murakami_cdf
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.