In: Statistics and Probability
Using R Studio/R programming...
A consumer-reports group is testing whether a gasoline additive
changes a car's gas mileage. A test of seven cars finds an average
improvement of 0.4 miles per gallon with a standard deviation of
3.57. Is the difference significantly greater than 0? Assume that
the values are normally distributed.
What would the code be?
Attached is the R code marked in BOLD
# Test of Hypotheis
# Ho : mu =0 , vs Ha : mu >0
mu <- 0
x <- 0.4
s <- 3.57
n <- 7
t <- (x-mu)/(s/sqrt(n))
p_value <- pt(t, n-1, lower.tail = FALSE)
print(t)
print(p_value)
Ans
t = 0.2964427 with 6 degrees of freedom
p_value = 0.3884428
Conclusion
Since p_value > =0.05 we do not have sufficient evidence to reject Ho and conclude that there is no significant improvement in mileage.