Q3(b).

t5q3 <- read.table("C:/Users/Wei Hao/Desktop/ST2137/Tutorials/Data/battery.txt", header=T)
attach(t5q3)
t.test(life, mu=400, conf.level=0.95, alternative="greater")
## 
##  One Sample t-test
## 
## data:  life
## t = 1.2444, df = 12, p-value = 0.1186
## alternative hypothesis: true mean is greater than 400
## 95 percent confidence interval:
##  374.8982      Inf
## sample estimates:
## mean of x 
##  458.0769

Since \(H_0\) : \(\mu = 400\) against \(H_1: \mu > 400\) and \(t_{obs} = 1.244 < t_{0.05}(12) = 1.78\) or p-value \(= 0.1186\), we do not reject \(H_0\).