The two-factor ANOVA is used when there are two influencing factors on the dependent variable. Let us add one more variable to our example – atmosphere at which cultures were incubated. Some plates were incubated at normal atmosphere and some at atmosphere with increased concentration of CO_{2} (at microaerophilic environment). Now we want to know which factors influence the diameters of inhibition zones around the disks with tea tree oil, that is, if diameters differ only between species or also activity of oil is different in normal and microaerophilic atmosphere. Data for example are presented in the table below, where values or variable “Species” and “CO_{2}” are coded. For the variable “Species” value “1” means E. coli, “2” – E. faecalis and “3” – S. aureus; for the variable “CO_{2}” value “1” means normal atmosphere and “2” – atmosphere with increased concentration of CO_{2} (see Example 3).

We can formulate research question: Are there differences in activity of tea tree oil against different bacterial species and in different atmosphere conditions?

At the first step we should perform exploratory data analysis with assessment of distribution of all compared groups. For this purpose we may split file with output of results by grouping variable “Species”. Then during choosing variables for exploratory analysis (“Analyze” – “Descriptive Statistics” – “Explore…”) as factor variable we should choose variable “CO_{2}” (it will be shown in variable list as “1 – Normal, 2 – Increa…”). The results of normality tests show that all groups have normal distribution; therefore, two-factor ANOVA can be used in this case:

Before starting ANOVA do not forget to reset splitting file conditions: in the Split File dialog box select Analyze all cases, do not create groups.

To specify two-factor ANOVA:

1) Click the Analyze menu, point to General Linear Model, and select Univariate… :

The Univariate dialog box opens:

2) Select the dependent variable (“Tea_Tree_Diffusion”); click the transfer arrow button . The selected variable is moved to the Dependent Variable: list box.

3) Select the influencing variables – fixed factors (“Species” and “CO_{2}”, which are named in the list box by labels – “1 – E.coli, 2 – E.faeca…” and “1 – Normal, 2 – Increa…”, respectively); click the transfer arrow button . The selected variables are moved to the Fixed Factor(s): list box.

4) Click the Post Hoc… button. The Univariate: Post Hoc Multiple Comparisons for Observed Means dialog box opens:

5) We have three compared groups in the variable “Species” and two compared groups in the variable “CO2”; therefore, post hoc comparisons are necessary for the variable “Species”. From the Factor(s) list select the variable “Species”; click the transfer arrow button . The selected variable is moved to the Post Hoc Tests for: list box.

6) Select Tukey test in the Equal Variances Assumed section.

7) Click the Continue button. This returns you to the Univariate dialog box.

8) Click the Options… button. The Univariate: Options dialog box opens:

9) From the Factor(s) and Factor Interactions list box select “Species” “CO2” and “Species*CO2”; click the transfer arrow button . The selected variables are moved to the Display Means For: list box.

10) Select the Descriptive Statistics and Homogeneity Tests in the Display section.

11) Click the Continue button. This returns you to the Univariate dialog box.

12) Click the OK button. An Output Viewer window opens with results of two-factor ANOVA.

The Output Viewer window contains six set of tables with results of statistics for two-factor ANOVA:

1) Tables Between-Subjects Factors shows number of observations with different values of independent variables:

2) The Descriptive Statistics table which demonstrates mean, standard deviation and number of observations for each compared groups:

3) The Levene’s Test of Equality of Error Variances table:

The results of Levene’s test for our example indicate that we can accept the null hypothesis about equalities of the error variance of the dependent variable across the groups; therefore, results of ANOVA are totally valid because the assumption of the ANOVA test has been met.

4) The Tests of Between-Subjects Effects table, which is one of the main tables in ANOVA results:

It indicates which factors have effect on values of dependent variable. In our example the variable “Species” has significant effect on values of the variable “Tea_Tree_Diffusion” (p<0.001), but effect of the variable “CO2” is not significant (p = 0.196). However, the presence of significant differences in inhibition zones for different species does not indicate which of these species differ from each other.

5) The Estimated Marginal Means set of tables include three table with means, standard deviations and 95% confidence intervals separately for three species groups, for two CO_{2} groups and jointly for six groups produced by combination of two factors variables (E. coli with normal CO_{2}, E. coli with increased CO_{2}, E. faecalis with normal CO_{2}, E. faecalis with increased CO_{2}, S. aureus for normal CO_{2}, S. aureus with increased CO_{2}):

6) The Post Hoc tests set of tables include two tables – the Multiple Comparisons table and the Homogeneous Subsets table. From the Multiple Comparisons table we can see which group differs from others by looking at significance values; furthermore, group which differs is marked with asterisk (*). In our example there are significant differences between all studied groups (E. coli, E. faecalis and S. aureus). The Homogeneous Subsets table contains values of means for homogeneous groups which in our example correspond initial means of groups because all three groups differ significantly from each other: