数据调用anovan函数后,输出都是NaN,这是则么回事。
4 views (last 30 days)
Show older comments
Y=[144,39,24.2,0;215,47,31.1,1;138,45,22.6,0;145,47,24.0,1;162,65,25.9,1;142,46,25.1,0;...
170,67,29.5,1;124,42,19.7,0;158,67,27.2,1;154,56,19.3,0;162,64,28.0,1;150,56,25.8,0;...
140,59,27.3,0;110,34,20.1,0;128,42,21.7,0;130,48,22.2,1;135,45,27.4,0;114,18,18.8,0;...
116,20,22.6,0;124,19,21.5,0;136,36,25.0,0;142,50,26.2,1;120,39,23.5,0;120,21,20.3,0;...
160,44,27.1,1;158,53,28.6,1;144,63,28.3,0;130,29,22,1;125,25,25.3,0;175,69,27.4,0];
y=Y(:,1);
a=Y(:,2);
b=Y(:,3);
c=Y(:,4);
varnames={'a','b','c'};
[p,table]=anovan(y,{a,b,c},'model','full','varnames',varnames)
结果
p =
NaN
NaN
NaN
NaN
NaN
NaN
NaN
table =
'Source' 'Sum Sq.' 'd.f.' 'Singular?' 'Mean Sq.' 'F' 'Prob>F'
'a' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'b' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'c' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'a*b' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'a*c' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'b*c' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'a*b*c' [ 0] [ 0] [ 1] [ 0] [NaN] [ NaN]
'Error' [-5.457e-12] [ 0] [ 0] [ 0] [] []
'Total' [ 14037] [ 29] [ 0] [] [] []
0 Comments
Answers (1)
埃博拉酱
on 23 Nov 2024 at 1:12
你可能需要为anovan设置continuous参数,因为你的a和b似乎是连续变量,而anovan默认将所有变量当作分类变量处理。
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!