Two-sample t-test for independent samples
Consider the PHYSHLTH column from the Boston and Seattle dataset from the CDC BRFSS
data. Refer to your two-sample tests for independent samples PowerPoint in Canvas.
1. What would the null and alternative hypothesis be when comparing the PHYSHLTH data
from Boston to Seattle?
Null: The means of the PHYSHLTH days are equal between Seattle and Boston
Alternative: The means of the PHYSHLTH days between Seattle and Boston are
different.
2. What are two-sample t-tests used for?
Examining the differences between two samples
3. When can we use a two-sample t-test for independent samples? What are the
assumptions?
When the sample size is under 30 and the population standard deviation is unknown.
Assumptions: Random selection, Interval or Ratio Scale of measurements, and Normality.
4. Explain why a two-sample t-test would be used instead of a two-sample z-test.
We would use a two-sample t-test instead of a tea-sample z-test when population standard
deviation is not known as well as rarely used in practice
5. Using the PHYSHLTH column, determine if the samples have equal or unequal
variances.
Equal variances = 63.37122/ 65.8227 = 0.962756
The ratio of the sample variance falls between 0.5 and 2, which means we can assume equal
variance
6. Calculate the degrees of freedom
n1 - 1 + n2- 1
= 495-1 + 488 - 1
= 981
7. Utilizing the T.TEST function in excel, calculate the p-value.
T.TEST = 0.999014504
8. Utilize the data analysis tookpak to check your work. If we set alpha at 0.05, what can we
conclude about the null hypothesis?
If we set alpha at 0.05 we will fail to reject the null hypothesis.
There is no difference between the physical health of Boston and Seattle residents
9. Refer to your output from the data analysis toolpak and calculate Cohen’s d. (Hint: use
excel as your calculator) What can be concluded about the effect size?
Cohen’s d value: 0.0000914704
There is a small effect size for this result.
10. Using the Boston dataset, compare the MENHLTH between males and females. Create a
null and alternative hypothesis.
Null: The means of the mental health days between males and females are equal
Alternative: The means of mental health days between males and females will be different.
11. Determine if the groups have equal or unequal variances and calculate the p-value. (Hint:
Copy and paste into a separate worksheet and separate mental health scores by males and
females)
Unequal variance : 74.08655/ 31.39505 = 2.359817
t-Test: Two-Sample Assuming
Unequal Variances
M F
Mean 2.0701754
39
4.1630094
04
Variance 31.395046
44
74.086551
92
Observatio
ns 171 319
Hypothesi
zed Mean
Difference
0
df 470
t Stat
-
3.2454137
65
P(T<=t)
one-tail
0.0006282
47
t Critical
one-tail
1.6481021
28
P(T<=t)
two-tail
0.0012564
93
t Critical
two-tail
1.9650241
72
12. What can be concluded about the null hypothesis? What does that mean in terms of the
samples we have looked at?
We will reject the null hypothesis
There is a difference between the means of the number of mental health days reported between
males and females, and this difference is significant.
13. Calculate and interpret Cohen’s d.
Cohen’s d value =0.288
There is a small effect size for this result.