Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0020/stat04.sta
There are 2 other files named stat04.sta in the archive. Click here to see a list.
100'  NAME--STAT04
110'
120'  DESCRIPTION--COMPUTES CHI SQUARE STATISTICS FOR 
130'  2 BY 2 CONTINGENCY TABLES.
140'
150'  SOURCE--UNKNOWN
160'
170'  INSTRUCTIONS--DATA IS PUT IN LINE 900 AND FOLLOWING.
180'  ENTER THE TABLES IN NORMAL ORDER WITH FOUR ENTRIES OF 
190'  TABLE 1 FIRST, THEN THE 4 ENTRIES FOR TABLE 2, ETC.
200'  DATA LINE NUMBERS SHOULD NOT EXCEED 909. SAMPLE DATA ARE
210'  IN LINE 900.
220'
230'
240'  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *
250'
260   PRINT "TABLE", "     ", "CHI SQUARE"
270   PRINT
280   READ A, B, C, D
290   LET  N = A + B + C + D
300   LET  E = A*D - B*C
310   LET E=ABS(E)
320   LET  F = (E - N / 2 )
330   LET  G = N * F * F
340   LET  R1 = A + B
350   LET  R2 = N - R1
360   LET  C1 = A + C
370  LET  C2 = N - C1
380  LET  X = G / R1 / R2 / C1 / C2
390  PRINT A, B
400  PRINT C, D, X
410  GO TO 270
900  DATA  6, 0, 2, 6, 6, 0, 1, 3
910  END