2-way random effects ANOVA exceeded maximum variable size
조회 수: 2 (최근 30일)
이전 댓글 표시
I am trying to run a 2-way random effects ANOVA on a set of data in MATLAB. This is the code I am using:
[pval table stats terms] = anovan(modelfit, {RATEES RATERS},...
'model', 'interaction', 'random', 2, 'varnames', {'RATEE' 'RATER'})
However, doing this gives me the error:
??? Maximum variable size allowed by the program is exceeded.
Error in ==> termcross at 13
ab = a(:,acols) .* b(:,bcols);
Error in ==> anovan>maketerm at 1470
tdum = termcross(termdum{k}, tdum);
Error in ==> anovan>makedummyterms at 1122
[tdum,vars,tn,df0,tconstr] = maketerm(tm,isnested,varinfo,j,sindex,...
Error in ==> anovan at 199
terminfo = makedummyterms(sindex, termlist, varinfo, ...
If I modify my code to any one of the following, it will work without error, but it isn't giving me the data I need:
[pval table stats terms] = anovan(modelfit, {RATEES RATERS},...
'random', 2, 'varnames', {'RATEE' 'RATER'})
or:
[pval table stats terms] = anovan(modelfit, {RATEES RATERS})
It just doesn't work when I try to use the 'interaction' model. Why? Do I really just have too much data? The size of each of my input variable (modelfit, RATEES, RATERS) are all 14879 x 1. That is, 1 column arrays with 14879 values. I know this is a large array, but it seems to me MATLAB should be able to handle this?
If this is really too much, how do I go about getting the interaction effects I need?
In case it is relevant, I am using a 64-bit Mac OS X 10.6.8 (Snow Leopard) and MATLAB R2008a.
I also don't understand how to use the 'random' element of the anovan command. I have to put in an index, but it only lets me choose a single variable to be a random effect? I want both RATEES and RATERS to be random, but it only lets me choose one!
댓글 수: 3
Ahmed A. Selman
2013년 4월 18일
Is it possible to clear some of your variables before entering the function? In 2006 or so I've faced such a (sad) case and thought to store the variables to some point in a file, clear unneeded (specially the large sized) variables, run the function causing the out of memory error, and store data in the same file, clear things up again and read needed variables to plot only. Even if it works, it's a very long story.. I know :)
답변 (1개)
Tom Lane
2013년 4월 18일
It wasn't clear from the original post that the 14879 values were all different.
I don't really need to see the actual data, only understand the general idea. It seems to me, maybe naively, that you have N=14879 rows, and you want to estimate an overall mean, main effects for N levels of raters, main effects for N levels of ratees, and interaction effects for N^2 combinations of them. That will require a design matrix of size N-by-(1+N+N+N^2), roughly.
Even if N were small, this would seem not doable. But maybe I don't yet understand well enough.
I understand you may be interested in only the variance components for these effects, not actually effect/coefficient values, but it still seems not doable.
댓글 수: 6
Tom Lane
2013년 4월 23일
That example has 18 rows, but only 3 factories, 2 car models, and 6 combinations (interactions). There are enough rows to estimate all of these effects.
You say you have 14879 rows, 14879 unique ratees, 14879 unique raters, and 14879^2 potential combinations (though only 14879 of these could actually appear in the data).
참고 항목
카테고리
Help Center 및 File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!