# 9.2.2 - Hypothesis Testing

9.2.2 - Hypothesis TestingThe formula for the test statistic follows the same general format as the others that we have seen this week:

- Test Statistic
- \(test\; statistic = \dfrac{sample \; statistic - null\;parameter}{standard \;error}\)

**Minitab Express will compute the test statistic for you!** You will just need to determine if equal variances should be assumed or not. There is one example below walking through these procedures by hand, but you are strongly encouraged to use Minitab Express whenever possible.

There are two assumptions: (1) the two samples are independent and (2) both populations are normally distributed or \(n_1 \geq 30\) and \(n_2 \geq 30\). If the second assumption is not met then you can conduct a randomization test.

Below are the possible null and alternative hypothesis pairs:

Research Question | Are the means of group 1 and group 2 different? | Is the mean of group 1 greater than the mean of group 2? | Is the mean of group 1 less than the mean of group 2? |
---|---|---|---|

Null Hypothesis, \(H_{0}\) | \(\mu_1 = \mu_2\) | \(\mu_1 = \mu_2\) | \(\mu_1 = \mu_2\) |

Alternative Hypothesis, \(H_{a}\) | \(\mu_1 \neq \mu_2\) | \(\mu_1 > \mu_2\) | \(\mu_1 < \mu_2\) |

Type of Hypothesis Test | Two-tailed, non-directional | Right-tailed, directional | Left-tailed, directional |

**Standard Error**

\(\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\)

**Test Statistic for Independent Means**

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

**Estimated Degrees of Freedom**

\(df=smallest\;n - 1\)

The \(t\) test statistic found in **Step 2** is used to determine the p-value.

If \(p \leq \alpha\) reject the null hypothesis. If \(p>\alpha\) fail to reject the null hypothesis.

Based on your decision in **Step 4**, write a conclusion in terms of the original research question.

# 9.2.2.1 - Minitab Express: Independent Means t Test

9.2.2.1 - Minitab Express: Independent Means t TestHere we will use Minitab Express to conduct an independent means t test. Note that Minitab Express uses a more complicated formula for computing the degrees of freedom for this test. To read more about the formulas that Minitab Express uses, see Minitab Express Support.

Within Minitab Express, the procedure for obtaining the test statistic and confidence interval for independent means is identical.

## MinitabExpress – Conducting an Independent Means t Test

Let's compare the mean SAT-Math scores of students who have and have not ever cheated. Both sample sizes are at least 30 so the sampling distribution can be approximated using the \(t\) distribution.

- Open the Minitab Express file:
- On a
**PC**: In the menu bar select**STATISTICS > Two Samples > t** - On a
**Mac**:**Statistics > 2-Sample Inference > t** - Double click the variable
*SATM*in the box on the left to insert the variable into the*Samples*box - Double click the variable
*Ever Cheat*in the box on the left to insert the variable into the*Sample IDs*box - Click OK

This should result in the following output:

\(\mu_1\): mean of SATM when Ever Cheat = No |

\(\mu_2\): mean of SATM when Ever Cheat = Yes |

Difference: \(\mu_1-\mu_2\) |

*Equal variances are not assumed for this analysis.*

Ever Cheat | N | Mean | StDev | SE Mean |
---|---|---|---|---|

No | 163 | 603.988 | 86.893 | 6.806 |

Yes | 53 | 583.68 | 79.18 | 10.88 |

Difference | 95% CI for Difference |
---|---|

20.31 | (-5.16, 45.78) |

Null hypothesis | \(H_0\): \(\mu_1-\mu_2=0\) |
---|---|

Alternative hypothesis | \(H_1\): \(\mu_1-\mu_2\neq0\) |

T-Value | DF | P-Value |
---|---|---|

1.58 | 95 | 0.1168 |

Select your operating system below to see a step-by-step guide for this example.

The result of our two independent means t test is \(t(95) = 1.58, p = 0.1168\). Our p-value is greater than the standard alpha level of 0.05 so we fail to reject the null hypothesis. There is not evidence to state that the mean SAT-Math scores of students who have and have not ever cheated are different.

Note that we could also interpret the confidence interval in this output. We are 95% confident that the mean difference in the population is between -5.16 and 45.78.

The example above uses a dataset. The following examples show how you can conduct this type of test using summarized data.

# 9.2.2.1.1 - Video Example: Weight by Treatment, Summarized Data

9.2.2.1.1 - Video Example: Weight by Treatment, Summarized Data**Research question:** Do patients who receive our treatment weigh less than participants who do not receive our treatment?

Participants were randomly assigned to the treatment condition or a control group. After our intervention, their weights were measured in pounds. Weight is a quantitative variable, so we are going to be comparing means in this example. If assumptions are met, we’ll be conducting a two independent means t test.

Our treatment group has a sample size of 45, mean of 140 pounds, and standard deviation of 20 pounds. Our control group has a sample size of 40, sample mean of 150 pounds, and standard deviation of 25 pounds.

The video below walks through the five-step hypothesis testing procedure to analyze these data in Minitab Express.

# 9.2.2.1.3 - Example: Height by Sex

9.2.2.1.3 - Example: Height by SexThis example uses the following dataset:

**Research Question**: In the population of all college students, is the mean height of females less than the mean height of males?

Data concerning height (in inches) were collected from 99 females and 126 males.

We have two independent groups: females and males. Height in inches is a quantitative variable. This means that we will be comparing the means of two independent groups.

There are 126 females and 99 males in our sample. The sampling distribution will be approximately normally distributed because both sample sizes are at least 30.

This is a left-tailed test because we want to know if the mean for females is less than the mean for males.

(Note: Minitab Express will arrange the levels of the explanatory variable in alphabetical order. This is why "females" are listed before "males" in this example.)

\(H_{0}:\mu_f = \mu_m \)

\(H_{a}: \mu_f < \mu_m \)

- Open the Minitab Express file:
- On a
**PC**: In the menu bar select**STATISTICS > Two Samples > t**

On a**Mac**:**Statistics > 2-Sample Inference > t** - Double click the variable
*Height*in the box on the left to insert the variable into the*Samples*box - Double click the variable
*Gender**Sample IDs*box - Click OK

This should result in the following output:

\(\mu_1\): mean of Height when Gender = Female |

\(\mu_2\): mean of Height when Gender = Male |

Difference: \(\mu_1-\mu_2\) |

*Equal variances are not assumed for this analysis.*

Gender | N | Mean | StDev | SE Mean |
---|---|---|---|---|

Female | 126 | 65.6190 | 6.5322 | 0.5819 |

Male | 99 | 70.2424 | 3.6340 | 0.3652 |

Difference | 95% Upper Bound for Difference |
---|---|

-4.6234 | -3.4881 |

Null hypothesis |
\(H_0\): \(\mu_1-\mu_2=0\) |
---|---|

Alternative hypothesis | \(H_1\): \(\mu_1-\mu_2<0\) |

T-Value | DF | P-Value |
---|---|---|

-6.73 | 202 | <0.0001 |

The test statistic is t = -6.73

From the output given in Step 2, the p value is <0.0001

\(p\leq.05\), therefore we reject the null hypothesis.

There is evidence that the mean height of female students is less than the mean height of male students in the population.