# Analysis of Variance - One-Way ANOVA

One-Way ANOVA (Analysis Of Variance), is a statistical test that tests the relationship between a numeric variable and a categorical variable. Testing is conducted using an F-test. It determines whether there are statistically significant differences between group means.

## How to Run a One-Way ANOVA

1. In Displayr: Insert > More > Analysis of Variance > One-Way ANOVA
2. In Q: Create > Analysis of Variance > One-Way ANOVA
2. In Inputs > Outcome specify the outcome variable.
3. Specify the predictor variable in Inputs > Predictor

## Example

The table below shows the pairwise comparison of age grouped by relationship. For each pair, the Difference between group means and its Standard Error. t statistic and Corrected p value are given.

## Options

The options in the Object Inspector are organized into two tabs: Inputs and Properties.

### Inputs

Outcome The variable to be predicted.

Predictor A variable containing 2 or more groups. If not categorical, it is converted into categories in the analysis.

Compare Specifies 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.

Correction The multiple comparisons correction applied when computing the p-values of the post-hoc comparisons. 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). The options are:

Tukey Range. This is the default.
False Discovery Rate
Benjamini & Yekutieli
Bonferroni
Free Combinations(Westfall et al. 1999).
Hochberg
Holm
Hommel
Single-step (Bretz et al. 2010)
Shaffer
Westfall

Alternative hypothesis The alternative used in computing the p-values in the post hoc tests.

Two sided This is the default.
Greater
Less

Robust standard errors Computes standard errors that are robust to violations of the assumption of constant variance. See Robust Standard Errors.

Missing data (see Missing Data Options):

Error if missing data
Exclude cases with missing data

Variable names Displays Variable Names in the output.

Binary variables Automatically converts non-ordered categorical variables into binary variables. Note that if this option is not selected, categories values are inferred based on the order of the categories (i.e., the Value Attributes are ignored).

Filter The data is automatically filtered using any filters prior to estimating the model.

Weight Where a weight has been set for the R Output, the calibrated weight is used. See Weights in R.

### Properties

This tab contains options for formatting the size of the object, as well as the underlying R code used to create the visualization, and the JavaScript code use to customize the Object Inspector itself (see Object Inspector for more details about these options). Additional options are available by editing the code.

## 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).