T-tests for 2 Independent Means - University of Washington
[Pages:25]T-tests for 2 Independent Means
February 17, 2021 Contents
t-test for 2 independent means Tutorial Example 1: one-tailed test for independent means, equal sample sizes Error Bars Example 2: two-tailed test for independent means, unequal sample sizes Effect size Power Using R to run a t-test for independent means Questions Answers
t-test for 2 independent means Tutorial
This t-test compares two means that are drawn independently. More specificically, the null hypothesis is that the two means are drawn from populations with the same mean (or means that differ by some fixed amount). Here's how to get to the independent means t-test in the flow chart:
1
START HERE
Test for = 0
Ch 17.2
1
number of correlation (r) measurement frequency
number of
1
correlations
scale
variables
2
Test for 1= 2
Ch 17.4
Means
2
2 test independence
Ch 19.9
2 test frequency Ch 19.5
z-test Ch 13.1
Yes
Do you
1
know ?
No
one sample t-test
Ch 13.14
number of
More than 2
number of
2
means
factors
1
1-factor
2
ANOVA
Ch 20
2-factor ANOVA Ch 21
independent measures
Yes
t-test
Ch 15.6
independent samples?
No
dependent measures t-test
Ch 16.4
The test estimates the probability of obtaining the observed means (or more extreme) if the null hypothesis is true. If this probability is small (less than alpha), then we reject the null hypothesis in support of the alternative hypothesis that the population means for the two samples are not the same (or differ by more than the fixed difference). Both the null and alternative hypotheses assume that the two population standard deviations are the same.
To conduct the test, we convert the two means and standard deviations into a test statistic which is drawn from a t-distribution under the null hypothesis:
t
=
x?-y?-(?x -?y )hyp sx?-y?
The term in the numerator, (?x - ?y)hyp, is the expected difference between means under the null hypothesis. Usually this number is zero, which is when we are simply testing if
the two means are significantly different from each other. So the simple case when we are
comparing means to each other the calculation for t simplifies to:
t
=
x?-y? sx?-y?
The denominator sx?-y? is called the pooled standard error of the mean. It is calculated by first calculating the pooled standard deviation:
sp =
(nx -1)s2x +(ny -1)s2y (nx -1)+(ny -1)
2
If you look at the formula for the pooled standard deviation, sp, you should see that it's sort of a complicated average of the two standard deviations. Technically, the calculation
inside the square root is really an average of the sample variances, weighted by their degrees
of freedom. Importantly, sp should always fall somewhere between the two sample standard deviations.
The pooled standard error is calculated from sp by:
sx?-y? = sp
1 nx
+
1 ny
This is sort of like how we calculated the standard error for the single sample t-test by diving the standard deviation by n.
You can go from standard deviations and sample sizes to the pooled standard error of the mean in one step if you prefer:
sx?-y? =
(nx -1)s2x +(ny -1)s2y (nx -1)+(ny -1)
(
1 nx
+
1 ny
)
Note: if the two sample sizes are the same (sx = sy = n), then the pooled standard error of the mean simplifies to:
sx?-y? =
s2x+s2y n
The degrees of freedom of the independent means t-test is the sum of the degrees of freedom for each mean:
df = (nx - 1) + (ny - 1) = nx + ny - 2
Example 1: one-tailed test for independent means, equal sample sizes
Suppose you're a 315 Stats professor who is intersted in the impact on remote education on learning. You do this by comparing Exam 2 scores from course taught in 2020 before the pandemic to the Exam 2 scores in the course taught in 2021 during the pandemic.
In 2020, the 81 Exam 2 scores had a mean of 81.72 and a standard deviation of 28.2834. The 81 Exam 2 scores in 2021 had a mean of 71.68 and a standard deviation of 33.3654. Let's run a hypothesis test to determine of the mean Exam 2 scores from 2020 is significantly greater than from 2021. Use = 0.05.
First we calculate the pooled standard error of the mean. Since the sample sizes are the same (nx = ny = 81):
sx?-y? =
s2x+s2y n
=
28.28342+33.36542 81
=
4.86
3
Our t-statistic is therefore:
t
=
x?-y? sx?-y?
=
81.72-71.68 4.86
=
2.07
This is a one-tailed t-test with df = 81 + 81 - 2 = 160 and = 0.05. We can find our critical value of t from the t-table:
df, one tail ... 158 159 160 161 162
0.25 ... 0.676 0.676 0.676 0.676 0.676
0.1 ... 1.287 1.287 1.287 1.287 1.287
0.05 ... 1.655 1.654 1.654 1.654 1.654
0.025 ... 1.975 1.975 1.975 1.975 1.975
0.01 ... 2.350 2.350 2.350 2.350 2.350
0.005 ... 2.607 2.607 2.607 2.607 2.607
0.0005 ... 3.353 3.353 3.352 3.352 3.352
Our critical value of t is 1.654. Here's where our observed value of t (2.07) sits on the t-distribution compared to the critical value (1.654):
2.07
area =0.05
-2
-1
0
1
2
t (df=160) 1.65
Our observed value of t is 2.07 which is greater than the critical value of 1.654. We therefore
reject H0 and conclude that the mean Exam 2 scores from 2020 is significantly greater than from 2021.
We can use the t-calculator to calculate that the p-value is 0.02:
Convert t to
t
df
(one tail)
(two tail)
2.07
160
0.02
0.0401
Convert to t
df
t (one tail)
t (two tail)
0.05
160
1.6544
1.9749
4
To state our conclusions using APA format, we'd state:
The Exam 2 scores of 2020 Psych 315 students (M = 81.72, SD = 28.2834) is significantly greater than the Exam 2 scores of 2021 Psych 315 students (M = 71.68, SD = 33.3654) t(160) = 2.07, p = 0.02.
Error Bars
For tests of independent means it's useful to plot our means as bars on a bar graph with error bars representing the standard errors of the mean. We calculate each standard error for each mean the usual way by dividing the standard deviation by the square root of each sample size:
For 2020,
sx?
=
sx n
=
28.2834 81
=
3.14
and for 2021,
sx?
=
sx n
=
33.3654 81
=
3.71
The error bars are drawn by moving up and down one standard error of the mean (sx?) for each mean (x?):
86 84 82 80 78 76 74 72 70 68
2020
Psych 315 students
2021
Exam 2 scores
5
Bar graphs with error bars are useful for visualizing the significance of the difference between means.
Remember this rule of thumb: If the error bars overlap, then a one-tailed t-test will probably fail to reject H0 with alpha = .05.
Keep in mind that you need a bigger gap between the error bars to reach significance for a two-tailed test, and/or for smaller values of alpha, like .01.
Example 2: two-tailed test for independent means, unequal sample sizes
Suppose you want to test the hypothesis that women with tall mothers are taller than women with less tall mothers. We'll use our class for our sample and divide the students into women with mothers that are taller and shorter than the median of of 64 inches (5 feet 4 inches). For our class, the heights of the 55 women with tall mothers has a mean of 65.9 inches and a standard deviation of 2.6 inches. The heights of the 63 women with less tall mothers has a mean of 63.6 inches and a standard deviation of 2.55 inches. Are these heights significantly different? Use alpha = 0.01.
Since our sample sizes are different, we have to use the more complicated formula for the pooled standard error of the mean:
sp =
(55-1)2.62+(63-1)2.552 (55-1)+(63-1)
=
2.57
sx?-y? = 2.57
1 55
+
1 63
=
0.47
Our t-statistic is
t
=
x?-y? sx?-y?
=
65.9-63.6 0.47
=
4.89
And use the t-table to see if this is statistically significant for df = 55 + 63 - 2 = 116:
df, one tail ... 114 115 116 117 118
0.25 ... 0.677 0.677 0.677 0.677 0.677
0.1 ... 1.289 1.289 1.289 1.289 1.289
0.05 ... 1.658 1.658 1.658 1.658 1.658
0.025 ... 1.981 1.981 1.981 1.980 1.980
0.01 ... 2.360 2.359 2.359 2.359 2.358
0.005 ... 2.620 2.619 2.619 2.619 2.618
0.0005 ... 3.378 3.377 3.376 3.376 3.375
For a two-tailed test, we find the critical value of t in the table by looking under the column
for alpha/2 = 0.005. This is because the total area under both tails to add up to , so the
area
in
each
of
the
two
tails
is
2
.
Our
critical
value
is
?
2.619:
6
area =0.005
area =0.005
-2.62 -2
-1
0
1
t (df=116)
2 2.62
Our observed value of t is 4.89 which is greater than the critical value of 2.619. We therefore
reject H0 and conclude that the mean height of the women with tall mothers is statistically different from the height of the women with less tall mothers .
We can get a p-value from our calculator on the Excel spreadsheet. This gives us p < 0.0001:
Convert t to
t
df
(one tail)
4.89
116
0
Convert to t
df
t (one tail)
0.01
116
2.3589
To conclude using APA format we'd state:
(two tail) 0
t (two tail) 2.6189
The height of women with tall mothers (M = 65.9, SD = 2.6) is significantly different than the height of women with less tall mothers (M = 63.6, SD = 2.55) t(116) = 4.89, p = < 0.0001.
To show these means with error bars, for women with tall mothers,
sx?
=
sx n
=
2.6 55
=
0.35
and for women with less tall mothers,
sx?
=
sx n
=
2.55 63
=
0.32
The error bars are drawn by moving up and down one standard error of the mean (sx?) for each mean (x?):
7
66
65.5
65
height
64.5
64
63.5
women with tall mothers
women with less tall mothers
Effect size
The effect size for an independent measures t-test is Cohen's d again. This time it's measured as:
d
=
|x?-y?-(?x -?y )hyp | sp
Or more commonly when (?x - ?y)hyp = 0:
d
=
|x?-y?| sp
where, again, the denominator is the pooled standard deviation:
sp =
(nx -1)s2x +(ny -1)s2y (nx -1)+(ny -1)
Recall that equal sample sizes the formula for sp simplifies to:
sp = s2x + s2y
For the first example,
sp = 28.28342 + 33.36542 = 30.929
so
d
=
|81.72-71.68| 30.929
=
0.32
8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- tests one sample two independent sample and or related samples
- hypothesis testing based on two samples missouri state
- two samples hypothesis testing pennsylvania state university
- section 8 statistical techniques national institute of standards and
- two sample tests and confidence intervals american university
- stat 511 lecture 18 inferences based on two samples devore section
- how to determine the degrees of freedom in one way and two way anova
- t tests for 2 independent means university of washington
- more on the equal variance two sample t test i robustness
- ap statistics college board
Related searches
- university of washington hr jobs
- university of washington jobs listing
- university of washington human resources
- university of washington human resources dept
- university of washington baseball roster
- university of washington product management
- university of washington online mba
- university of washington printable map
- university of washington opioid taper
- university of washington opioid calculator
- university of washington program management
- university of washington graduate programs