Anovan: within-subjects anova with covariate and random factor is rank-deficient
3 views (last 30 days)
Show older comments
I am currently analysing a dataset that has one dependent variable (Y), two within-subject factors with two levels each (A, B with levels a1,a2,b1,b2) and a covariate C.
For arguments sake, let's say that I measure my subjects' happiness (Y) after they each eat Western or Eastern Food ( Factor A) that can each be Spicy or Sweet ( Factor B). As Covariate, I include their age. I read that anovan can run within-subject ANOVA if you take into account the subject's identity as a random variable, which gives the final column Subject. This can be summarised as follows:
if true
| Y | A | B | Cov | Subject |
_______________________________________________
| 1 | 0 | 0 | 20 | 1 |
| 5 | 1 | 0 | 20 | 1 |
| 3 | 1 | 1 | 20 | 1 |
| 8 | 0 | 1 | 20 | 1 |
| 2 | 0 | 0 | 23 | 2 |
| 4 | 1 | 0 | 23 | 2 |
| 4 | 1 | 1 | 23 | 2 |
| 7 | 0 | 1 | 23 | 2 |
_______________________________________________
end
If I understand correctly, I can run a within-subject ANOVA in MATLAB by using anovan and then including the subject's identity as random factor:
if true
anovan(Y,{A B Subject},'random',3)
end
This does indeed return results that seem reasonable. However if I want to include the covariate I run into a problem:
if true
anovan(Y,{A B Subject Cov},'random',3,'continuous',4)
end
The problem is that if I include both the covariate as well as the subject's identity, my ANOVA design is rank deficient. Is there any way in MATLAB to work around this?
0 Comments
Answers (0)
See Also
Categories
Find more on ANOVA in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!