Welch's t-test: Difference between revisions

+Maple
m (typo fix)
(+Maple)
Line 856:
0.010751
</pre>
 
=={{header|Maple}}==
 
<lang maple>WelschTTest:=proc(x::list(numeric),y::list(numeric))
uses Statistics;
local n1:=nops(x),n2:=nops(y),
m1:=Mean(x),m2:=Mean(y),
v1:=Variance(x),v2:=Variance(y),
t,nu,p,X;
t:=(m1-m2)/sqrt(v1/n1+v2/n2);
nu:=(v1/n1+v2/n2)^2/(v1^2/(n1^2*(n1-1))+v2^2/(n2^2*(n2-1)));
p:=2*CDF(StudentTDistribution(nu),-abs(t));
t,nu,p
end proc:
 
x:=[3,4,1,2.1]:
y:=[490.2,340,433.9]:
WelschTTest(x,y);
# -9.55949772193266, 2.00085234885628, 0.0107515611497845</lang>
 
=={{header|Octave}}==
175

edits