ttests

T-tests and One-way ANOVA
To run T-tests or a one-way ANOVA, you are first going to want to create some
averages of the data you want to look at. For example, lets say you ran your ANOVAs
and found a CONDxGROUP effect in your first factor that you want to further elucidate.
In this interaction, we’re not looking at electrode or hemisphere, so we need to collapse
across them and look only at condition. In other words, measurements in the frontal
region, parietal region, etc. will all be averaged together as long as they occur in the first
factor, and for the condition you’re working with.
To create averages that you can work with, make sure your renamed data set is
open in the data viewer. Open a new SYNTAX window and follow the following
scheme:
Compute (your variable name) = (data column 1 + data column 2 +…) / # of columns .
Your variable name is simply what you want to call the average you are making. If you
were working with speech sounds, for example, you might name it ‘b1’ to signify all the
b sound stimuli in factor 1. An oddball average might be ‘freq1’ and so on, just so you
recognize it when you’re working with it later.
For the data in the parentheses, these are all the points that fit into your average. For a
CONDxGROUP interaction in factor 1 for 3x40 speech sounds, you would create ‘b1’
with something like (FLba1+FRba1+CLba1+CRba1+ … )/10. Notice that all electrode
sites (F,C,P,O,T) as well as hemispheres (L,R) are included because they are not part of
the CONDxGROUP interaction you are looking at. Don’t worry about group just yet,
that is an independent variable that will come in later.
To make life easier, use Pete’s handy-dandy label maker and enter only one factor to
generate a list for all your variables. Copy and paste and then go through and get rid of
the ones you don’t want averaged in. Put a + after each one, enclose them in parenthesis,
count how many there are, divide by that number, don’t forget your period, and you’re
done.
The script for the above example would look like:
For different effects, you’ll want different averages created. Some examples using 3x40:
CONDxELExGROUP: Compute bf1 = (FLba1 + FRba1)/2.
Compute bc1 = (CLba1 + CRba1)/2.
Etc. Then all the d’s. Then all the g’s.
CONDxHEMxGROUP: Compute bL1 = (FLba1 + CLba1 + PLba1 + OLba1 + TLba1)/5.
Compute bR1 =(FRba1 + CRba1 + PRba1+ ORba1 + TRba1)/5.
Etc. Then all the d’s. Then all the g’s.
Once you hit execute, whatever variables you have created are going to append
themselves at the end of your open data. Scroll all the way to the right to confirm this has
happened. Go ahead and save your data now.
You are now ready to use the averages you’ve created. For T-tests, go to the
analyze menu, then compare means, and select the test you want. For an independent
samples T-test, the “Test Variables” are the one’s you’ve created, and the group variable
is your group, or sex, or whatever you’ve divided your subjects into and that are part of
your effect. Highlight the variables you’ve created at the bottom the list and click the
arrow for the top box. Click group or sex from the top of the list and put it into the group
box. You then need to define the group (hit the button) and put in the numbers you used
to define group or sex when you inserted them into your renamed file (likely 1 and 2, or
possibly 0 and 1).
Hit OK and your tables will be generated telling you the significant differences (if any)
for each variable you created between your groups (or sexes depending on what you did).
For a paired samples T-test, you’ll probably want to split your data into groups first. To
do this, click on your open data set (your renamed one) and go up to the data menu. Go
down to split file and select compare groups. Move your group variable over using the
arrow and hit ok. SPSS is now set to compare by groups.
Now go up to analyze, compare means and Paired Samples T-Test. Click on the two
variables you want to be compared and then click the arrow. You can do several at a
time, like in the instance of 3x40, where you might want to see if each group is
distinguishing between the speech sounds. In that case, you would select b and d, b and
g, and d and g. Once you have all the pairs you want, simply hit OK and it will do the
dirty work for you.
For the One-way ANOVA with Post Hoc, your data needs to be organized a little
differently. As a preliminary measure, you can run one with the data as it is without
selecting post hoc options. If you have split your file as described in running paired
samples tests above, you should unsplit it now hitting data, split file, ‘analyze all cases,
do not create groups’, and OK. For running the preliminary one-way, your independent
variable is your group and dependent are all the variables you created. This will give you
some of the same info as the independent samples t-test.
If you want to see interactions between all of your variables with post hoc analysis,
choose ‘save as’ on your data set from the file menu and call it something else so you can
work with it. You might call it the effect you’re going to be working with.
At the present moment, your data is organized in columns with group referring to the
division of your subjects. In the post-hoc analysis, group is actually going to be
something different. Each set of data for a variable you created will be a group. For
example, the ‘b1’ scores from all members of your group 1, the b1 scores from all of your
group 2, the d1 scores from group 1, the d1 scores from group 2, etc will become groups
1, 2, 3, 4, etc. You will need to keep track of these groups. Hopefully, this will make
more sense in a minute.
Basically you are going to be creating two columns, one for group (as defined in the new
manner) and one for all of your data. Whereas now your data looks like this:
Group
1
1
1
1
1
2
2
B1
A
A
A
A
A
B
B
D1
C
C
C
C
C
D
D
G1
E
E
E
E
E
F
F
2
B D F
2
B D F
2
B D F
You want to make your data look like this:
Group
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
4
4
4
4
5
5
5
5
5
6
6
6
6
6
Cond
A
A
A
A
A
B
B
B
B
B
C
C
C
C
C
D
D
D
D
D
E
E
E
E
E
F
F
F
F
F
Note, A-F are simply the data in each of the six “sets” shown.
Keep track of what each group is (WRITE IT DOWN).
For those working with many groups this will take time. You will need to write in each
number in the group column, making sure to double check yourself and know when to
stop/start a new number. It may be convenient to enter the group number in the adjacent
square each time you copy and paste your columns. Because each copy and paste should
add two groups to your growing column, remember to enter every other number (3, 5, 7,
etc). Then go back in and fill in the missing ones. If you have a lot of groups (I had one
with 30), it is easier to create lists of numbers in excel to copy and paste, rather than
entering each one individually. Simply number several columns horizontally, highlight
them all and go down as many subjects as you have in each group, and then hit
Command+D to fill it in. Then you can simply copy each list from excel and paste it into
SPSS.
Once you have compiled your data this way, go up to analyze, select compare means, and
select one-way ANOVA. Here, you’ll put your condition variable in the dependent list
box and the group in the factor box.
Hit Post Hoc and select the type of equal variances assumed analysis you want. Tukey is
common, but Dennis may have you choose otherwise.
Hit Continue and OK and your one-way will be generated. You can then look through
and find all the significant interactions in your multiple comparisons table. These may or
may not be interesting to talk about, since this test makes every comparison it can with
your data. Keep in mind that only the strongest of your interactions will survive and
show-up here. Post-hoc analysis is more strict than the other tests you have run thus far.
Now simply repeat the shifting of the data into columns and groups for each interaction
you wish to look at.