0% found this document useful (0 votes)
40 views10 pages

Two-Way ANOVA Final Notes

Uploaded by

sohabutt1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views10 pages

Two-Way ANOVA Final Notes

Uploaded by

sohabutt1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

19

Two-way between-groups ANOVA

In this chapter, we will explore two-way, between-groups analysis of


variance. Two-way means that there are two independent variables, and
between-groups indicates that different people are in each of the groups. This
technique allows us to look at the individual and joint effect of two
independent variables on one dependent variable. In Chapter 18, we used
one-way between-groups ANOVA to compare the optimism scores for three
age groups (18–29, 30–44, 45+). We found a significant difference between the
groups, with post-hoc tests indicating that the major difference was between
the youngest and oldest groups. Older people reported higher levels of
optimism.
The next question we can ask is: is this the case for both males and
females? One-way ANOVA cannot answer this question—the analysis was
conducted on the sample as a whole, with males and females combined. In
this chapter, I will take the investigation a step further and consider the
impact of gender on this finding. I will therefore have two independent
variables (age group and sex) and one dependent variable (optimism).
The advantage of using a two-way design is that we can test the ‘main
effect’ for each independent variable and also explore the possibility of an
‘interaction effect’. An interaction effect occurs when the effect of one
independent variable on the dependent variable depends on the level of a
second independent variable. For example, in this case we may find that the
influence of age on optimism is different for males and females. For males
optimism may increase with age, while for females it may decrease. If that
were the case, we would say that there is an interaction effect. In order to
describe the impact of age, we must specify which group (males/females) we
are referring to.
If you are not clear on main effects and interaction effects, I suggest you
review this material in any good statistics text (see Gravetter & Wallnau
2012; Harris 1994; Runyon, Coleman & Pittenger 2000; Tabachnick & Fidell
2013). Before proceeding I would also recommend that you read through the
introduction to Part Five of this book, where I discuss a range of topics
relevant to analysis of variance techniques.
DETAILS OF EXAMPLE
To demonstrate the use of this technique, I will be using the survey.sav data
file included on the website accompanying this book (see p. ix). The data
come from a survey that was conducted to explore the factors that affect
respondents’ psychological adjustment, health and wellbeing. This is a real
data file from actual research conducted by a group of my graduate diploma
students. Full details of the study, the questionnaire and scales used are
provided in the Appendix. If you wish to follow along with the steps described
in this chapter, you should start IBM SPSS and open the file labelled
survey.sav. Details of the variables used in this analysis are provided below.

File name: survey.sav

Variables:
• Total optimism (Toptim): total score on the Optimism Scale. Scores can
range from 6 to 30, with high scores indicating higher levels of optimism.
• Age group (Agegp3): this variable is a recoded variable, dividing age into
three equal groups: Group 1: 18–29=1; Group 2: 30–44=2; Group 3: 45+=3 (see
instructions for how to do this in Chapter 8).
• Sex: Males=1, Females=2.

Example of research question: What is the impact of age and gender on


optimism? Does gender moderate the relationship between age and
optimism?

What you need: Three variables:


• two categorical independent variables (e.g. sex: males/females; age group:
young, middle, old)
• one continuous dependent variable (e.g. total optimism).

What it does: Two-way ANOVA allows you to simultaneously test for the
effect of each of your independent variables on the dependent variable and
also identifies any interaction effect. For example, it allows you to test for (a)
sex differences in optimism, (b) differences in optimism for young, middle
and old participants, and (c) the interaction of these two variables—is there
a difference in the effect of age on optimism for males and females?

Assumptions: See the introduction to Part Five for a discussion of the


assumptions underlying ANOVA.

Non-parametric alternative: None.

Procedure for two-way ANOVA


1. From the menu at the top of the screen, click on Analyze, then select General Linear Model,
then Univariate.
2. Click on your dependent, continuous variable (e.g. Total optimism: toptim) and click on the
arrow to move it into the box labelled Dependent Variable.
3. Click on your two independent, categorical variables (agegp3, sex) and move these into the
box labelled Fixed Factors.
4. Click on the Options button.
• Click on Descriptive Statistics, Estimates of effect size and Homogeneity tests.
• Click on Continue.
5. Click on the Post Hoc button.
• From the Factors listed on the left-hand side, choose the independent variable(s) you are
interested in (this variable should have three or more levels or groups: e.g. agegp3).
• Click on the arrow button to move it into the Post Hoc Tests for section.
• Choose the test you wish to use (in this case, Tukey).
• Click on Continue.
6. Click on the Plots button.
• In the Horizontal Axis box, put the independent variable that has the most groups (e.g.
agegp3).
• In the box labelled Separate Lines, put the other independent variable (e.g. sex).
• Click on Add.
• In the section labelled Plots, you should now see your two variables listed (e.g.
agegp3*sex).
7. Click on Continue and then OK (or on Paste to save to Syntax Editor).

The syntax from this procedure is:

