Welch's t-test: Difference between revisions

+Scilab
(+octave)
(+Scilab)
Line 942:
{{out}}
<pre>(0.021378001462867013 0.14884169660532798 0.035972271029796624 0.09077332428567102 0.01075139991904718)</pre>
 
=={{header|Scilab}}==
{{trans|Stata}}
 
Scilab will print a warning because the number of degrees of freedom is not an integer. However, the underlying implementation makes use of the dcdflib Fortran library, which happily accepts a noninteger df.
 
<lang>x = [3.0,4.0,1.0,2.1];
y = [490.2,340.0,433.9];
n1 = length(x);
n2 = length(y);
v1 = variance(x);
v2 = variance(y);
t = (mean(x)-mean(y))/(sqrt(v1/n1+v2/n2));
df = (v1/n1+v2/n2)^2/(v1^2/(n1^2*(n1-1))+v2^2/(n2^2*(n2-1)));
[p, q] = cdft("PQ", t, df);
[t df 2*p]</lang>
 
'''Output'''
 
<pre> ans =
- 9.5594977 2.0008523 0.0107516</pre>
 
=={{header|Sidef}}==
1,336

edits