ANOVA result No p-value.
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Jeff Miller
2022-11-24
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!