matlab与单样本t检验(4)
发布时间:2021-06-06
发布时间:2021-06-06
60.2000 14.5000 Sx =
31.6000 8.0400 0.5000 8.0400 3.1720 1.3100 0.5000 1.3100 1.900 类似程序
xjunzhi=[82;60.2;14.5];
Sx=[31.6 8.04 0.5;8.04 3.1720 1.3100;0.5 1.31 1.9]; n=6;
y=[80.0 58.4 14.0;75.0 59.2 15;78 60.3 15;75.0 57.4 13.0;79 59.5 14.0;78 58.1 14.5;75 58.0 12.5;64 55.5 11.0;80 59.2 12.5]; [m,p]=size(y); i=1:1:m;
yjunzhi=(1/m)*sum(y(i,:)); z=rand(p,m); for j=1:1:m
z(:,j)= y(j,:)'-yjunzhi'; z=z; end
B=zeros(p,p); for k=1:1:m;
B=B+(z(:,k)*z(:,k)'); end
Sy=((m-1)^(-1))*B; yjunzhi=yjunzhi'
S=(1/(n+m-2))*((n-1)*Sx+(m-1)*Sy) 得到结果yjunzhi = 76.0000 58.4000 13.5000 S =
27.2308 6.5615 2.8462 6.5615 2.4323 1.4000
2.8462 1.4000 1.8462 然后
t=((n*m)/(n+m))*((xjunzhi-yjunzhi)')*(S^(-1))*(xjunzhi-yjunzhi) F=((n+m-p-1)/(p*(n+m-2)))*t 输出结果t = 5.3117 F =
1.4982
查表得F0.05(3,11)=3.59>1.4982 F0.01(3,11)=6.22>1.4982
上一篇:磁记忆检测裂纹类缺陷的理论模型
下一篇:第11讲(拓扑排序、最短路径)