Lab Assignment on ANOVA
Background: A factorial ANOVA examines the effects of multiple independent variables on one dependent variable concurrently. For instance, suppose I am interested in the effects of ritalin and tendency toward attentional problems on attention in a classroom setting. There is some evidence that ritalin actually makes kids with no attentional problems form attentional problems. If such is the case, and we had a whole bunch of kids, half of whom have attentional problems, and other half of whom do not – and we randomly distribute ritalin to half of them, we may end up finding that ritalin appears to have no effect on attention (here, the dependent variable). However, if we separate the children into a second independent variable, tendency toward attentional problems, and examine, concurrently (at the same time), the effects of (IV1) ritalin and (IV2) attentional problems on (DV) attention in the classroom, we may find that for kids with attentional problems, high doses of ritalin increases attention while for kids with no attentional problems, the opposite trend is observed: these kids have worse attention with the ritalin.
Thus, a factorial ANOVA allows us to examine ‘interaction effects.’ Interaction effects exist when some independent variable has different effects on some dependent variable as a function of some other independent variable. Additionally, a factorial ANOVA allows us to examine more than just main effects (which are the effects of one IV on a DV, not taking other IVs into account).
Consider the following example (based on the made up data file two-way.sav):
This data file is designed to address whether males and females vary in terms of how much they like movies as a function of whether the movies in question are action versus romance movies. To test this question, the data include information from 10 males and 10 females. Half the males watched an action movie whereas the other half watched a romance movie – and the same is true of the females. Note that the data have this information coded in the variables gender and movie. Each of these variables is an independent variable (each with two levels). The dependent variable in this study is called “like.” It corresponds to how much each participant liked the movie that he or she saw (on a 1-10 scale – 10 meaning “liked more”).
To run a factorial ANOVA on these data, do the following:
1. click Analyze on the toolbar
2. click General Linear Model
3. click Univariate
4. A dialog box will open. For Dependent enter Like
5. For Fixed factor enter Gender (note that gender is a ‘fixed factor’ because you do not manipulate it as the researcher)
6. For random factor enter movie (note that movie is a ‘random factor’ because you do manipulate it as the researcher)
7. Click on “Options”
7a. move overall, gender, movie, and gender*movie to display means box
8. toggle on the “compare main effects” option
9. toggle on “descriptive statistics” and “estimates of effect size” options
10. click continue
11. click on PLOTS
12. move “gender” to “horizontal axis” and “movie” to “separate lines”
13. click “add”
14. click “continue”
15. click paste
16. highlight the paragraph that will now have been added to an SPSS syntax (.sps) file
17. click run
18. click selection
19. You now should have output from this command
Your syntax file will now look about like so:
* Factorial ANOVA designed to see if males and females differ in terms of liking action versus
* romance movies
like BY gender movie
/RANDOM = movie
/METHOD = SSTYPE(3)
/INTERCEPT = INCLUDE
/PLOT = PROFILE( gender*movie )
/EMMEANS = TABLES(gender) COMPARE ADJ(LSD)
/EMMEANS = TABLES(movie) COMPARE ADJ(LSD)
/EMMEANS = TABLES(gender*movie)
/EMMEANS = TABLES(OVERALL)
/PRINT = DESCRIPTIVE ETASQ
/CRITERIA = ALPHA(.05)
/DESIGN = gender movie gender*movie
NEXT, you’ll see that you obtain a significant interaction for this analysis. Once you have a significant interaction, you recompute your independent variables to make it as if you only have one IV with four levels. Once you have things configured that way, you can conduct a one-way ANOVA to see if the different means you have obtained are significantly different from one another. Sound fun? Here’s how to do it:
Recomputing variables so to be able to conduct a one-way ANOVA to examine specific differences between means:
Given that you have two IVs with two levels each, you really have four groups (males who watched action movie, males who watched romance, females who watched action movie, females who watched romance). You can create a new variable called “group” with four values to represent these four groups by doing the following:
1. Create a new variable called “group”
2. When viewing the data file, click on transform and then compute.
3. click on IF
4. toggle “Include if case satisfies condition”
5. in the empty box, type in the following: gender = 1 and movie = 1
6. click continue
7. make sure to type group in space for target variable.
8. in box for numeric expression, type the following: 1.
8A. that’ll make it so that all subjects who are males who saw the action movie will be in group 1.
8B. Click “type&label” and label each group in a meaningful way (e.g., male action for group 1).
9. Repeat that same process creating the three other groups (males who watched the
romance – group 2, females who watched the action movie – group 3, females who watched the romance – group 4).
10. When you’ve created all four groups, click PASTE
11. highlight the paragraph that will now have been added to an SPSS syntax (.sps) file
12. click run
13. click selection
14. You now should have numbers in the column corresponding to group in your .sav file
Something like the following will be added to your syntax file:
* Creating a four-level categorical variable to allow for a one-way ANOVA to follow up the
* significant interaction
* to see if specific means are different from one another
IF (gender = 1 and movie = 1) group = 1 .
VARIABLE LABELS group ‘male action’ .
IF (gender = 1 and movie = 2) group = 2 .
VARIABLE LABELS group ‘male romance’ .
IF (gender = 2 and movie = 1) group = 3 .
VARIABLE LABELS group ‘female action’ .
IF (gender = 2 and movie = 2) group = 4 .
VARIABLE LABELS group ‘female romance’ .
Once you have created your dandy new group variable, you can conduct the one-way ANOVA (to follow up on the significant interaction from your factorial ANOVA) as follows:
1. Click on Analyze on toolbar.
2. Drag to Compare Means
3. Click One Way ANOVA
4. Dependent variable is “like”
5. Factor is group
6. Next, click on POST HOC.
7. Choose Tukey (the most common post-hoc test); hit continue
8. Go to Options
9. Choose descriptive; hit continue.
10. Click paste
11. Go to the .sps file and highlight the relevant commands.
12. Click on run.
The syntax corresponding to this one-way ANOVA will look like so:
* Conducting the one-way ANOVA to assess if means across the four groups differ significantly
* (this analysis includes
* the Tukey post-hoc test)
like BY group
/POSTHOC = TUKEY ALPHA(.05).
The output from this analysis is found following the output from the factorial ANOVA
OUTPUT FROM FACTORIAL ANOVA
OUTPUT FROM FOLLOWUP ONE-WAY ANOVA
Intepreting the results: As is almost always true with SPSS, much of the information produced is not needed for your purposes. Here is how I’d report the findings (note that I only use some of the information from the SPSS output):
This analysis was designed to assess the effects of both gender and movie type on degree of liking for a movie. The analysis comprised a 2(gender: male vs. female) * 2(movie type: horror vs. romance) between-participants design with the dependent variable being how much each participant liked the movie that he or she was randomly assigned to watch.
The ANOVA revealed no significant main effect for gender (F(1, 16) = 0.00, ns) nor movie type (F(1, 16) = .02, ns). However, a significant interaction between these variables was observed (F(1, 16) = 48.02, p < .05). Further, this interaction accounted for a great deal of the variance in liking scores, as indicated by a h2 of .75. Thus, 75% of liking scores were accounted for by this interaction. This interaction is clearly represented in Figure 1.
As can be seen by this figure, males rated the romance movie low and the action movie high whereas females showed the opposite pattern. The pattern of means in Table 1 also speaks to the interaction obtained here.
Descriptive Statistics for Liking of Movie across Gender and Movie Type (Standard Deviations are in Parentheses)
Gender: Male Female Total
Action 7.80 (1.92)a 2.40 (1.67)b 5.10 (3.31)
Romance 1.80 (.84)b 7.00 (2.12)a 4.40 (3.13)
Total 4.80 (3.46) 4.70 (3.02) 4.75 (3.16)
N = 5 for each cell; means with different subscripts are significantly different (based on the Tukey test) at the p < .05 level.
The factorial ANOVA conducted here does not provide information regarding whether specific means are significantly different from one another; it simply indicates that a significant interaction between the two IVs exists. To address whether these four means are significantly different from one another, a one-way ANOVA was computed. To conduct this ANOVA, four groups were created. These groups included males who watched the action movie, males who watched the romance, females who watched the action movie, and females who watched the romance. A one-way ANOVA was then computed to see if the means across those four groups differed. The analysis revealed a significant overall one-way effect (F(3, 16) = 16.29, p < .05). Post-hoc Tukey tests revealed that the males’ action ratings and the females’ romance ratings were both significantly greater than the females’ action ratings and the males’ romance ratings (See Table 1).
Regarding the Figure and the Table, note that I do not use exactly the information that I obtain from SPSS. For the figure, I edited the graph that SPSS provided – such editing is easy to do – you can do it simply by clicking on the graph in the SPSS outpt file and changing words that you would like changed. Importantly, I put in names that match APA format for presenting figures. Pretty much, I just made it meaningful to examine for the layperson. The Table is based on the descriptive statistics that SPSS produced in the output file – but, again, I put this information into a readable format, keeping my audience (and APA format) in mind. Also, note that the subscripts from the table are based on the results of the “post hoc tests” from the SPSS output.
To create such subscripts, you need to determine, from the output, which groups are significanlty different from which other groups (and, conversely, which are statistically the same) – and use some good old-fashioned logic!
So that is how to analyze data for a factorial ANOVA AND how to report such an analysis.
Now you are ready to do it on your own!
Get into groups of approximately three or four students. Come up with a factorial ANOVA all your own! In doing so, pick two independent variables that each have two levels. Further, pick a continuous dependent variable.
The variables you choose should be parallel to the variables in the movie/gender example (above). Make sure the variables represent constructs that you can measure on this campus within an hour (within ethical boundaries!).
Collect data from at least 16 people. It is not urgent that your cell sizes are equal (but it never hurts)!
Enter the data into SPSS, analyze the data (creating a syntax file that is quite similar to the one included in this assignment), and produce an output file. If you have a significant interaction, be sure to create a “group” variable as in the above example and conduct the appropriate followup (post hoc) analyses.
Next, each student in your group must INDEPENDENTLY write a report summarizing the research question, the methods used to address the question, the nature of the data, the analysis, and the results.
What EACH STUDENT needs to hand in:
1. your .sav (data) file (printed up)
2. your .sps (syntax) file (printed up)
3. your .spo (output) file (printed up)
4. Your OWN (independently written) report (in APA format, including a figure demonstrating any interaction (or lack thereof) and a table summarizing the descriptive statistics as in the above example).
5. Have fun!!!