QUESTION 2

Quiz 3 in Data Analysis

Ma. Angelika C. Regoso

07-24-2021





PROBLEM

A gasoline was used in 16 similar automobiles under identical conditions. The corresponding sample 16 values (miles per gallon) had mean 19.6 and standard deviation 0.4. Under the same conditions, high-power brand B gasoline gave a sample of 16 values with mean 20.2 and standard deviation 0.6. Is the mileage of B significantly better than that of A? Assume normality. Test the hypothesis using both P-value and fixed significance level with α = 0.05 approaches (if possible).


Gasoline A Gasoline B
\(n_1=16\) \(n_2=16\)
\(\bar{x_1}=19.6\) \(\bar{x_2}=20.2\)
\(S=0.4\) \(S=0.6\)

ANSWER TO

Is the mileage of B significantly better than that of A?

We may solve this problem through a seven-step procedure:

1. Parameter of Interest

The quantity of interest is the difference in the mean mileage of the gasoline,\(\mu_1=\mu_2\) and \(∆0 =0\)

2. Null hypothesis, \(H_0\)

\(H_0:\ \mu_1-\mu_2=0\)

3. Alternative Hypothesis \(H_1\)

\(H_1:\ \mu_2>\ \mu_1\)

We want to reject the \(H_0\) if the high-power brand B’s mileage is significantly better than that of A.

4. Test Statistic

The test statistic is:

\(t_0=\frac{\bar{x}_1-\bar{x}_2 - ∆_0}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}\)

5. Reject \(H_0\) if:

Reject \(H_0\):\(\ \mu_1-\mu_2=0\) if p-value is less than 0.05. To use a fixed significance level test, let’s find out first the degrees of freedom \(V\) on \(t_0\).

\(v=\frac{\left(\frac{{S_1}^2}{n_1}+\frac{{S_2}^2}{n_2}\right)^2}{\frac{\left({S_1}^2/n_1\right)^2}{n_1-1}+\frac{\left({S_2}^2/n_2\right)^2}{n_2-1}}\)

Using the values in this table:

Gasoline A Gasoline B
\(n_1=16\) \(n_2=16\)
\(\bar{x_1}=19.6\) \(\bar{x_2}=20.2\)
\(S=0.4\) \(S=0.6\)

Manual Computation

\(v=\frac{\left(\frac{{0.4}^2}{16}+\frac{{0.6}^2}{16}\right)^2}{\frac{\left({0.4}^2/16\right)^2}{16-1}+\frac{\left({0.6}^2/16\right)^2}{16-1}}\)

\(v=26.13402062\)

R Computation

#v-degrees of freedom
meangasB <-20.2
meangasA <-19.6
sdgasB <-0.6
sdgasA <-0.4
nsampB <-16
nsampA <-16
v<- ( (sdgasB^2/nsampB + sdgasA^2/nsampA)^2 )/( (sdgasB^2/nsampB)^2/(nsampB-1) + (sdgasA^2/nsampA)^2/(nsampA-1) )
v
[1] 26.13402

Thus, the degrees of freedom \(v\) to be used in this problem is \(26.13402\)

This means that the t-critical value is \(t_{0.05,26.13402}\).

Therefore, in using a fixed significance level test, we would reject \(H_0\) if \(t_0<-t_{0.05,26.13402}\)

6. Computations

The T-statistic:

1. Manual Computation

Since,\(\ ∆0 =0\) , \(n_1=16\), \(n_2=16\), \(\bar{x_1}=19.6\), \(\bar{x_2}=20.2\), \(s_1=0.4\), and \(s_2=0.6\),

\(t_0=\frac{19.6-20.2 -0}{\sqrt{\frac{0.4^2}{16}+\frac{0.6^2}{16}}}\)

\(t_0=-3.328201\)

2. R Computation

delta_0 <- 0

# by assumption
s_1 <- 0.4
s_2 <- 0.6

n_1 <- 16
n_2 <- 16

meangasA <- 19.6
meangasB <- 20.2

# calculate the t-statistic
t_stat <- (meangasA - meangasB - delta_0) / 
  sqrt(s_1^2 / n_1 + s_2^2 / n_2)

t_stat
## [1] -3.328201



The P-value:

The P-value serves as evidence against a null hypothesis. When the p value is relatively smaller, it means that the evidence to reject the null hypothesis is stronger.

1. Manual Computation

In a lower-tailed test, the p-value is the total region to the left of our computed t-statistic. It is the P=\(\ \phi(t_0)\)

\(P=\ \phi(-3.33)\)
\(P=0.001303\)

2. R Computation

#p-value
pt(-3.328201, v, lower.tail=TRUE)
## [1] 0.001302689

Fixed-Significance Level Test

#critical value
qt(p=.05, df=v, lower.tail = TRUE)
## [1] -1.705295

In a lower-tailed test at a significance level of α=0.05, the critical value is \({-t}_{\alpha, df}={-t}_{0.05, 26.13402}=-1.705295\). Meanwhile, our computed t-statistic is \(t_0=-3.328201.\)

Critical region:\(\ (-\infty,-1.705295)\)

7. Conclusion

At 0.05 level of significance, we reject the \(H_0\):\(\ \mu_1-\mu_2=0\), since the computed p-value, 0.001302689, is less than 0.05. Furthermore, the computed t-statistic \((t_0)\), which is -3.328201, is less than the critical value \((t_{\alpha,df})\) of the lower-tailed test, that is -1.705295. This means that our t-statistic falls in the rejection region \((-\infty,-1.705295)\).

Rejecting the null hypothesis means that the two means mileage of two brands of gasoline differs. In fact, there is a strong evidence that the gas mileage of the brand B is significantly better that the gas mileage of the brand A.


REFERENCES

Montgomery, Douglas C, and George C Runger. 2010. Applied Statistics and Probability for Engineers. John Wiley & Sons.
Statistics-How-To. n.d. “P-Value in Statistical Hypothesis Tests: What Is It?” https://www.statisticshowto.com/probability-and- statistics/statistics-definitions/p-value/.