pm.wilcox.test: Wilcoxon test for Partially Matched Two Sample Data

Description Usage Arguments Details Value Examples

View source: R/pm.wilcox.test.R

Description

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

Usage

1
2
3
4
5
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
Ypaired
Xextra
Yextra
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
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

robustrank documentation built on July 15, 2020, 5:08 p.m.