A village cricket team reckons their batsman score more runs on a sunny day than a cloudy day. To test this hypothesis they calculate the total number of runs scored by each of their eleven batsmen over the entire season, yielding the following results:

sunny <- c(100, 270, 314, 186, 271, 418, 31, 77, 21, 14, 8)
cloudy <- c(70, 100, 350, 141, 253, 68, 68, 40, 17, 16, 2)
df <- data.frame(sunny, cloudy)
rownames(df) <- paste0("day", 1:nrow(df))
df
##       sunny cloudy
## day1    100     70
## day2    270    100
## day3    314    350
## day4    186    141
## day5    271    253
## day6    418     68
## day7     31     68
## day8     77     40
## day9     21     17
## day10    14     16
## day11     8      2
  1. What is the null hypothesis? On average, a batsman scores as many runs on a sunny day than as on a cloudy day.

  2. Using a suitable test determine whether there is sufficient evidence to reject the null hypothesis. Assume an equal number of sunny and cloudy days during the season.

t.test(sunny, cloudy, paired = TRUE)
## 
##  Paired t-test
## 
## data:  sunny and cloudy
## t = 1.5613, df = 10, p-value = 0.1495
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -22.71407 129.07771
## sample estimates:
## mean of the differences 
##                53.18182

On average, batsmen score more runs on sunny days (155.4545455) than on cloudy days (102.2727273). There is insufficient evidence to suggest that this difference is significant (p-value > 0.05).

  1. What is the 95% confidence interval for the mean difference in runs scored on sunny and cloudy days?
t.test(sunny, cloudy, paired = TRUE)$conf.int
## [1] -22.71407 129.07771
## attr(,"conf.level")
## [1] 0.95