In hypothesis testing involving two samples, the primary focus shifts from a single mean to the difference between two sample means. The initial step involves formulating the null hypothesis, which posits that the two means are equal, expressed as \( H_0: \mu_1 = \mu_2 \). Alternatively, this can be represented as \( H_0: \mu_1 - \mu_2 = 0 \). The alternative hypothesis, \( H_a \), typically suggests that the means are not equal, leading to a two-tailed test.
Before proceeding with calculations, it is essential to verify certain conditions: the samples must be random and independent, the population standard deviations (\( \sigma_1 \) and \( \sigma_2 \)) are assumed unknown and unequal, and the samples should either be normally distributed or sufficiently large. In cases where the sample sizes are small, normality is assumed.
The test statistic for a two-sample t-test is calculated using the formula:
\( t = \frac{(\bar{x}_1 - \bar{x}_2) - (\mu_1 - \mu_2)}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \)
Here, \( \bar{x}_1 \) and \( \bar{x}_2 \) are the sample means, \( s_1 \) and \( s_2 \) are the sample standard deviations, and \( n_1 \) and \( n_2 \) are the sample sizes. For the null hypothesis, the difference in population means (\( \mu_1 - \mu_2 \)) is zero, simplifying the equation to:
\( t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \)
After calculating the t-value, the next step is to determine the p-value, which indicates the probability of observing the test statistic under the null hypothesis. For two samples, the degrees of freedom can be approximated by taking the smaller of the two sample sizes minus one, \( df = \min(n_1, n_2) - 1 \).
In a two-tailed test, the p-value is calculated as:
\( p = 2 \cdot P(T \leq -|t|) \)
Finally, the p-value is compared to the significance level (\( \alpha \)). If the p-value is less than \( \alpha \), the null hypothesis is rejected, indicating sufficient evidence to support the alternative hypothesis. For instance, if \( \alpha = 0.05 \) and the calculated p-value is \( 0.0005 \), the conclusion would be to reject the null hypothesis, suggesting a significant difference in means, such as the resting heart rates between males and females.