Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : STMEAN.FOR

 
Output of file : STMEAN.FOR contained in archive : FORTRN77.ZIP
SUBROUTINE STMEAN (I,NX,X,NY,Y,A)
C
C THIS SUBROUTINE COMPUTES THE MEANS, VARIANCES, AND T-RATIO FOR
C TWO GROUPS OF DATA.
C
DIMENSION X(1), Y(1), A(13)
SUMX = 0.0
SUMX2 = 0.0
DO 10 L = 1,NX
SUMX = SUMX + X(L)
10 SUMX2 = SUMX2 + X(L)*X(L)
SUMY = 0.0
SUMY2 = 0.0
DO 20 L = 1,NY
SUMY = SUMY + Y(L)
20 SUMY2 = SUMY2 + Y(L)*Y(L)
IF (I.NE.1) GO TO 40
SUMXY = 0.0
SUMXY2 = 0.0
DO 30 L = 1,NX
SUMXY = SUMXY + X(L) - Y(L)
30 SUMXY2 = SUMXY2 + (X(L) - Y(L))**2
40 XN = NX
YN = NY
XN1 = XN - 1.0
YN1 = YN - 1.0
XNXN1 = XN*XN1
X1PY1 = XN1 + YN1
A(1) = SUMX / XN
A(2) = (XN*SUMX2 - SUMX*SUMX) / XNXN1
A(3) = SQRT(A(2))
A(4) = SUMY / YN
A(5) = (YN*SUMY2 - SUMY * SUMY)/(YN*YN1)
A(6) = SQRT(A(5))
A2DXN = A(2) / XN
A5DYN = A(5) / YN
IF (I.NE.1) GO TO 50
A(7) = SQRT(A2DXN)
A(8) = SQRT(A5DYN)
A(9) = SUMXY / XN
A(10) = (XN * SUMXY2 - SUMXY*SUMXY) / XNXN1
A(11) = SQRT(A(10) / XN)
A(12) = A(9)/A(11)
A(13) = XN1 + XN1
RETURN
50 A(7) = A(1) - A(4)
IF (I.EQ.3) GO TO 60
A(8) = (A(2)*XN1 + A(5)*YN1)*(XN + YN) / (X1PY1*XN*YN)
A(11) = X1PY1
GO TO 70
60 A(8) = A2DXN + A5DYN
F = A2DXN/ A(8)
F2 = F*F
A(11) = (XN1*YN1) / (X1PY1 * F2 + XN1 * (1.0 - F - F))
70 A(9) = SQRT (A(8))
A(10) = A(7)/A(9)
RETURN
END



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : STMEAN.FOR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/