UNIANOVA
toptim BY agegp3 sex
/METHOD = SSTYPE(3)
/INTERCEPT = INCLUDE
/POSTHOC = agegp3 ( TUKEY )
/PLOT = PROFILE( agegp3*sex )
/PRINT = DESCRIPTIVE ETASQ HOMOGENEITY
/CRITERIA = ALPHA(.05)
/DESIGN = agegp3 sex agegp3*sex.

The output generated from this procedure is shown as follows:

Descriptive Statistics
Dependent Variable: Total Optimism
AGEGP SEX Mean Std. N
Deviation
MALES 21.38 4.33 60
18-29 FEMALES 21.34 4.72 87
Total 21.36 4.55 147
MALES 22.38 3.55 68
30-44 FEMALES 21.88 4.58 85
Total 22.10 4.15 153
MALES 22.23 4.09 56
45 + FEMALES 23.47 4.70 79
Total 22.96 4.49 135
MALES 22.01 3.98 184
Total FEMALES 22.20 4.73 251
Total 22.12 4.43 435

Levene’s Test of Equality of Error Variancesa


Dependent Variable: Total Optimism
F df 1 df2 Sig.
1.083 5 429 .369
Tests the null hypothesis that the error variance of the dependent variable is equal across
groups.
a. Design: Intercept+AGEGP3+SEX+AGEGP3* SEX

Tests of Between-Subjects Effects


Dependent Variable: total optimism
Source Type III Sum df Mean F Sig. Partial Eta
of Squares Square Squared
Corrected 238.647a 5 47.729 2.475 .032 .028
Model
Intercept 206790.069 1 206790.069 10721.408 .000 .962
agegp3 150.863 2 75.431 3.911 .021 .018
sex 5.717 1 5.717 .296 .586 .001
agegp3 * sex 55.709 2 27.855 1.444 .237 .007
Error 8274.374 429 19.288
Total 221303.000 435
Corrected 8513.021 434
Total
a. R Squared = .028 (Adjusted R Squared = .017)

Multiple Comparisons
Dependent Variable: toptim
Tukey HSD
(I) age 3 (J) age 3 Mean 95% Confidence Interval
groups groups Difference (l- Std. Error Sig.
J) Lower Bound Upper Bound
2 30 - 44 -.74 .507 .308 -1.94 .45
1 18 - 29
3 45+ -1.60* .524 .007 -2.83 -.36
1 18 - 29 .74 .507 .308 -.45 1.94
2 30 - 44
3 45+ -.85 .519 .230 -2.07 .37
1 18 - 29 1.60* .524 .007 .36 2.83
3 45+
2 30 - 44 .85 .519 .230 -.37 2.07
Based on observed means.
The error term is Mean Square(Error) = 19.288.
* The mean difference is significant at the .05 level.
INTERPRETATION OF OUTPUT FROM TWO-WAY ANOVA
Descriptive statistics
These provide the Mean scores, Std deviations and N for each subgroup.
Check that these values are correct. Inspecting the pattern of these values
will also give you an indication of the impact of your independent variables.

Levene’s Test of Equality of Error Variances


This test provides a test of one of the assumptions underlying analysis of
variance. The value you are most interested in is the Sig. level. You want this
to be greater than .05 and therefore not significant. A significant result (Sig.
value less than .05) suggests that the variance of your dependent variable
across the groups is not equal. If you find this to be the case in your study, it
is recommended that you set a more stringent significance level (e.g. .01) for
evaluating the results of your two-way ANOVA. That is, you will consider the
main effects and interaction effects significant only if the Sig. value is greater
than .01. In the example displayed above, the Sig. level is .369. As this is
larger than .05, we can conclude that we have not violated the homogeneity
of variances assumption.
The main output from two-way ANOVA is a table labelled Tests of
Between-Subjects Effects. This gives you a number of pieces of
information, not necessarily in the order in which you need to check them.

Interaction effects
The first thing you need to do is to check for the possibility of an interaction
effect (e.g. that the influence of age on optimism levels depends on whether
you are male or female). If you find a significant interaction effect, you
cannot easily and simply interpret the main effects. This is because, in order
to describe the influence of one of the independent variables, you need to
specify the level of the other independent variable. In the IBM SPSS output,
the line we need to look at is labelled agegp3*sex. To find out whether the
interaction is significant, check the Sig. column for that line. If the value is
less than or equal to .05 (e.g. .03, .01, .001), there is a significant interaction
effect. In our example, the interaction effect is not significant (agegp3*sex:
sig. = .237). This indicates that there is no significant difference in the effect
of age on optimism for males and females.
Warning: when checking significance levels in this output, make sure you
read the correct column (the one labelled Sig.—a lot of students make the
mistake of reading the Partial Eta Squared column, with dangerous
consequences!).

Main effects
We did not have a significant interaction effect; therefore, we can safely
interpret the main effects. These are the simple effect of one independent
variable (e.g. the effect of sex with all age groups collapsed). In the left-hand
column, find the variable you are interested in (e.g. agegp3). To determine
whether there is a main effect for each independent variable, check in the
column marked Sig. next to each variable. If the value is less than or equal
to .05 (e.g. .03, .001), there is a significant main effect for that independent
variable. In the example shown above, there is a significant main effect for
age group (agegp3: Sig. = .021) but no significant main effect for sex (sex: Sig.
= .586). This means that males and females do not differ in terms of their
optimism scores, but there is a difference in scores for young, middle and old
participants.

