LinStatExpCov.RdStrasser-Weber type linear statistics and their expectation and covariance under the independence hypothesis
numeric matrix of transformations.
numeric matrix of influence functions.
an optional integer vector expanding X.
an optional integer vector expanding Y.
an optional integer vector of non-negative case weights.
an optional integer vector defining a subset of observations.
an optional factor defining independent blocks of observations.
a logical for switching off missing value checks. This
included switching off checks for suitable values of subset.
Use at your own risk.
a logical asking for variances only.
an integer defining the number of permuted statistics to draw.
a logical asking to standardise the permuted statistics.
tolerance for zero variances.
a contrast matrix to be left-multiplied in case X was a factor.
an object of class "LinStatExpCov".
The function, after minimal preprocessing, calls the underlying C code
and computes the linear statistic, its expectation and covariance and,
optionally, nresample samples from its permutation distribution.
When both ix and iy are missing, the number of rows of
X and Y is the same, ie the number of observations.
When X is missing and ix a factor, the code proceeds as
if X were a dummy matrix of ix without explicitly
computing this matrix.
Both ix and iy being present means the code treats them
as subsetting vectors for X and Y. Note that ix = 0
or iy = 0 means that the corresponding observation is missing
and the first row or X and Y must be zero.
lmult allows left-multiplication of a contrast matrix when X
was (equivalent to) a factor.
A list.
Strasser, H. and Weber, C. (1999). On the asymptotic theory of permutation statistics. Mathematical Methods of Statistics 8(2), 220–250.
wilcox.test(Ozone ~ Month, data = airquality, subset = Month %in% c(5, 8),
exact = FALSE, correct = FALSE)
#>
#> Wilcoxon rank sum test
#>
#> data: Ozone by Month
#> W = 127.5, p-value = 0.0001164
#> alternative hypothesis: true location shift is not equal to 0
#>
aq <- subset(airquality, Month %in% c(5, 8))
X <- as.double(aq$Month == 5)
Y <- as.double(rank(aq$Ozone, na.last = "keep"))
doTest(LinStatExpCov(X, Y))
#> $TestStatistic
#> [1] 3.853635
#>
#> $p.value
#> [1] 0.0001163773
#>