## Is it possible to perform analysis of variance with random effects or repeated measures using the Statistics Toolbox?

### MathWorks Support Team (view profile)

on 27 Jun 2009
Latest activity Commented on by Luiz Augusto Brusaca

### Luiz Augusto Brusaca (view profile)

on 17 Nov 2019 at 22:55
Accepted Answer by MathWorks Support Team

### MathWorks Support Team (view profile)

ANOVA2 performs 2 factor analysis of variance, but this is with 2 fixed measures. I would like to know if there is any way to perform analysis of variance with random effects, nested effects, or repeated measures.

### Tags

No tags entered yet.

### MathWorks Support Team (view profile)

on 4 Jan 2017

The ANOVA1 and ANOVA2 functions perform fixed-effects analysis of variance (anova). ANOVA1 does one-way anova. ANOVA2 does two-way anova with perfectly balanced data; that is, each combination of the two factors must have the same number of measurements.
The ANOVAN function is more flexible. It can perform one-, two-, or higher-way anova that is not balanced. Also, you can specify factors as random effects. The ANOVAN function will then compute expected mean squares and use them to perform the appropriate F tests. It will also compute estimates of the variances of the random effect terms (sometimes called the components of variance) by equating the calculated mean squares to their expected values, and solving for the variances.
The capability to fit repeated measures models has been introduce in release R2014a.

#### 1 Comment

Luiz Augusto Brusaca

### Luiz Augusto Brusaca (view profile)

on 17 Nov 2019 at 22:55
Sorry to comment with a question, but I wondering if it's possible to estimate the variance between workers and between days (within worker) extracting the variance component of the one-way anovan.