Welch's t-test: Difference between revisions

m
mNo edit summary
Line 197:
 
Using IMSL function '''TDF'''. With Absoft Pro Fortran, compile with <code>af90 %FFLAGS% %LINK_FNL% pvalue.f90</code>.
Alternatively, the program shows the p-value computed using the IMSL '''BETAI''' function.
 
<lang fortran>subroutine ttest_welchwelch_ttest(n1, x1, n2, x2, t, df, p)
use tdf_int
implicit none
Line 215 ⟶ 216:
 
program pvalue
use betai_int
implicit none
double precision :: x(4) = [3d0, 4d0, 1d0, 2.1d0]
double precision :: y(3) = [490.2d0, 340.0d0, 433.9d0]
double precision :: t, df, p
call ttest_welchwelch_ttest(4, x, 3, y, t, df, p)
print *, t, df, p
print *, betai(df / (t**2 + df), 0.5d0 * df, 0.5d0)
end program</lang>
 
'''Output'''
<pre> -9.55949772193266 2.00085234885628 1.075156114978449E-002</pre>
1.075156114978449E-002</pre>
 
=={{header|Go}}==