Given the following data, and hypothesized median M.0 I've found a method to implement the Wilcoxon signed-rank test. Data: (with one zero difference and tied ranks) x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, 91,142, 119, 137) M.0 <- 119> library(exactRankTests)Package ?exactRankTests? is no longer under development. Please consider using package ?coin? instead.> wilcox.exact(x, mu=M.0)Exact Wilcoxon signed rank test data: x V = 65.5, p-value = 0.771 alternative hypothesis: true mu is not equal to 119 I've been unable to implement this test using library(coin) - is this possible? Thanks. --Dale
Dale Steele wrote:> Given the following data, and hypothesized median M.0 I've found a > method to implement the Wilcoxon signed-rank test. > > Data: (with one zero difference and tied ranks) > > x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, > 91,142, 119, 137) > M.0 <- 119 > >> library(exactRankTests) > Package ?exactRankTests? is no longer under development. > Please consider using package ?coin? instead. > >> wilcox.exact(x, mu=M.0) > > Exact Wilcoxon signed rank test > > data: x > V = 65.5, p-value = 0.771 > alternative hypothesis: true mu is not equal to 119 > > > I've been unable to implement this test using library(coin) - is this possible? > > Thanks. --Dale >Try this: wilcoxsign_test(x ~ rep(M.0, length(x)), dist = 'exact') -- Peter Ehlers University of Calgary
Reasonably Related Threads
- The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?
- one sample Wilcoxon test using 'coin'
- exact Wilcoxon signed rank test with ties and the "no longer under development" exactRanksumTests package
- Wilcoxon Rank test of Package Coin
- permutation test on paired samples