#Test for median of one population #H0: M = 2, H1 M > 2 m0 <- 2 price <- c( 2.15, 1.13, 2.25, 2.5, 2.3) median(price) #check for outliers and for normality boxplot(price) qqnorm(price) shapiro.test(price) #check for ties #differences between price and hypothesised median price_m0 = price - m0 price_m0 #Wilcoxon signed rank test for the median wilcox.test(price, alternative="greater", mu=2,conf.int=TRUE)