pm.wilcox.test {robustrank}R Documentation

Wilcoxon test for Partially Matched Two Sample Data

Description

Performs rank-based two sample test for partially matched two sample data by combining information from matched and unmatched data

Usage

pm.wilcox.test(Xpaired, Ypaired, Xextra = NULL, Yextra = NULL,
 alternative = c("two.sided", "less", "greater"),
 method = c("SR-MW", "MW-MW", "all"), mode = c("test",
 "var", "power.study"), useC = FALSE, correct = NULL,
 verbose=FALSE)

Arguments

Xpaired

Xpaired

Ypaired

Ypaired

Xextra

Xextra

Yextra

Yextra

alternative

alternative

method

String. SR-MW is recommended, all is for development only.

mode

String. Do not change it to var, for developpment only.

useC

Boolean. Do not set it to TRUE, for development only.

verbose

verbose

correct

Continuity correction.

Details

If Xpaired and Ypaired have NAs, the corresponding unpaired data in Ypaired and Xpaired will be combined with Yextra and Xextra.

Value

An htest object.

Examples


set.seed(1)
z=rnorm(20, sd=0.5) # induces correlation between X and Y
X=rnorm(20)+z
Y=rnorm(20,mean=0.8)+z
X[1:10]=NA
boxplot(X,Y,names=c("X","Y"))

pm.wilcox.test(X,Y)
# for comparison
wilcox.test(X,Y,paired=TRUE)
wilcox.test(X,Y,paired=FALSE)# often a conservative test due to the correlation

# no paired data
Y1=Y
Y1[11:20]=NA
pm.wilcox.test(X,Y1)
# should match the following
wilcox.test(X,Y1,paired=FALSE)

# only 1 pair of matched data
Y1=Y
Y1[12:20]=NA
pm.wilcox.test(X,Y1)



[Package robustrank version 2024.1-28 Index]