ANOVAN: Undefined function or variable "denommat"

조회 수: 4 (최근 30일)
Sanjay Manohar
Sanjay Manohar 2013년 1월 25일
Hi, I'm getting this error in ANOVAN: Undefined function or variable "denommat". I have 3 factors, one is a random effect (which individual), the others are predictors.
Y = randn(100,1);
subject = repmat([1:10]', 10,1);
traits = randn(100,2);
[p,T,stats] = anovan(Y, [subject, traits], ...
'varnames', {'Subject','Trait1', 'Trait2'} , ...
'random', 1, ...
'continuous', [2 3], ...
'model', [0 1 0; 0 0 1; 0 1 1] ...
);
  • I'm looking for the effects of the predictors and their interaction.
  • But it's a mixed effects design, in that, I have repeated measures of the traits for each subject. I've therefore specified 'Subject' as a random effect. What I intend here is to account for the fact that repeated trait measures on an individual may correlated.
  • I think the problem is that the "subject" factor is not used in the design matrix: I've used a column of zeros to specify that the subject is not a categorical regressor (if it were, it would eat up all the between-subject variability, right?)

채택된 답변

Tom Lane
Tom Lane 2013년 1월 25일
I agree this looks like a bug where if you specify a variable as random but it doesn't actually appear in any terms, the code gets confused. The work-around in your case is not to specify the 'random' argument when no terms use it. I'll report this as a bug to be fixed.
But I don't understand the statement about how including subject in the model would eat up all the between-subject variability. The example doesn't show any between-subject factors. The following code introduces a between-subject factor and specifies that subject is nested in it. Perhaps you want something like this.
Y = randn(100,1);
subject = repmat([1:10]', 10,1);
traits = randn(100,2);
between = repmat([1 1 1 1 1 2 2 2 2 2]',10,1);
[p,T,stats] = anovan(Y, [subject, traits, between], ...
'varnames', {'Subject','Trait1', 'Trait2' 'Between'} , ...
'random', 1, ...
'continuous', [2 3], ...
'nested', [0 0 0 1;0 0 0 0;0 0 0 0;0 0 0 0], ...
'model', [0 0 0 1;1 0 0 0; 0 1 0 0; 0 0 1 0; 0 1 1 0] ...
);

추가 답변 (2개)

Sachin Ganjare
Sachin Ganjare 2013년 1월 25일
I think you do not have the file in your matlab path, wherein "denommat" function is defined.

Evgeny Pr
Evgeny Pr 2013년 1월 25일
편집: Evgeny Pr 2013년 1월 25일
I think this is a bug (defect) in function ANOVAN. Variable denommat is not define, but use in nested function MAKESTATS for you input conditions.

카테고리

Help CenterFile 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!

Translated by