1). An official claims that the average wind speed in the city is 9 miles per hour. Is this plausible?
View(airquality)qplot(airquality$Wind)
Warning: `qplot()` was deprecated in ggplot2 3.4.0.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
t.test(airquality$Wind,mu=9)
One Sample t-test
data: airquality$Wind
t = 3.3619, df = 152, p-value = 0.0009794
alternative hypothesis: true mean is not equal to 9
95 percent confidence interval:
9.394804 10.520229
sample estimates:
mean of x
9.957516
Given the p-value is very small, it isn’t plausible and it’s safe to reject the null hypothesis (average wind speed of 9 miles per hour).
2). A certain solar array will only be cost-effect if mean solar radiation is over 175 Langleys. Would it be a sound investment in light of this data?
qplot(airquality$Solar.R)
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
t.test(airquality$Solar.R,mu =175, alternative ='greater')
One Sample t-test
data: airquality$Solar.R
t = 1.4667, df = 145, p-value = 0.07232
alternative hypothesis: true mean is greater than 175
95 percent confidence interval:
173.5931 Inf
sample estimates:
mean of x
185.9315
Given the p-value is 0.07, there’s no good evidence to suggest that this investment would net a positive return.