# \donttest{
# A study measures the plasma silicon levels before and after silicone implants surgery in 30
# women to evaluate the effect of the surgery. Informally speaking, we can be interested
# in that there is an unknown constant shift such that the the plasma silicon level of
# post-surgery can be explained completely based on that of pre-surgery. This can be stated
# as the null hypothesis `H_0` The difference of plasma silicon level between post-surgery and
# pre-surgery has a symmetric distribution around a shift that is unknown.
data("plasma.silicon")
post <- plasma.silicon$postoperative
pre <- plasma.silicon$preoperative
# post <- c(0.21,0.24,0.1,0.12,0.28,0.25,0.22,0.21,0.22,0.23,0.22,0.24,0.45,0.38,
# 0.23,0.22,0.18,0.15,0.04,0.14,0.24,0.2,0.24,0.18,0.19,0.15,0.26,0.3,0.22,0.24)
# pre <- c(0.15,0.13,0.39,0.2,0.39,0.42,0.24,0.18,0.26,0.12,0.1,0.11,0.19, 0.15,0.27,
# 0.28,0.11,0.11,0.18,0.18,0.24,0.48,0.27,0.22,0.18,0.19,0.32,0.31,0.19,0.21)
mod.symm.test(x=post, y=pre, alternative ="two.sided", method = "wilcox")
# Result:
# Modified Wilcoxon signed-rank test
# data: post and pre
# W = 238, p-value = 0.767
# alternative hypothesis: two.sided
# Interpretation:
# Test statistic `W` is the number of walsh average higher than sample mean, see more details
# in paper authored by Vexler, etc.
# p-value is 0.767, which implies there is no clue to reject the null hypothesis that
# the distribution of the difference of plasma silicon levels before and after
# silicone implants surgery is symmetric.
# }
Run the code above in your browser using DataLab