Q4(b).

t5q4 <- read.table("C:/Users/Wei Hao/Desktop/ST2137/Tutorials/Data/furniture.txt", header=T)
attach(t5q4)
daysnon0 <- days[days != 20]
binom.test(sum(daysnon0 > 20), length(daysnon0), alternative="greater")
## 
##  Exact binomial test
## 
## data:  sum(daysnon0 > 20) and length(daysnon0)
## number of successes = 35, number of trials = 49, p-value =
## 0.001901
## alternative hypothesis: true probability of success is greater than 0.5
## 95 percent confidence interval:
##  0.5899149 1.0000000
## sample estimates:
## probability of success 
##              0.7142857
wilcox.test(daysnon0, mu=20, alternative="greater")
## Warning in wilcox.test.default(daysnon0, mu = 20, alternative = "greater"):
## cannot compute exact p-value with ties
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  daysnon0
## V = 926, p-value = 0.0009203
## alternative hypothesis: true location is greater than 20

We have \(H_0: \mu = 20\) against \(H_1: \mu > 20\). Since Sign test: p-value = 0.0019, Signed rank test: p-value = 0.0009, we reject \(H_0\).