Two-way analysis of variance

Short description: Statistical test examining influence of two categorical variables on one continuous variable

In statistics, the two-way analysis of variance (ANOVA) is an extension of the one-way ANOVA that examines the influence of two different categorical independent variables on one continuous dependent variable. The two-way ANOVA not only aims at assessing the main effect of each independent variable but also if there is any interaction between them.

## Contents

* 1 History
* 2 Data set
* 3 Model
* 4 Assumptions
* 5 Parameter estimation
* 6 Hypothesis testing
* 7 Example
* 8 See also
* 9 Notes
* 10 References

## History

In 1925, Ronald Fisher mentions the two-way ANOVA in his celebrated book, Statistical Methods for Research Workers (chapters 7 and 8). In 1934, Frank Yates published procedures for the unbalanced case.[1] Since then, an extensive literature has been produced. The topic was reviewed in 1993 by Yasunori Fujikoshi.[2] In 2005, Andrew Gelman proposed a different approach of ANOVA, viewed as a multilevel model.[3]

## Data set

Let us imagine a data set for which a dependent variable may be influenced by two factors which are potential sources of variation. The first factor has [math]\displaystyle{ I }[/math] levels ([math]\displaystyle{ i \in \\{1,\ldots,I\\} }[/math]) and the second has [math]\displaystyle{ J }[/math] levels ([math]\displaystyle{ j \in \\{1,\ldots,J\\} }[/math]). Each combination [math]\displaystyle{ (i,j) }[/math] defines a treatment, for a total of [math]\displaystyle{ I \times J }[/math] treatments. We represent the number of replicates for treatment [math]\displaystyle{ (i,j) }[/math] by [math]\displaystyle{ n_{ij} }[/math], and let [math]\displaystyle{ k }[/math] be the index of the replicate in this treatment ([math]\displaystyle{ k \in \\{1,\ldots,n_{ij}\\} }[/math]).

From these data, we can build a contingency table, where [math]\displaystyle{ n_{i+} = \sum_{j=1}^J n_{ij} }[/math] and [math]\displaystyle{ n_{+j} = \sum_{i=1}^I n_{ij} }[/math], and the total number of replicates is equal to [math]\displaystyle{ n = \sum_{i,j} n_{ij} = \sum_i n_{i+} = \sum_j n_{+j} }[/math].

The experimental design is balanced if each treatment has the same number of replicates, [math]\displaystyle{ K }[/math]. In such a case, the design is also said to be orthogonal, allowing to fully distinguish the effects of both factors. We hence can write [math]\displaystyle{ \forall i,j \; n_{ij} = K }[/math], and [math]\displaystyle{ \forall i,j \; n_{ij} = \frac{n_{i+} \cdot n_{+j}}{n} }[/math].

## Model

Upon observing variation among all [math]\displaystyle{ n }[/math] data points, for instance via a histogram, "probability may be used to describe such variation".[4] Let us hence denote by [math]\displaystyle{ Y_{ijk} }[/math] the random variable which observed value [math]\displaystyle{ y_{ijk} }[/math] is the [math]\displaystyle{ k }[/math]-th measure for treatment [math]\displaystyle{ (i,j) }[/math]. The two-way ANOVA models all these variables as varying independently and normally around a mean, [math]\displaystyle{ \mu_{ij} }[/math], with a constant variance, [math]\displaystyle{ \sigma^2 }[/math] (homoscedasticity):

[math]\displaystyle{ Y_{ijk} \, | \, \mu_{ij}, \sigma^2 \; \overset{\mathrm{i.i.d.}}{\sim} \; \mathcal{N}(\mu_{ij}, \sigma^2) }[/math].

Specifically, the mean of the response variable is modeled as a linear combination of the explanatory variables:

[math]\displaystyle{ \mu_{ij} = \mu + \alpha_i + \beta_j + \gamma_{ij} }[/math],

where [math]\displaystyle{ \mu }[/math] is the grand mean, [math]\displaystyle{ \alpha_i }[/math] is the additive main effect of level [math]\displaystyle{ i }[/math] from the first factor (i-th row in the contingency table), [math]\displaystyle{ \beta_j }[/math] is the additive main effect of level [math]\displaystyle{ j }[/math] from the second factor (j-th column in the contingency table) and [math]\displaystyle{ \gamma_{ij} }[/math] is the non-additive interaction effect of treatment [math]\displaystyle{ (i,j) }[/math] for samples [math]\displaystyle{ k=1,...,n_{ij} }[/math] from both factors (cell at row i and column j in the contingency table).

Another equivalent way of describing the two-way ANOVA is by mentioning that, besides the variation explained by the factors, there remains some statistical noise. This amount of unexplained variation is handled via the introduction of one random variable per data point, [math]\displaystyle{ \epsilon_{ijk} }[/math], called error. These [math]\displaystyle{ n }[/math] random variables are seen as deviations from the means, and are assumed to be independent and normally distributed:

[math]\displaystyle{ Y_{ijk} = \mu_{ij} + \epsilon_{ijk} \text{ with } \epsilon_{ijk} \overset{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0, \sigma^2) }[/math].

## Assumptions

Following Gelman and Hill, the assumptions of the ANOVA, and more generally the general linear model, are, in decreasing order of importance:[5]

