In: Statistics and Probability
The table below contains bus fares in 20 different cities
1.2, 1.3, 1.4, 1.6, 1.65, 1.8, 1.9, 2.0, 2.2, 2.25
2.5, 2.6, 2.7, 2.9, 3.0, 3.2, 4.0, 5.0, 8, 10
(b) Carry out a t-test of the hypothesis H0: μ = 3 vs. Ha: μ < 3. Find the p-value and state your conclusions at α = 0.05.
** Please clearly explain how to obtain P-value** This is what is confusing me most.
Solution:
The null and alternative hypothesis are as follows:
To test the hypothesis the most appropriate test is one sample t-test. The test statistic is given as follows:
Where, , , n is sample size and μ0 is value of μ specified under H0.
We have n = 20
The value of the test statistic is 0.1189
Our test is left tailed test, therefore we shall obtain left tailed p-value for the test statistic. The left tailed p-value for the test statistic is given as follows:
p-value = P(T < t)
p-value = P(T < 0.1189)
To obtain the p-value we can use R software. The R code for the one sample t-test is given below:
When we execute the above code in R we get the following output:
p-value = 0.5467
Given that significance level α = 0.05
(0.5467 > 0.05)
Since, p-value is greater than the significance level of 0.05, therefore we shall be fail to reject the null hypothesis (H0) at 0.05 significance level.
Conclusion: At α = 0.05, there is not sufficient evidence to support the claim that bus fair is less than 3.