Learn R Programming

NSM3 (version 1.1)

pPairedWilcoxon: Paired Wilcoxon

Description

Function to extend wilcox.test to compute the (exact or Monte Carlo) P-value for paired Wilcoxon data in the presence of ties.

Usage

pPairedWilcoxon(x,y=NA,g=NA,method=NA,n.mc=10000)

Arguments

Value

Returns a list with "NSM3Ch5p" class containing the following components:mnumber of observations in the first data group (X)nnumber of observations in the second data group (Y)obs.statthe observed T+ statisticp.valupper tail P-value

Details

The data entry is intended to be flexible, so that the two groups of data can be entered in any of three ways. For data a=1,2 and b=3,4 all of the following are equivalent: pPairedWilcoxon(x=c(1,2),y=c(3,4)) pPairedWilcoxon(x=list(c(1,2),c(3,4))) pPairedWilcoxon(x=c(1,2,3,4),g=c(1,1,2,2))

See Also

Also see stats::wilcox.test()

Examples

Run this code
##Hollander-Wolfe-Chicken Example 3.1 Hamilton Depression Scale Factor IV
x <-c(1.83, .50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
y <-c(0.878, .647, .598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)

wilcox.test(y,x,paired=TRUE,alternative="less")
pPairedWilcoxon(x,y)

Run the code above in your browser using DataLab