Analysis of Variance Package
This package provides functions for performing a univariate Analysis of Variance (ANOVA) to examine the differences between groups of means. The function
ANOVA can handle models with any number of fixed factors in a crossed design. It can handle both balanced and unbalanced data with or without missing elements. All results are given as type I sums of squares.
ANOVA also provides a number of post-hoc tests for comparisons.
| ANOVA[data] | perform a one-way analysis of variance |
| ANOVA[data, model, vars] | perform a general ANOVA specified by the given model and vars |
The ANOVA function.
The
data must be of the form

where

,

, and so on are the values of the categorical variables
vars associated with the

response,

.
The
vars argument is a list of symbols representing the categorical variables in the model.
The
model argument is a list of main effects and interactions that together specify the model. The interaction terms are given as the product of variables. For example, the full factorial model for a three-way analysis of variance can be written as

, where

,

,

are the main effects,

,

,

are the two-way interactions, and

is the three-way interaction. Models can also be written using
All to represent all main effects and interactions between the specified categorical variables. The full factorial model for a three-way analysis of variance can therefore also be written as
{
,
,
, All}.
This defines data of one categorical variable.
This performs a one-way ANOVA on the data.
| Out[3]= |  |
This defines data of a categorical variable with two levels and a categorical variable with three levels.
This performs a full factorial two-way ANOVA.
| Out[5]= |  |
Dropping the point

gives an unbalanced two-way ANOVA with an empty cell.
| Out[6]= |  |
Here is a balanced three-way dataset.
Here is a three-way ANOVA with main effects and two-way interactions.
| Out[8]= |  |
Options for ANOVA.
| Bonferroni | mean comparison test based on the Student t distribution with modified based on the number of groups |
| Duncan | liberal range test based on the Studentized range distribution |
| StudentNewmanKeuls | conservative range test based on the Studentized range distribution |
| Tukey | mean comparison test based on the Studentized range distribution |
| Dunnett | comparison test of group means against a control, taken to be the first group |
Available tests for the PostTests option.
Tukey's test finds groups 1 and 4 significantly different from group 3 at the 5% level.
| Out[9]= |  |
Bonferroni and Tukey's tests find groups 3 and 4 significantly different at the 1% level.
| Out[10]= |  |