急!!高分跪求matlab高手!!解多元线性回归模型!
发布网友
发布时间:2024-10-23 21:11
我来回答
共2个回答
热心网友
时间:2024-11-10 01:10
>> Y1=[46.78 43.42 37.]';
Y2=[36.05 37.43 31.63]';
Y3=[10.73 5.99 6.01]';
X1=[-6.08 -4.77 0.12]';
X2=[71.32 61.85 71.14]';
X3=[25.88 23.39 19.46]';
X4=[0.85 11.18 12.02]';
X5=[19.69 19.66 19.66]';
X6=[-0.71 -2.97 -0.17]';
X=[ones(3,1),X1,X2,X3,X4,X5,X6];
[B1,BINT1,R1,RINT,STATS1] = regress(Y1,X);
B1,BINT1,STATS1
[B2,BINT2,R2,RIN2,STATS2] = regress(Y2,X);
B2,BINT2,STATS2
[B3,BINT3,R3,RIN3,STATS3] = regress(Y3,X);
B3,BINT3,STATS3
Warning: X is rank deficient to within machine precision.
> In regress at 82
B1 =
0
0
0.0598
1.6387
0.1246
0
0
BINT1 =
0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0
STATS1 =
1 NaN NaN NaN
Warning: X is rank deficient to within machine precision.
> In regress at 82
B2 =
0
0
-0.0382
1.4831
0.4561
0
0
BINT2 =
0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0
STATS2 =
1 NaN NaN NaN
Warning: X is rank deficient to within machine precision.
> In regress at 82
B3 =
0
0
0.0979
0.1556
-0.3316
0
0
BINT3 =
0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0
STATS3 =
1 NaN NaN NaN
>> rank(X)
ans =
3
说明X1-X6线性相关
热心网友
时间:2024-11-10 01:11
你这个做不出来的 数据量必须大于自变量的量才能做 而且在相差不大的情况下做出来的效果很差 你这有6个自变量 至少10-20个数据做出来才勉强靠谱 低于6个数据根本回归不了
我不要你分 请虔诚的默念“保佑llb同学多元回归分析拿A”30遍 谢谢