From: Michael G Rupert <mgrupert_at_usgs.gov>

Date: Tue, 12 Apr 2011 17:57:13 -0600

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 13 Apr 2011 - 04:58:35 GMT

Date: Tue, 12 Apr 2011 17:57:13 -0600

I have a question concerning the Wilcoxon signed-rank test, and
specifically, which R subroutine I should use for my particular dataset.
There are three different commands in R (that I'm aware of) that calculate
the Wilcoxon signed-rank test; wilcox.test, wilcox.exact, and
wilcoxsign_test. When I run the three commands on the same dataset, I get
different p-values. I'm hoping that someone can give me guidance on the
strengths and weaknesses of each command, why they produce different
p-values, and which one is the most appropriate for my particular needs.

To check on these R commands, I calculated the signed-rank tests using the dataset shown on page 658-659 of Pratt (1959). These R routines do not produce the same results as that listed in Pratt, which makes me think that the R routines are not calculating the statistics correctly. The following text shows the commands I use in R to calculate the signed-rank test using these different R commands:

Thanks in advance for any assistance.

--Mike

#################################################################################

library(exactRankTests) #this loads the package for calculating the
modified signed-rank test

library(coin) #this adds additional routines for the wilcoxon signed-rank
test and the Pratt signed-rank test

*#
*

# Data from Page 658 of Pratt

x <- c(1, 1, 1, 1, 1, 7, 10, 12, 13, 16, 17)
y <- c(1, 1, 3, 4, 6, 1, 1, 1, 1, 1, 1)

*#
***# STANDARD WILCOXON SIGNED RANK USING WILCOX.TEST
**
wilcox.test(x, y, alternative='two.sided', paired=TRUE)

# STANDARD WILCOXON SIGNED-RANK USING WILCOXSIGN_TEST.

# PRATT SIGNED-RANK TEST

wilcoxsign_test (x ~ y, zero.method = c("Pratt"))

[[alternative HTML version deleted]]

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 13 Apr 2011 - 04:58:35 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Wed 13 Apr 2011 - 11:20:29 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*