04a Independent Sample T-Test
04a Independent Sample T-Test
Matthew Rockloff
1
When to use the independent
samples t-test
The independent samples t-test is probably the
single most widely used test in statistics.
It is used to compare differences between
separate groups.
In Psychology, these groups are often composed
by randomly assigning research participants to
conditions.
However, this test can also be used to explore
differences in naturally occurring groups.
For example, we may be interested in differences
of emotional intelligence between males and
females.
2
When to use the independent samples
t-test (cont.)
Any differences between groups can be
explored with the independent t-test, as
long as the tested members of each group
are reasonably representative of the
population. [1]
5
Example 3.1 (cont.)
Why?
The null hypothesis is the opposite of
what we hope to find.
In this case, our research hypothesis is
that there ARE differences between the 2
diets.
Therefore, our null hypothesis is that
there are NO differences between these 2
diets.
6
Example 3.1 (cont.)
Column 3 Column 4
X1 : Pizza X2 : Beer ( 1 1 ) 2 ( 2 2 ) 2
1 3 1 1
2 4 0 0
2 4 0 0
2 4 0 0
3 5 1 1
1 2 2 4
s x2
( ) 2
0.4 0.4
n 7
Example 3.1 (cont.)
s 0.4
2
x
The same calculations are repeated for
the “beer” condition.
10
Formula
1 2
t , df = (n1-1) + (n2-1)
2 2
S x1 S x2
n1 1 n2 1
11
Example 3.1 (cont.)
From the calculations previously, we have
everything that is needed to find the “t.”
24
t 4.47, df = (5-1) + (5-1) = 8
.4 .4
4 4
After calculating the “t” value, we need to know
if it is large enough to reject the null hypothesis.
12
Some theory
The “t” is calculated under the
assumption, called the null hypothesis,
that there are no differences between the
pizza and beer diet.
14
Some theory - Why (cont.)
Sometimes the weight gain might be a bit
higher under the pizza diet, leading to a
positive “t” value.
In other samples of 10 people, weight
gain might be a little higher under the
beer diet, leading to a negative “t” value.
17
Example 3.1 (again) Calculations
In the last step, we need to find the
critical value for a 2-tailed “t” with 8
degrees of freedom.
This is available from tables that are in
the back of any Statistics textbook.
Look in the back for “Critical Values of
the t-distribution,” or something similar.
The value you should find is:
C.V. t(8), 2-tailed = 2.31.
18
Example 3.1 (cont.)
The calculated t-value of 4.47 is larger in
magnitude than the C.V. of 2.31, therefore we
can reject the null hypothesis.
Even for a results section of journal article, this
language is a bit too formal and general. It is
more important to state the research result,
namely:
20
Example 3.1 Using SPSS
First, the variables must be setup in the SPSS
data editor.
We need to include both the independent and
dependent variables.
Although it is not strictly necessary, it is good
practice to give each person a unique code
(e.g., personid):
21
Example 3.1 Using SPSS (cont.)
In the previous example:
– Dependent Variable
= wtgain (or weight gain)
– Independent Variable = diet
Why?
The independent variable (diet) causes
changes in the dependent variable
(weight gain).
22
Example 3.1 Using SPSS (cont.)
Next, we need to provide “codes” that
distinguish between the 2 types of diets.
By clicking in the grey box of the “Label”
field in the row containing the “diet”
variable, we get a pop-up dialog that
allows us to code the diet variable.
Arbitrarily, the pizza diet is coded as diet
“1” and the beer diet is diet “2.”
Any other 2 codes would work, but these
suffice
See next slide. 23
Example 3.1 Using SPSS (coding)
24
Example 3.1 Using SPSS (data view)
Moving to the data
view tab of the SPSS
editor, the data is
entered.
Each participant is
entered on a separate
line; a code is entered
for the diet they were
on (1 = Pizza, 2 =
Beer); and the weight
gain of each is
entered, as follows 25
Example 3.1 Using SPSS (data view)
Moving to the data
view tab of the SPSS
editor, the data is
entered.
Each participant is
entered on a separate
line; a code is entered
for the diet they were
on (1 = Pizza, 2 =
Beer); and the weight
gain of each is
entered, as follows 26
Example 3.1 Using SPSS (data view)
Moving to the data
view tab of the SPSS
editor, the data is
entered.
Each participant is
entered on a separate
line; a code is entered
for the diet they were
on (1 = Pizza, 2 =
Beer); and the weight
gain of each is
entered, as follows 27
Example 3.1 Using SPSS
(command syntax)
30
Example 3.1 Using SPSS (cont.)
SPSS gives the means for each of the
conditions (Pizza Mean = 2 and Beer
Mean = 4).
In addition, SPSS provides a t-value of
-4.47 with 8 degrees of freedom.
These are the same figures that were
computed “by hand” previously.
However, SPSS does not provide a
critical value.
Instead, an exact probability is provided
(p = .002).
31
Example 3.1 Using SPSS (cont.)
As long as this p-value falls below the
standard of “.05,” we can declare a
significant difference between our mean
values.
Since “.002” is below “.05” we can conclude:
Why?
Strictly speaking, the t-test is only valid if we
have approximately equal variances within each
of our two groups.
In our example, this was not a problem because
the 2 variances were exactly equal (Variance
Pizza = 0.04 and Variance Beer = 0.04).
34
Example 3.1 Using SPSS (cont.)
However, if this test is significant,
meaning that the p-value given is less
than “.05,” then we should choose the
bottom line when interpreting our
results.
This bottom line makes slight
adjustments to the t-test to account
for problems when there are not
equal variances in both conditions.
35
Example 3.1 Using SPSS (cont.)
The practical importance of this
distinction is small.
Even if variances are not equal between
conditions, the hand calculations we
have shown will most often lead to the
correct conclusion anyway, and use of
the “top line” is almost always
appropriate.
36
Independent Samples t-Test
(or 2-Sample t-Test)
Advanced Research Methods in Psychology
- Week 2 lecture -
Matthew Rockloff
37