Effect size
The effect size for the agegp3 variable is provided in the column labelled
Partial Eta Squared (.018). Using Cohen’s (1988) criterion, this can be
classified as small (see introduction to Part Five). So, although this effect
reaches statistical significance, the actual difference in the mean values is
very small. From the Descriptives table we can see that the mean scores for
the three age groups (collapsed for sex) are 21.36, 22.10 and 22.96. The
difference between the groups appears to be of little practical significance.

Post-hoc tests
Although we know that our age groups differ, we do not know where these
differences occur: is gp1 different from gp2, is gp2 different from gp3, is gp1
different from gp3? To investigate these questions, we need to conduct post-
hoc tests (see description of these in the introduction to Part Five). Post-hoc
tests are relevant only if you have more than two levels (groups) to your
independent variable. These tests systematically compare each of your pairs
of groups, and indicate whether there is a significant difference in the means
of each. These post-hoc tests are provided as part of the ANOVA output. You
are, however, not supposed to look at them until you find a significant main
effect or interaction effect in the overall (omnibus) analysis of variance test.
In this example, we obtained a significant main effect for agegp3 in our
ANOVA; therefore, we are entitled to dig further using the post-hoc tests for
agegp.

Multiple comparisons
The results of the post-hoc tests are provided in the table labelled Multiple
Comparisons. We have requested the Tukey Honestly Significant Difference
(HSD) test, as this is one of the more commonly used tests. Look down the
column labelled Sig. for any values less than .05. Significant results are also
indicated by a little asterisk in the column labelled Mean Difference. In the
above example, only group 1 (18–29) and group 3 (45+) differ significantly
from one another.

Plots
You will see at the end of your output a plot of the optimism scores for males
and females, across the three age groups. This plot is very useful for allowing
you to visually inspect the relationship among your variables. This is often
easier than trying to decipher a large table of numbers. Although presented
last, the plots are often useful to inspect first to help you better understand
the impact of your two independent variables.
Warning: when interpreting these plots, remember to consider the scale
used to plot your dependent variable. Sometimes what looks like an
enormous difference on the plot will involve only a few points difference. You
will see this in the current example. In the first plot, there appears to be quite
a large difference in male and female scores for the older age group (45+). If
you read across to the scale, however, the difference is only small (22.2 as
compared with 23.5).

PRESENTING THE RESULTS FROM TWO-WAY ANOVA


The results of the analysis conducted above could be presented as follows:

A two-way between-groups analysis of variance was conducted to explore the impact of sex and
age on levels of optimism, as measured by the Life Orientation Test (LOT). Participants were
divided into three groups according to their age (Group 1: 18–29 years; Group 2: 30–44 years;
Group 3: 45 years and above). The interaction effect between sex and age group was not
statistically significant, F (2, 429) = 1.44, p = .24. There was a statistically significant main
effect for age, F (2, 429) = 3.91, p = .02; however, the effect size was small (partial eta squared
= .02). Post-hoc comparisons using the Tukey HSD test indicated that the mean score for the 18–
29 years age group (M = 21.36, SD = 4.55) was significantly different from the 45 + group (M =
22.96, SD = 4.49). The 30–44 years age group (M = 22.10, SD = 4.15) did not differ
significantly from either of the other groups. The main effect for sex, F (1, 429) = .30, p = .59,
did not reach statistical significance.

For other examples of how to present the results of analysis of variance see
Chapter 9 in Nicol and Pexman (2010b).

ADDITIONAL ANALYSES IF YOU OBTAIN A SIGNIFICANT


INTERACTION EFFECT
If you obtain a significant result for your interaction effect, you may wish to
conduct follow-up tests to explore this relationship further (this applies only
if one of your variables has three or more levels). One way that you can do
APA Table of Two-way ANOVA

Table 1

Means, Standard Deviations and Two-Way ANOVA Statistics for Study Variables

Variable Male Female ANOVA


M SD M SD Effect F ratio df η2
Age
18-29 21.38 4.33 21.34 4.72 A 3.91* 2, 429 .02
30-44 22.38 3.55 21.88 4.58 G .30 1, 429 .00
45 plus 22.23 4.09 23.47 4.70 AxG 1.44 2,429 .01
N = 429. A = Age; G = Gender

*p<.05, **p<.01, ***p<.001


Two-way Independent Measures ANOVA – Hypothesis

Main Effect for Factor A

Null hypothesis

Alternative Hypothesis

Main Effect for Factor B

Null hypothesis

Alternative Hypothesis

Interaction Effects
The hypotheses for interaction effects
Null Hypothesis
H0: There is no interaction between factors A and B.
Alternative Hypothesis
H1: There is an interaction between factors.

You might also like