15.4 Example 2

Michael Sullivan

2023-08-30

The Wilcoxon Ranked-Sums Test may also be used for single sample hypothesis testing on the median. We illustrate the process next by following Example 2 from Section 15.4. In this example, we are testing H_0: M = 273 dollars versus H_1: M > 273 dollars.

Begin by entering the data in Table 7.

Parking <- c(225,290,110,343,260,340,295,280,235,250,355,300)

Now conduct the test using the wilcox.test() function. Be sure to include mu = M where M is the median stated in the null hypothesis. The default is a two-tailed test. For a right-tailed test, include alternative = ‘greater’; for a left-tailed test include alternative = ‘less’.

wilcox.test(Parking,mu=273,alternative='greater')

##
##  Wilcoxon signed rank exact test
##
## data:  Parking
## V = 44, p-value = 0.3667
## alternative hypothesis: true location is greater than 273

The P-value is 0.3667.