Factorial ANOVA - Balanced design

Fixed effects, Mixed effects, Random effects and Mixed repeated measures

Balanced two Factor ANOVA with Replication - several values per cell. The data should be separated by Enter or , (comma).

ANOVA without Replication - one value per cell.

The tool ignores empty cells or non-numeric cells.

ANOVA without Replication - one value per cell.

The tool ignores empty cells or non-numeric cells.

tresults

**Fixed effect model (A-Fixed, B-Fixed), no repeats**- both factors are fixed.**Mixed effect model (A-Random, B-Fixed), no repeats**- factor A is random, factor B is fixed, each subject is measured only once.**Mixed effect model (A-Fixed, B-Random), no repeats**- factor A is fixed, factor B is random, each subject is measured only once.**Random effect model (A-Random, B-Random), no repeats****Mixed repeated measures (A-Fixed, B-Repeated)**- factor A is fixed, factor B uses the same subject for all the categories.

When the model is

hence you don't know how to divide the shared sum of squares between the two factors.

There are several methods how to deal with the shared sum of squares.

Type I - sequenceial, the first some of squares (SS) you calculate get the shared some of squares, in this case the order is matter!

Type II - conservative, it assumes there is no interaction between the factors, it ignores the shared SS between the factors. Type III - it assumes there is interaction between the factors, it ignores all the shared SS between the factors and between the factors and the intercation.

- Checks if the difference between
**Factor A**averages of two or more categories is significant - Checks if the difference between
**Factor B**averages of two or more categories is significant - Checks if there is an interaction between
**Factor A**and**Factor B**

The F statistic represents the ratio of the variance between the groups and the variance inside the groups. Unlike many other statistic tests, the smaller the F statistic the more likely the averages are equal.

Hypotheses

H_{0}: Interaction(A_{i}B_{j}) = 0 (∀ i = 1 to a, j = 1 to b)

There is no interaction between variable A and variable B, i.e., for all the cells, the effect of variable A on the cells' means is not depend on the effect of variable B, and vice versa.

Factor A: H_{0}: μ_{1} = .. = μ_{a}

There is no difference in the means of variable A categories.Factor B: H_{0}: μ_{1} = .. = μ_{b}

There is no difference in the means of variable B categories.H

There is no interaction between variable A and variable B, i.e., for all the cells, the effect of variable A on the cells' means is not depend on the effect of variable B, and vice versa.

Test statistic

Fixed Model | Mixed Model | Random Model | Mixed Repeated | ||||

F_{A}= | MS_{A} | F_{A}= | MS_{A} | F_{A}= | MS_{A} | F_{A}= | MS_{A} |

MS_{E} | MS_{AB} | MS_{AB} | MS_{SWA} | ||||

F_{B}= | MS_{B} | F_{B}= | MS_{B} | F_{B}= | MS_{B} | F_{B}= | MS_{B} |

MS_{E} | MS_{E} | MS_{AB} | MS_{BSWA} | ||||

F_{AB}= | MS_{AB} | F_{AB}= | MS_{AB} | F_{AB}= | MS_{AB} | F_{AB}= | MS_{AB} |

MS_{E} | MS_{E} | MS_{E} | MS_{BSWA} |

F distribution

- The dependent variable is continuous (ratio or interval)
- Two categorical independent variables
- Independent observations (no repeated measure)
- The residuals distribution is normal
- Homogeneity of variances, a similar variance for each cell

Sample data from all compared groups |

= Ȳ

= Ȳ

Take the square of each difference

Ȳ

Count the square differences of each value in the cell, hence multiply by the sample size of each cell (n

SS

- The categories of the variable contains the entire categories' list
- The effect of this variable is interesting. The difference between the categories is important
- There is no know pattern on the difference between the categories

- The categories' list is only a sample from the entire categories' list
- The effect of this variable is not interesting by itself. The difference between the categories is not important.
- There is no know pattern on the difference between the categories

A sample from the entire groups' population.

There is no pattern about the difference between the schools, and if there will be a pattern, it will be another factor, like school's size.

Each school is not important by itself.

When you change the **interaction field** or the **model**, the following ANOVA table and diagram will be adjusted!

Source | Degrees of Freedom (DF) | Sum of Squares (SS) | Mean Square (MS) | F statistic | p-value |
---|---|---|---|---|---|

Factor A (rows)Between the categories of factor A | DF_{A} = a - 1 | SS_{A} = Σ_{i}^{a}n_{i}(Ȳ_{i}-Ȳ)^{2} | MS_{A} = SS_{A} / DF_{A} | F_{A} = MS_{A} / MS_{E} | P(x > F_{A}) |

Factor B (Columns)Between the categories of factor B | DF_{B} = b - 1 | SS_{B} = Σ_{j}^{b}n_{j}(Ȳ_{j}-Ȳ)^{2} | MS_{B} = SS_{B} / DF_{B} | F_{B} = MS_{B} / MS_{E} | P(x > F_{B}) |

Interaction ABBetween the cells after reducing factor A and factor B effects | DF_{AB} = (a - 1)(b - 1) | SS_{AB}=Σ_{i}^{a}Σ_{j}^{b}n_{i,j}(Ȳ_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ)^{2} | MS_{AB} = SS_{AB} / DF_{AB} | F_{AB} = MS_{AB} / MS_{E} | P(x > F_{AB}) |

ErrorWithin the cells | DF_{E} = n - a*b | SS_{E}=Σ_{i}^{a}Σ_{j}^{b}Σ_{k}^{ni,j}(Y_{i,j,k} - Ȳ_{i,j})^{2} | MS_{E} = SS_{E} / DF_{E} | ||

TotalAll the deviations from the average | DF_{T} = n - 1 | SS_{T}=Σ_{i}^{a}Σ_{j}^{b}Σ_{k}^{ni,j}(Y_{i,j,k} - Ȳ)^{2}SS _{T}=Sample Variance*(n-1)SS _{T}=SS_{A}+SS_{B}+SS_{AB}+SS_{E} | MS_{E} = S^{2} = SS_{T} / (n - 1) |

A effect: Ȳ

B effect: Ȳ

Interaction effect (AB): Y_{i,j} - Ȳ_{i} - Ȳ_{j} + Ȳ.

Error: Y_{i,j,k} - Ȳ_{i,j}.

Total effect: YError: Y

The following R code should produce the same results