Kalpana Kalpana (Editor)

Two way analysis of variance

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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

History

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

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 I levels ( i { 1 , , I } ) and the second has J levels ( j { 1 , , J } ). Each combination ( i , j ) defines a treatment, for a total of I × J treatments. We represent the number of replicates for treatment ( i , j ) by n i j , and let k be the index of the replicate in this treatment ( k { 1 , , n i j } ).

From these data, we can build a contingency table, where n i + = j = 1 J n i j and n + j = i = 1 I n i j , and the total number of replicates is equal to n = i , j n i j = i n i + = j n + j .

The experimental design is balanced if each treatment has the same number of replicates, K . 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 i , j n i j = K , and i , j n i j = n i + n + j n .

Model

Upon observing variation among all n data points, for instance via a histogram, "probability may be used to describe such variation". Let us hence denote by Y i j k the random variable which observed value y i j k is the k -th measure for treatment ( i , j ) . The two-way ANOVA models all these variables as varying independently and normally around a mean, μ i j , with a constant variance, σ 2 (homoscedasticity):

Y i j k | μ i j , σ 2 i . i . d . N ( μ i j , σ 2 ) .

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

μ i j = μ + α i + β j + γ i j ,

where μ is the grand mean, α i is the additive main effect of level i from the first factor (i-th row in the contigency table), β j is the additive main effect of level j from the second factor (j-th column in the contigency table) and γ i j is the non-additive interaction effect of treatment ( i , j ) from both factors (cell at row i and column j in the contigency table).

An other, 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, ϵ i j k , called error. These n random variables are seen as deviations from the means, and are assumed to be independent and normally distributed:

Y i j k = μ i j + ϵ i j k  with  ϵ i j k i . i . d . N ( 0 , σ 2 ) .

Assumptions

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

  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:

i α i = j β j = i j γ i j = 0

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.

References

Two-way analysis of variance Wikipedia