2. Complete the following hypothesis test / confidence interval questions (a) Su
ID: 3311946 • Letter: 2
Question
2. Complete the following hypothesis test / confidence interval questions (a) Suppose that I have an annoying uncle that claims he knows everything about cars! He made the ridiculous statement that average fuel mileage was just as good in the mid-1970s as it is now. I want to prove him wrong and show him the fuel mileage was less then than it is now. I know that the average fuel mileage for vehicles today is around 25 miles per gallon. I go out and find historical data about cars from 1973-1974. The dataset is called mtcars and is available in the statistical software R through the package ggplot2. I have provided the data in the files section of Canvas. Perform the appropriate hypothesis test and generate the correct confidence interval using correct language to state conclusions. (b) My uncle also makes the claim that a greater number of cars had a manual transmission. Specif- ically, he said that 60 % of cars had a manual transmission. Still use the mt cars dataset. The specific column to use am and it is coded as 0 = automatic and 1 manual. Perform the ap- propriate hypothesis test and generate the correct confidence interval, using correct language to state conclusions.Explanation / Answer
a. I am adding R-code for the analysis:
library(ggplot2)
data("mtcars")
mtcars
t.test(mtcars$mpg, mu = 25, alternative = "greater")
One Sample t-test
data: mtcars$mpg
t = -4.6079, df = 31, p-value = 1
alternative hypothesis: true mean is greater than 25
95 percent confidence interval:
18.28418 Inf
sample estimates:
mean of x
20.09062
t.test(mtcars$mpg, mu = 25, alternative = "less")
One Sample t-test
data: mtcars$mpg
t = -4.6079, df = 31, p-value = 3.293e-05
alternative hypothesis: true mean is less than 25
95 percent confidence interval:
-Inf 21.89707
sample estimates:
mean of x
20.09062
On the basis of p-value of both tests (with alternative as greater and less), we conclude that the milage now is higher than before.
Both sided alternative test
t.test(mtcars$mpg, mu = 25)
One Sample t-test
data: mtcars$mpg
t = -4.6079, df = 31, p-value = 6.587e-05
alternative hypothesis: true mean is not equal to 25
95 percent confidence interval:
17.91768 22.26357
sample estimates:
mean of x
20.09062
CONFIDENCE INTERVAL :
95 percent confidence interval:
17.91768 22.26357
B.
data("mtcars")
attach(mtcars)
mtcars
x<-c(sum(am), length(am)-sum(am))
x
binom.test(x,p=0.6)
Exact binomial test
data: x
number of successes = 13, number of trials = 32, p-value = 0.03003
alternative hypothesis: true probability of success is not equal to 0.6
95 percent confidence interval:
0.2369841 0.5935508
sample estimates:
probability of success
0.40625
Conclusion: As p-value is less than 0.05, we reject the null hupothesis that 60% cars were manual.
95% confidence interval for p =
95 percent confidence interval:
0.2369841 0.5935508
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.