murakami_stat {BWStest} | R Documentation |
Compute Murakami's test statistic.
Description
Compute one of the modified Baumgartner-Weiss-Schindler test statistics proposed by Murakami, or Neuhauser.
Usage
murakami_stat(x, y, flavor = 0L)
murakami_stat_perms(nx, ny, flavor = 0L)
Arguments
x |
a vector of the first sample. |
y |
a vector of the second sample. |
flavor |
which ‘flavor’ of test statistic. |
nx |
the length of |
ny |
the length of |
Details
Given vectors X
and Y
, computes B_{jX}
and B_{jY}
for some j
as described by Murakami and by Neuhauser, returning either their
their average or their average distance.
The test statistics approximate the weighted square norm of the
difference in CDFs of the two distributions.
The test statistic is based only on the ranks of the input. If the same monotonic transform is applied to both vectors, the result should be unchanged.
The various ‘flavor’s of test statistic are:
- 0
The statistic of Baumgartner-Weiss-Schindler.
- 1
Murakami's
B_1
statistic, from his 2006 paper.- 2
Neuhauser's difference statistic, denoted by Murakami as
B_2
in his 2012 paper.- 3
Murakami's
B_3
statistic, from his 2012 paper.- 4
Murakami's
B_4
statistic, from his 2012 paper.- 5
Murakami's
B_5
statistic, from his 2012 paper, with a log weighting.
Value
The BWS test statistic, B_j
. For murakami_stat_perms
, a vector of
the test statistics for all permutations of the input.
Note
NA
and NaN
are not yet dealt with!
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
M. Neuhauser, 'Exact tests based on the Baumgartner-Weiss-Schindler Statistic–a survey', Statistical Papers 46, no. 1 (2005): pp. 1-30. doi:10.1007/BF02762032
M. Neuhauser, 'One-sided two-sample and trend tests based on a modified Baumgartner-Weiss-Schindler statistic', J. Nonparametric Statistics 13, no. 5 (2001): pp 729-739. doi:10.1080/10485250108832874
H. Murakami, 'K-sample rank test based on modified Baumgartner statistic and its power comparison', J. Jpn. Comp. Statist. 19, no. 1 (2006): pp. 1-13. doi:10.5183/jjscs1988.19.1
H. Murakami, 'Modified Baumgartner Statistics for the two-sample and multisample problems: a numerical comparison', J. Stat. Comp. and Sim. 82, no. 5 (2012): pp. 711-728. doi:10.1080/00949655.2010.551516
H. Murakami, 'Lepage type statistic based on the modified Baumgartner statistic', Comp. Stat. & Data Analysis 51 (2007): pp 5061-5067. doi:10.1016/j.csda.2006.04.026
See Also
Examples
set.seed(1234)
x <- runif(1000)
y <- runif(100)
bval <- murakami_stat(x,y,1)
nx <- 6
ny <- 5
# monte carlo
set.seed(1234)
repli <- replicate(3000,murakami_stat(rnorm(nx),rnorm(ny),0L))
# under the null, perform the permutation test:
allem <- murakami_stat_perms(nx,ny,0L)
plot(ecdf(allem))
lines(ecdf(repli),col='red')