10.2 软件开发人员的薪金(程序)
y=[13876;11608;18701;11283;11767;20872;11772;10535;12195;12313;14975;21371;19800;11417;20263;13231;12884;13245;13677;15965;12366;21352;13839;22884;16978;14803;17404;22184;13548;14467;15942;23174;23780;25410;14861;16882;24170;15990;26330;17949;25685;27837;18838;17483;19207;19346];
x1=[1;1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4;5;5;5;6;6;6;6;7;8;8;8;8;10;10;10;10;11;11;12;12;13;13;14;15;16;16;16;17;20];
x2=[1;0;1;0;0;1;0;0;0;0;1;1;1;0;1;0;0;0;0;1;0;1;0;1;1;0;1;1;0;0;0;1;1;1;0;0;1;0;1;0;1;1;0;0;0;0]; x3=[1;0;0;0;0;0;0;1;0;0;1;0;0;1;0;0;0;0;0;1;1;0;0;0;1;0;1;0;1;1;0;0;0;0;1;0;0;1;0;0;0;0;0;1;0;1]; x4=[0;0;0;1;0;1;1;0;0;1;0;1;0;0;0;0;1;1;0;0;0;0;1;1;0;1;0;0;0;0;1;0;1;1;0;1;0;0;1;1;0;1;1;0;1;0];
xb5=[ones(46,1),x1,x2,x3,x4]; [b,bint,r,rint,stats]=regress(y,xb5) %表5
yj=11032+546*x1+6883*x2+(-2994*x3)+148*x4; eb=y-yj;
plot(x1,eb,'r+') %图9
x5=[2;5;6;3;5;4;3;1;5;3;2;4;6;1;6;5;3;3;5;2;1;6;3;4;2;3;2;6;1;1;3;6;4;4;1;3;6;1;4;3;6;4;3;1;3;1]; plot(x5,eb,'r+') %图10
xb7=[ones(46,1),x1,x2,x3,x4,x2.*x3,x2.*x4]; [b,bint,r,rint,stats]=regress(y,xb7) %表7
yj=11204+497*x1+7048*x2-1727*x3-348*x4-3071*x2.*x3+1836*x2.*x4; eb=y-yj;
plot(x1,eb,'r+') %图11
x5=[2;5;6;3;5;4;3;1;5;3;2;4;6;1;6;5;3;3;5;2;1;6;3;4;2;3;2;6;1;1;3;6;4;4;1;3;6;1;4;3;6;4;3;1;3;1]; plot(x5,eb,'r+') %图12
y=[13876;11608;18701;11283;11767;20872;11772;10535;12195;12313;14975;21371;19800;11417;20263;13231;12884;13245;13677;15965;12366;21352;13839;22884;16978;14803;17404;22184;13548;14467;15942;23174;25410;14861;16882;24170;15990;26330;17949;25685;27837;18838;
…… 此处隐藏0字 ……
17483;19207;19346];
x1=[1;1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4;5;5;5;6;6;6;6;7;8;8;8;8;10;10;10;11;11;12;12;13;13;14;15;16;16;16;17;20];
x2=[1;0;1;0;0;1;0;0;0;0;1;1;1;0;1;0;0;0;0;1;0;1;0;1;1;0;1;1;0;0;0;1;1;0;0;1;0;1;0;1;1;0;0;0;0]; x3=[1;0;0;0;0;0;0;1;0;0;1;0;0;1;0;0;0;0;0;1;1;0;0;0;1;0;1;0;1;1;0;0;0;1;0;0;1;0;0;0;0;0;1;0;1]; x4=[0;0;0;1;0;1;1;0;0;1;0;1;0;0;0;0;1;1;0;0;0;0;1;1;0;1;0;0;0;0;1;0;1;0;1;0;0;1;1;0;1;1;0;1;0]; x5=[2;5;6;3;5;4;3;1;5;3;2;4;6;1;6;5;3;3;5;2;1;6;3;4;2;3;2;6;1;1;3;6;4;1;3;6;1;4;3;6;4;3;1;3;1];
xb8=[ones(45,1),x1,x2,x3,x4,x2.*x3,x2.*x4]; [b,bint,r,rint,stats]=regress(y,xb8) %表8
yj=11200+498*x1+7041*x2-1737*x3-356*x4-3056*x2.*x3+1997*x2.*x4; eb=y-yj;
plot(x1,eb,'r+') %图13
plot(x5,eb,'r+') %图14