Analysis of Variance (ANOVA) is a hypothesis testing procedure that tests whether two means are significantly different from each other. One-way ANOVA tests the relationship between a numeric variable and a categorical variable.
This article describes how to create a one-way ANOVA table as shown below. The table below shows the pairwise comparison of Total Spend grouped by Household description.
Requirements
- Familiarity with the Structure and Value Attributes of Variable Sets.
- A numeric variable to be used as an outcome (also known as dependent) variable.
- A categorical variable to be used as a predictor.
Method
- In the Anything () menu select Advanced Analysis > Analysis of Variance > One-Way ANOVA.
- In the object inspector go to the Data tab.
- In the Outcome dropdown select a numeric variable.
- Select the categorical predictor variable from the Predictor dropdown.
- In the Compare menu select the contrasts to be performed.
- To mean - The post hoc testing compares the mean of each category to the overall average (i.e., the grand mean).
- To first - The post hoc testing compares the mean of each category to the mean of the first category.
- Pairwise - The post hoc testing compares the mean of each pair of categories.
- OPTIONAL: Select a multiple comparisons Correction to apply when calculating p-values. This correction is applied within each variable (i.e., there is no adjustment for multiple comparisons across variables within this function). Such adjustments are possible in Statistical Assumptions for ordinary tables. The Correction calculations take into account the settings in Compare. For example, when Tukey Range is selected in conjunction with Pairwise, Tukey's HSD is performed, whereas when set with To First, Dunnett's test is performed (both tests are based on the same statistical notion of ranges in t-statistics, with the difference between the two being which comparisons are performed). Tukey Range correction is used by default.
- OPTIONAL: To compute standard errors that are robust to violations of the assumption of constant variance (i.e., heteroscedasticity) select Robust standard errors. See Robust Standard Errors for more information.
- OPTIONAL: Set the Alternative hypothesis to be used in computing the p-values in the post hoc tests. You can choose between Two sided (default), Greater or Less.
- OPTIONAL: If the output returns an error due to missing data, go to the Missing Data menu and select Exclude Cases with Missing Data. See Missing Data Options for more information.
- OPTIONAL: Select Variable names to display variable names in the output instead of labels.
Technical details
When Tukey Range is selected, p-values are computed using t-tests, with a correction for the family-wise error rate such that the p-values are correct for the largest range of values being compared (i.e., the biggest difference between the smallest and largest means). This is a single-step test.
The method of calculation for all the post hoc corrections is valid for balanced, unbalanced samples (Bretz et al. 2011), weighted samples and consequently the results may differ from those in other programs (which typically are only valid for balanced samples).