1. the data points are relevant with respect to the scientific question under investigation;
2. the mean of the response variable is influenced additively (if not interaction term) and linearly by the factors;
3. the errors are independent;
4. the errors have the same variance;
5. the errors are normally distributed.

## Parameter estimation

To ensure identifiability of parameters, we can add the following "sum-to-zero" constraints:

[math]\displaystyle{ \sum_i \alpha_i = \sum_j \beta_j = \sum_i \gamma_{ij} =\sum_j \gamma_{ij}= 0 }[/math]

## Hypothesis testing

In the classical approach, testing null hypotheses (that the factors have no effect) is achieved via their significance which requires calculating sums of squares.

Testing if the interaction term is significant can be difficult because of the potentially-large number of degrees of freedom.[6]

## Example

The following hypothetical example gives the yields of 15 plants subject to two different environmental variations, and three different fertilisers.

| Extra CO2 | Extra humidity

|
|

No fertiliser  | 7, 2, 1  | 7, 6
Nitrate  | 11, 6  | 10, 7, 3
Phosphate  | 5, 3, 4  | 11, 4

Five sums of squares are calculated:

Factor  | Calculation  | Sum  | [math]\displaystyle{ \sigma^2 }[/math]

|
|
|

Individual  | [math]\displaystyle{ 7^2+2^2+1^2 + 7^2+6^2 + 11^2+6^2 + 10^2+7^2+3^2 + 5^2+3^2+4^2 + 11^2+4^2 }[/math] | 641  | 15
Fertilizer × Environment  | [math]\displaystyle{ \frac{(7+2+1)^2}{3} + \frac{(7+6)^2}{2} + \frac{(11+6)^2}{2} + \frac{(10+7+3)^2}{3} + \frac{(5+3+4)^2}{3} + \frac{(11+4)^2}{2} }[/math] | 556.1667  | 6
Fertilizer  | [math]\displaystyle{ \frac{(7+2+1+7+6)^2}{5} + \frac{(11+6+10+7+3)^2}{5} + \frac{(5+3+4+11+4)^2}{5} }[/math] | 525.4  | 3
Environment  | [math]\displaystyle{ \frac{(7+2+1+11+6+5+3+4)^2}{8} + \frac{(7+6+10+7+3+11+4)^2}{7} }[/math] | 519.2679  | 2
Composite  | [math]\displaystyle{ \frac{(7+2+1+11+6+5+3+4+7+6+10+7+3+11+4)^2}{15} }[/math] | 504.6  | 1

Finally, the sums of squared deviations required for the analysis of variance can be calculated.

Factor  | Sum  | [math]\displaystyle{ \sigma^2 }[/math] | Total  | Environment  | Fertiliser  | Fertiliser × Environment  | Residual

|
|
|
|
|
|
|

Individual  | 641  | 15  | 1  |  |  |  | 1
Fertiliser × Environment  | 556.1667  | 6  |  |  |  | 1  | −1
Fertiliser  | 525.4  | 3  |  |  | 1  | −1  |
Environment  | 519.2679  | 2  |  | 1  |  | −1  |
Composite  | 504.6  | 1  | −1  | −1  | −1  | 1  |
|  |  |  |  |  |  |
Squared deviations  |  |  | 136.4  | 14.668  | 20.8  | 16.099  | 84.833
Degrees of freedom  |  |  | 14  | 1  | 2  | 2  | 9

## See also

* Analysis of variance
* F test (Includes a one-way ANOVA example)
* Mixed model
* Multivariate analysis of variance (MANOVA)
* One-way ANOVA
* Repeated measures ANOVA
* Tukey's test of additivity

## Notes

1. ↑ Yates, Frank (March 1934). "The analysis of multiple classifications with unequal numbers in the different classes". Journal of the American Statistical Association 29 (185): 51–66. doi:10.1080/01621459.1934.10502686.
2. ↑ Fujikoshi, Yasunori (1993). "Two-way ANOVA models with unbalanced data". Discrete Mathematics 116 (1): 315–334. doi:10.1016/0012-365X(93)90410-U.
3. ↑ Gelman, Andrew (February 2005). "Analysis of variance? why it is more important than ever". The Annals of Statistics 33 (1): 1–53. doi:10.1214/009053604000001048.
4. ↑ Kass, Robert E (1 February 2011). "Statistical inference: The big picture". Statistical Science 26 (1): 1–9. doi:10.1214/10-sts337. PMID 21841892.
5. ↑ Gelman, Andrew; Hill, Jennifer (18 December 2006). Data Analysis Using Regression and Multilevel/Hierarchical Models. Cambridge University Press. pp. 45–46. ISBN 978-0521867061. http://www.cambridge.org/us/academic/subjects/statistics-probability/statistical-theory-and-methods/data-analysis-using-regression-and-multilevelhierarchical-models.
6. ↑ Yi-An Ko (September 2013). "Novel Likelihood Ratio Tests for Screening Gene-Gene and Gene-Environment Interactions with Unbalanced Repeated-Measures Data". Genetic Epidemiology 37 (6): 581–591. doi:10.1002/gepi.21744. PMID 23798480.

## References

* George Casella (18 April 2008). Statistical design. Springer Texts in Statistics. Springer. ISBN 978-0-387-75965-4. https://www.springer.com/statistics/statistical+theory+and+methods/book/978-0-387-75964-7.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Two-way analysis of variance. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Two-way_analysis_of_variance&oldid=3379414"