网站建设中外链与内链的技巧,发布网站制作,网站js代码检测,dede做的网站被植入广告解释变量#xff1a;商品价格#xff08;x1#xff09;人均月收入#xff08;x2#xff09;#xff0c;被解释变量#xff1a;商品需求量#xff08;y#xff09;#xff0c;进行二元回归分析#xff0c;并进行检验 商品价格(元/件) 月收入(元) 需求(件) 89 …解释变量商品价格x1人均月收入x2被解释变量商品需求量y进行二元回归分析并进行检验 商品价格(元/件) 月收入(元) 需求(件) 89 550 5800 78 580 5000 70 600 6200 60 650 6800 65 720 7100 58 750 7800 50 830 8900 45 880 9000 52 850 8500 35 920 9400 38 1100 9900 Matlab代码 clear
clc
data [89 78 70 60 65 58 50 45 52 35 38
550 580 600 650 720 750 830 880 850 920 1100
5800 5000 6200 6800 7100 7800 8900 9000 8500 9400 9900
];
x1 data(:,1);
x2 data(:,2);
y data(:,3);
X [ones(size(x1)) x1.*x1 x1 x2.*x2 x2 x1.*x2];
[b,bint] regress(y,X)
scatter3(x1,x2,y,filled)
hold on
x1fit min(x1):0.5:max(x1);
x2fit min(x2):0.5:max(x2);
[X1FIT,X2FIT] meshgrid(x1fit,x2fit);
YFIT b(1) b(2)*X1FIT.*X1FITb(3)*X1FIT b(4)*X2FIT.*X2FIT b(5)*X2FIT b(6)*X1FIT.*X2FIT;
mesh(X1FIT,X2FIT,YFIT)
xlabel(x1)
ylabel(x2)
zlabel(Y)
view(140,30)
命令窗口 b 1.0e004 *8.48410.0006-0.14860.0000-0.00980.0001bint 1.0e005 *-1.0110 2.7078-0.0001 0.0002-0.0443 0.0145-0.0000 0.0000-0.0036 0.0017-0.0000 0.0000
图形