Trailing-Edge
-
PDP-10 Archives
-
decuslib10-06
-
43,50422/cmod75.bas
There are 2 other files named cmod75.bas in the archive. Click here to see a list.
00020REM *********************************************************************
00030REM CMOD75 CMOD75 CMOD75 CMOD75 CMOD75 CMOD75 CMOD75
00040REM
00050REM SET UP FOR 2X2 ANOVA
00060REM
00070REM******************************************************************
00080Q6=0
00090W9=0
00100FILES RFILE1,RFILE2,RFILE3, , , , RF7, ,
00140RESTORE#1
00141 INPUT# 1,I1,I2,I3
00150SCRATCH#1
00151 PRINT # 1,75,I2,I3
00160S8=0
00170SCRATCH#3
00171 PRINT # 3,0
00180RESTORE#2
00181 INPUT# 2,G0
00190IF G0=0 THEN 320
00200MAT N=ZER(G0)
00210MAT O=ZER(G0,1)
00220MAT S=ZER(G0,1)
00221FOR I=1TOG0
00222INPUT#2,N(I)
00223NEXTI
00224FORI=1TOG0
00225INPUT#2,O(I,1)
00226NEXTI
00227FORI=1TOG0
00228INPUT#2,S(I,1)
00229NEXTI
00240G5=0
00250MAT X=ZER(G0,G0)
00260FOR I=1 TO G0
00270G5=G5+N(I)-1
00280S8=S8+S(I,1)*N(I)*S(I,1)
00290X(I,I)=1/N(I)
00300NEXT I
00310GOTO 1250
00320G0=4
00330S8=0
00340 DIM X(12,12),A(12,12),B(12,12),C(12,12),D(12,12),E(12,12)
00350 DIM P(12,12),Q(1,12),R(12,1),S(12,1),T(12,12),U(12,12)
00360 DIM O(12,1),K(12,1),H(12),V(12),F(12,12),G(12,12),I(12),J(12,12)
00370 DIM Z(12,1),M(12,12),L(12,12)
00390 W$="11122122"
00400MAT O=CON(G0,1)
00410 DIM N(12)
00420MAT X=CON(G0,G0)
00430MAT S=ZER(G0,1)
00440MAT N=ZER(G0)
00450MAT X=ZER
00460PRINT L$
00470PRINT " TWO BY TWO"
00480PRINT
00490PRINT "HERE IS THE TERMINOLOGY FOR THE DESIGN."
00500PRINT
00510PRINT " COLUMN 1 COLUMN 2"
00520PRINT
00530PRINT " ROW 1 CELL 11 CELL 12"
00540PRINT
00550PRINT " ROW 2 CELL 21 CELL 22"
00560PRINT
00570PRINT "FOR EACH CELL YOU WILL BE ASKED TO ENTER THE MEAN,"
00580PRINT "SAMPLE SIZE, AND STANDARD DEVIATION. IF YOU DO NOT HAVE"
00590PRINT "THESE STATISTICS FOR YOUR DATA THEY MAY BE OBTAINED IN"
00600PRINT "COMPONENT 1."
00610PRINT " "
00620PRINT "IF YOU HAVE YOUR STATISTICS AND WISH TO CONTINUE TYPE '1'."
00630PRINT " OTHERWISE TYPE '0'";
00640GOSUB 2850
00650IF O1 <> 0 THEN 670
00660CHAIN "RSTRT"
00670G0=4
00680G5=0
00690PRINT L$
00700FOR I=1 TO G0
00710IF I>2 THEN 740
00720PRINT "CELL";10+I;
00730GOTO 750
00740PRINT "CELL";18+I;
00750PRINT "SAMPLE SIZE, MEAN, ST.DEV.(DIVISOR N)";
00760GOSUB 9100
00770IF O3>0 THEN 800
00780PRINT "REENTER. ST. DEV. MUST BE GREATER THAN 0."
00790GOTO760
00800IF O1 >= 2 THEN 830
00810PRINT "REENTER. SAMPLE SIZE MUST BE AT LEAST 2."
00820GOTO 760
00830O(I,1)=O2
00840X(I,I)=1/O1
00850N(I)=O1
00860S(I,1)=O3
00870G5=G5+O1-1
00880S8=S8+O3*O1
00890IF Q6=1 THEN 910
00900NEXT I
00910PRINT L$
00920Q6=0
00930PRINT "CELL SAMPLE SIZE MEAN ST. DEV."
00940PRINT " "
00950FOR I=1 TO G0
00960:'C ### ###.## ###.##
00965O1=(I-1)*2+1
00970 PRINT USING 960,MID$(W$,O1,O1+1-(O1)+1),N(I),O(I,1),S(I,1)
00980NEXT I
00990PRINT
01000PRINT "TO CONTINUE TYPE '1'"
01010PRINT "TO RESPECIFY INDIVIDUAL CELL TYPE ITS NUMBER"
01020PRINT "TO RESPECIFY ALL CELLS TYPE '0'";
01030GOSUB 9000
01040O1=INT(O1)
01050IF O1=1 THEN 1200
01060IF O1=0 THEN 690
01070IF O1<11 THEN 1180
01080Q6=1
01090I=O1-10
01100IF I <= 0 THEN 1180
01110IF I <= 2 THEN 720
01120I=I-10
01130IF I <= 0 THEN 1180
01140IF I>2 THEN 1180
01150I=I+2
01160GOTO 740
01170GOTO 1180
01180PRINT "INPUT MUST BE '0', OR CELL NUMBER"
01190GOTO 930
01200SCRATCH#2
01201 PRINT # 2,G0
01210FORI=1TOG0
01211PRINT#2,N(I)
01212NEXTI
01213FORI=1TOG0
01214PRINT#2,O(I,1)
01215NEXTI
01216FORI=1TOG0
01217PRINT#2,S(I,1)
01218NEXTI
01220SCRATCH#7
01221 PRINT#7,0
01222PRINT#7,0
01223PRINT#7,0
01224 PRINT#7,0
01230CHAIN "CMOD75"
01240PRINT
01250C5=0
01260PRINT L$
01270G2=G5
01280S9=S8/G2
01290SCRATCH#3
01291 PRINT # 3,0,0,0
01300GOSUB 1320
01310GOTO 1540
01320PRINT "POSTERIOR DISTRIBUTION OF THE 4 CELL PARAMETERS IS MULTIVARIATE T"
01330PRINT "WITH ";G2;" DEGREES OF FREEDOM AND WITH THE FOLLOWING MARGINAL"
01340PRINT "UNIVARIATE T DISTRIBUTIONS:"
01350PRINT
01360PRINT " DF MEAN ST. DEV."
01370K0=0
01380FOR I=1 TO 2
01390FOR J=1 TO 2
01400:CELL## ## ### ########.## ########.##
01410K0=K0+1
01420IF C5=0 THEN 1500
01430FOR I0=1 TO C5
01440IF H(I0)=K0 THEN 1470
01450NEXT I0
01460GOTO 1500
01470:CELL ## GIVEN ########.##
01480PRINT USING 1470,I,J,V(I0)
01490GOTO 1510
01500PRINT USING 1400,I,J,G2,O(K0,1),SQR(S8*X(K0,K0)/(G2-2))
01510NEXT J
01520NEXT I
01530RETURN
01540PRINT
01550PRINT "THE ANALYSIS CAN NOW BE CONDUCTED USING ONE"
01560PRINT "OF THE FOLLOWING PARAMETERIZATIONS."
01570PRINT " "
01580PRINT " 1. CELL PARAMETERIZATION"
01590PRINT " 2. ANOVA EFFECTS"
01600PRINT " 3. USER SPECIFIED EFFECTS"
01610PRINT "TYPE THE NUMBER OF THE OPTION YOU WISH OR '0' TO EXIT.";
01620GOSUB 2850
01630T8=O1
01640D5=G0
01650IF O1=3 THEN 1710
01660IF O1=1 THEN 2210
01670IF O1=2 THEN 2210
01680IF O1=0 THEN 660
01690PRINT "REENTER. INPUT MUST BE NUMBER OF AVAILABLE OPTION."
01700GOTO 1620
01710PRINT
01720PRINT "THIS ANALYSIS WILL BE BASED ON A SET OF NEW PARAMETERS DEFINED"
01730PRINT "AS INDEPENDENT LINEAR COMBINATIONS OF THE ORIGINAL 4 PARAMETERS."
01740PRINT "FOR EACH OF THESE NEW PARAMETERS YOU WILL NEED TO SPECIFY THE"
01750PRINT "4 COEFFICIENTS OF THE ORIGINAL 4 PARAMETERS."
01760PRINT
01770PRINT "ENTER NUMBER OF LINEAR COMBINATIONS(MAX=4).";
01780GOSUB 9000
01790IF O1<1 THEN 1820
01800IF O1>4 THEN 1820
01810GOTO 1840
01820PRINT "NUMBER OF LINEAR COMBINATIONS MUST BE BETWEEN 1 AND 4."
01830GOTO 1770
01840C5=0
01850D5=INT(O1)
01860PRINT
01870PRINT
01880MAT D=CON(D5,4)
01890PRINT " "
01900FOR I=1 TO D5
01910PRINT "COEFFICIENTS FOR CELLS - 11,12,21,22 ";
01920INPUT D(I,1),D(I,2),D(I,3),D(I,4)
01930NEXT I
01940MAT L=ZER(D5,G0)
01950MAT L=D
01960R0=D5
01970C0=G0
01980GOSUB 9700
01990PRINT L$
02000GOTO 2050
02010PRINT "THE PARAMETERS TO BE STUDIED HAVE BEEN FORMED BY THE FOLLOWING"
02020PRINT "LINEAR COMBINATIONS OF CELL MEANS."
02030PRINT " "
02040RETURN
02050GOSUB 2010
02060PRINT " CELL 11 CELL 12 CELL 21 CELL 22"
02070FOR I=1 TO D5
02080:PARAMETER # #####.## #####.## #####.## #####.##
02090PRINT USING 2080,I,D(I,1),D(I,2),D(I,3),D(I,4)
02100NEXT I
02110W9=1
02120PRINT "TO CONTINUE TYPE '1'"
02130PRINT "TO RESPECIFY TYPE '0'.";
02140GOSUB 9000
02150IF O1=0 THEN 1770
02160IF L0=1 THEN 2200
02170PRINT " "
02180PRINT "YOUR LINEAR COMBINATIONS ARE DEPENDENT, RESPECIFY."
02190GOTO 1770
02200GOTO 2240
02210D5=4
02220SCRATCH#3
02221 PRINT # 3,0
02230MAT D=CON(D5,4)
02240MAT A=CON(D5,G0)
02250MAT B=CON(G0,D5)
02260MAT C=CON(D5,D5)
02270MAT E=CON(D5,D5)
02280MAT M=CON(G0,G0)
02290MAT M=X
02300IF T8=3 THEN 2770
02310IF T8=2 THEN 2490
02320MAT D=IDN
02330PRINT L$
02340GOTO 2430
02350GOSUB 2010
02360PRINT " CELL 11 CELL 12 CELL 21 CELL 22"
02370FOR I=1 TO D5
02380D(I,I)=1
02390:PARAMETER # #.## #.## #.## #.##
02400PRINT USING 2680,I,D(I,1),D(I,2),D(I,3),D(I,4)
02410NEXT I
02420PRINT " "
02430PRINT "PARAMETER 1 = MEAN CELL 11"
02440PRINT "PARAMETER 2 = MEAN CELL 12"
02450PRINT "PARAMETER 3 = MEAN CELL 21"
02460PRINT "PARAMETER 4 = MEAN CELL 22"
02470PRINT " "
02480GOTO 2770
02490D(1,1)=.25
02500PRINT L$
02510D(1,2)=.25
02520D(1,3)=-.25
02530D(1,4)=-.25
02540D(2,1)=.25
02550D(2,2)=-.25
02560D(2,3)=.25
02570D(2,4)=-.25
02580D(3,1)=.25
02590D(3,2)=-.25
02600D(3,3)=-.25
02610D(3,4)=.25
02620FOR I=1 TO 4
02630D(4,I)=.25
02640NEXT I
02650GOSUB 2010
02660PRINT " CELL 11 CELL 12 CELL 21 CELL 22"
02670FOR I=1 TO 4
02680:PARAMETER## ##.## ##.## ##.## ##.##
02690PRINT USING 2680,I,D(I,1),D(I,2),D(I,3),D(I,4)
02700NEXT I
02710PRINT " "
02720PRINT "PARAMETER 1 = ROW EFFECT"
02730PRINT "PARAMETER 2 = COLUMN EFFECT"
02740PRINT "PARAMETER 3 = INTERACTION EFFECT"
02750PRINT "PARAMETER 4 = MEAN EFFECT"
02760PRINT " "
02770SCRATCH#7
02772PRINT#7,G0
02773PRINT#7,S8
02774PRINT#7,G5
02775PRINT#7,D5
02780MAT M=ZER(D5,1)
02781FORI=1TOG0
02782PRINT#7,N(I)
02783NEXTI
02784FORI=1TOG0
02785PRINT#7,O(I,1)
02786NEXTI
02787FORI=1TOD5
02788FORJ=1TO4
02789PRINT#7,D(I,J)
02790NEXTJ
02791NEXTI
02792FORI=1TOD5
02794PRINT#7,M(I,1)
02796NEXTI
02797FORI=1TOD5
02799PRINT#7,M(I,1)
02801NEXTI
02802IFW9=1THEN2840
02810PRINT " "
02820PRINT "TO CONTINUE TYPE '1'.";
02830GOSUB 9000
02840CHAIN "CMOD70"
02850REM--SUBROUTINE THAT DETERMINES IF RESTART HAS BEEN REQUESTED.
09000REM
09005INPUT O1
09015IF O1=-9999 THEN 9025
09020RETURN
09025CHAIN "RSTRT"
09035REM*************END ROUTINE
09050REM--SUBROUTINE THAT DETERMINES IF RESTART HAS BEEN REQUESTED. 2 INPUTS
09055INPUT O1,O2
09065IF O1=-9999 THEN 9080
09070IF O2=-9999 THEN 9080
09075RETURN
09080CHAIN "RSTRT"
09090REM*************END ROUTINE
09100REM--SUBROUTINE THAT DETERMINES IF RESTART HAS BEEN REQUESTED. 3 INPUTS
09105INPUT O1,O2,O3
09115IF O1=-9999 THEN 9135
09120IF O2=-9999 THEN 9135
09125IF O3=-9999 THEN 9135
09130RETURN
09135CHAIN "RSTRT"
09145REM*************END ROUTINE
09700REM SUBROUTINE DETERMINES IF MATRIX L HAS INDEPENDENT ROWS
09702REM L HAS R0 ROWS AND C0 COLUMNS
09704REM R0 MUST BE <= C0
09706REM RETURNS L0=0 IF DEPENDENT L0=1 IF INDEPENDENT
09708L0=0
09710FOR K=1 TO R0
09712FOR L2=1 TO C0
09714FOR K1=K TO R0
09716IF L(K1,L2) <> 0 THEN 9724
09718NEXT K1
09720NEXT L2
09722GOTO 9770
09724IF K1=1 THEN 9736
09726FOR I=1 TO C0
09728L9=L(K1,I)
09730L(K1,I)=L(K,I)
09732L(K,I)=L9
09734NEXT I
09736L9=L(K,L2)
09738FOR I=1 TO C0
09740L(K,I)=L(K,I)/L9
09742NEXT I
09744FOR J=K+1 TO R0
09746IF L(J,L2)=0 THEN 9756
09748L9=L(J,L2)
09750FOR I=1 TO C0
09752L(J,I)=-L(J,I)/L9+L(K,I)
09754NEXT I
09756NEXT J
09758NEXT K
09760FOR I=1 TO C0
09762IF L(R0,I) <> 0 THEN 9768
09764NEXT I
09766GOTO 9770
09768L0=1
09770RETURN
09772REM***********END OF ROUTINE*********************************
09999END