ANOVA result No p-value.
2 views (last 30 days)
Show older comments
Kaminosono Shougo
on 24 Nov 2022
Commented: Kaminosono Shougo
on 17 Jan 2023
I was using ANOVA, but when I changed the display of results from "interaction" to "full", the p-value was not displayed.
I would like to know if anyone knows what the problem is.
dataFileName1 = 'AllParameter_Exp2';
dataFileID1 = fopen([dataFileName1,'.txt'],'r');
if (dataFileID1 == -1);
error('data file not exist');
end
formatSpec = '%f';
y = fscanf(dataFileID1,formatSpec)
fclose(dataFileID1);
g1 = [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10];
g2 = [1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3];
g3 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3];
%{
par = num2cell(g1);
sti = cellstr(g2);
sub = cellstr(g3);
%}
p = anovan(y,{g1,g2,g3},'Model','full','Varnames',{'parameter','stimuli','subjects'});
0 Comments
Accepted Answer
Jeff Miller
on 24 Nov 2022
The problem is that the full model has 90 parameters and predicts a separate mean for each of the 3*3*10 conditions. But you only have 90 observations, so there are no left-over degrees of freedom to estimate an error term. No error term => no F's or p's.
Your only options are to (a) fit a simpler model (e.g., with just 'interaction') or (b) get multiple data values within at least some of the 90 cells so that you have more data than cells and thus some d.f.'s to estimate an error term.
More Answers (0)
See Also
Categories
Find more on ANOVA in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!