# Repeated measures 2 way ANOVA

**URL:** https://discourse.julialang.org/t/repeated-measures-2-way-anova/375
**Category:** Statistics
**Created:** [November 17, 2016, 6:17am UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375 "2016-11-17T06:17:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)
#### Post date: [November 17, 2016, 6:17am UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375/1 "2016-11-17T06:17:36Z")

</div>

Hi group,  
I was wondering if anyone has julia code that can do repeated measures 2 way ANOVA? In the past, I’ve used the GLM package to do 2 way ANOVA, but it’s not clear to me how I would approach a repeated measures design using GLM (if that’s even possible). Right now, I’m using the MATLAB fitrm/ranova functiosn through the MATLAB.jl package, but I would like to remove this dependency on MATLAB if possible. Thanks!

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [November 17, 2016, 11:35am UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375/2 "2016-11-17T11:35:48Z")

</div>

Check the MixedModels package. Random effects are generally considered the modern way of dealing with repeated measures.

---

<div class="post-metadata">

### Author: ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)
#### Post date: [November 18, 2016, 4:44am UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375/3 "2016-11-18T04:44:32Z")

</div>

Thanks for the reply, I’ll check out the package. Could I ask a more general question about my problem, though? I have a process that is associated with a categorical variable, and I’m sampling the process at two different time points. I am interested in a few questions;

1. Does the process contain information about the categorical variable?
2. Does the process change significantly across time?
3. Is there an interaction between the information about category and time? In other words does the information about the category change as a function of time?

The last two questions I believe can be answered by repeated measures ANOVA, but that analysis does not give me the main effect of category. The way I’m addressing that now is to run ANOVA using category as the dependent variable.  
If anyone has an idea of how to better answer my questions, I would be grateful. As this is not a question specific to Julia, feel free to ignore it 🙂  
Thanks!

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [November 20, 2016, 10:13pm UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375/4 "2016-11-20T22:13:55Z")

</div>

You could do a regression of Process = Category \* Time with the unit you sample repeatedly as a random effect, I guess. Hard to say without more information.

---

<div class="post-metadata">

### Author: ![Dario\_Sarra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dario_sarra/32/9338_2.png) [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)
#### Post date: [October 11, 2019, 3:02pm UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375/5 "2019-10-11T15:02:23Z")

</div>

Is there an equivalent of GLM.ftest in the MixedModels package?
