Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap4_198111 - decus/20-0113/cmod13.bas
There are 2 other files named cmod13.bas in the archive. Click here to see a list.
00020  DIM Y(1000)              ,I(12)
00030REM **********************************************************************
00040REM    CMOD13    CMOD13    CMOD13     CMOD13      CMOD13     CMOD13
00050REM******************************************************************
00070  FILES RFILE1,RFILE2,RFILE3,RF4,RF5,RF6,RF7,RF8,RF9
00110RESTORE#1
00111  INPUT#  1,I1,I2,I3
00120SCRATCH#1
00121  PRINT #  1,44,I2,I3
00130IF I2=1 THEN 3430
00140REM*********   GET   DATA    ****************************
00145GOSUB8491
00150  DIM C(5,5),S(5),M(5)      ,T(5)
00220PRINT L$
00230PRINT "          DATA REDUCTION-SUMMARY STATISTICS"
00240PRINT
00250PRINT "     1. MEANS, ST.DEV.'S, PERCENTILES, ETC."
00260PRINT "     2. VARIANCE-COVARIANCE MATRIX"
00270PRINT "     3. CORRELATION MATRIX"
00290PRINT
00300PRINT "TYPE THE NUMBER OF THE OPTION YOU WANT (EXIT=0).";
00310GOSUB 9000
00312IF O1=0 THEN 3470
00320C9=O1
00330  ONO1  GOTO 390,1940,1940
00370PRINT "REENTER.  INPUT MUST BE NUMBER OF OPTION."
00380GOTO 310
00390PRINT
00410PRINT "THE SUMMARY STATISTICS ARE NOW BEING COMPUTED."
00420GOSUB 1980
00430GOSUB 450
00440GOTO 580
00450IF S0=1 THEN 570
00460S0=1
00470FOR K6=1 TO V0
00490FOR K5=1 TO N0
00500Q(K5)=Y(K5+K6*N0-N0)
00510NEXT K5
00520GOSUB 3020
00530FOR K5=1 TO N0
00540Y(K5+K6*N0-N0)=Q(K5)
00550NEXT K5
00560NEXT K6
00570RETURN
00580PRINT L$
00590PRINT "HERE ARE THE DESCRIPTIVE/SUMMARY STATISTICS FOR YOUR DATA."
00600PRINT
00602IF G6=0 THEN 607
00603  PRINT "DATA SET = ";M$;"      GROUP = ";MID$(G$,J6*6-5,J6*6-(J6*6-5)+1)
00605GOTO 608
00607PRINT "DATA SET = ";M$
00608PRINT
00610PRINT "                    VARIABLES"
00620FOR K5=1 TO V0+1
00630REM OLD IMAGE
00640PRINT "----------";
00650NEXT K5
00660PRINT
00670:"N=####    "
00680SCRATCH#9
00681PRINT#9USING670,N0
00682RESTORE#9
00683INPUT#9,Z$
00684PRINTZ$;
00690FOR K5=1 TO V0
00700:"    'CCCCC"
00710SCRATCH#9
00711PRINT#9USING700,MID$(V$,K5*6-5,6)
00712RESTORE#9
00713INPUT#9,Z$
00714PRINTZ$;
00720NEXT K5
00730PRINT
00740REMOLD IMAGE
00750PRINT   "-----------";
00760FOR K5=1 TO V0-1
00770REM OF IMAGE
00780PRINT  "----------";
00790NEXT K5
00800PRINT"----------"
00810REM OLD IMAGE
00820PRINT"MEAN      ";
00830FOR K5=1 TO V0
00840Q4=M(K5)/N0
00850GOSUB 3350
00860NEXT K5
00870PRINT
00880IF N0<6 THEN 1150
00890REM OF IMAGE
00900PRINT"TRIMEAN   ";
00910FOR K6=1 TO V0
00920P1=N0*.25
00930IF P1=INT(P1) THEN 1000
00940P1=INT(P1)
00950I3=P1+K6*N0-N0
00960Y9=Y(I3)+Y(I3+1)
00970Y9=Y9+Y(N0-P1+K6*N0-N0)+Y(N0-P1+K6*N0-N0-1)
00980Y9=Y9/2
00990GOTO 1020
01000I3=P1+K6*N0-N0
01010Y9=Y(I3)+Y(3*P1+K6*N0-N0)
01020Y9=Y9/4
01030P1=N0*.5
01040IF P1=INT(P1) THEN 1090
01050P1=INT(P1)
01060I3=P1+K6*N0-N0
01070Y9=Y9+.25*Y(I3)+Y(I3+1)*.25
01080GOTO 1100
01090Y9=Y9+.5*(Y(P1+K6*N0-N0))
01100Q4=Y9
01110GOSUB 3350
01120NEXT K6
01130REM***************  MIDMEAN  **************************
01140PRINT
01150REM OLD IMAGE
01160PRINT"MIDMEAN   ";
01170FOR K5=1 TO V0
01180Q4=0
01190Q3=0
01200FOR K6=INT(.25*N0)+1 TO INT(.75*N0-.00001)
01210Q4=Q4+Y(K6+K5*N0-N0)
01220Q3=Q3+1
01230NEXT K6
01240Q4=Q4/Q3
01250GOSUB 3350
01260NEXT K5
01270PRINT
01280GOTO 1380
01290REM OLD IMAGE
01300PRINT"ST.DEV.   ";
01310FOR K5=1 TO V0
01320Q4=N0*S(K5)-M(K5)*M(K5)
01330Q4=SQR(Q4/(N0*N0))
01340GOSUB 3350
01350NEXT K5
01360PRINT
01370GOTO 1820
01380REM OF IMAGE
01390PRINT"SMALLEST  ";
01400FOR K5=1 TO V0
01410Q4=Y(1+K5*N0-N0)
01420GOSUB 3350
01430NEXT K5
01440PRINT
01450REM OLD IMAGE
01460PRINT"LARGEST   ";
01470FOR K5=1 TO V0
01480Q4=Y(N0+K5*N0-N0)
01490GOSUB 3350
01500NEXT K5
01510PRINT
01520P2=10
01530GOSUB 1630
01540P2=25
01550GOSUB 1630
01560P2=50
01570GOSUB 1630
01580P2=75
01590GOSUB 1630
01600P2=90
01610GOSUB 1630
01620GOTO 1290
01630P1=N0*P2/100
01640IF P1<1 THEN 1810
01650:"##TH %ILE "
01660SCRATCH#9
01661PRINT#9USING1650,P2
01662RESTORE#9
01663INPUT#9,Z$
01664PRINTZ$;
01670IF P1=INT(P1) THEN 1750
01680P1=INT(P1)
01690FOR K6=1 TO V0
01700Y9=.5*(Y(P1+K6*N0-N0)+Y(P1+1+K6*N0-N0))
01710Q4=Y9
01720GOSUB 3350
01730NEXT K6
01740GOTO 1800
01750FOR K6=1 TO V0
01760Y9=Y(P1+K6*N0-N0)
01770Q4=Y9
01780GOSUB 3350
01790NEXT K6
01800PRINT
01810RETURN
01820FOR K5=1 TO V0+1
01830REM OLD IMAGE
01840PRINT"----------";
01850NEXT K5
01860PRINT
01870REM**********************************************************
01880PRINT "WHEN YOU ARE READY TO CONTINUE TYPE '1'.";
01890GOSUB 9000
01900PRINT L$
01910PRINT "TYPE THE NUMBER OF THE OPTION YOU WANT."
01920GOTO 250
01930GOTO 1940
01940PRINT L$
01950GOSUB 1980
01960IF O1=3 THEN 2750
01970GOTO 2170
01980IF S9=1 THEN 2160
01990S9=1
02000MAT C=ZER
02010MAT S=ZER
02020MAT M=ZER
02030FOR K6=1 TO V0
02040FOR K7=K6 TO V0
02050FOR K5=1 TO N0
02060I3=K5+K6*N0-N0
02070C(K6,K7)=C(K6,K7)+Y(K5+K6*N0-N0)*Y(K5+K7*N0-N0)
02080NEXT K5
02090NEXT K7
02100FOR K5=1 TO N0
02110I3=K5+K6*N0-N0
02120S(K6)=S(K6)+Y(I3)*Y(I3)
02130M(K6)=M(K6)+Y(I3)
02140NEXT K5
02150NEXT K6
02160RETURN
02170GOSUB 2190
02180GOTO 2240
02190FOR K5=1 TO 5-V0
02200REM OLD IMAGE
02210PRINT"     ";
02220NEXT K5
02230RETURN
02240PRINT "       VARIANCE-COVARIANCE MATRIX"
02241PRINT
02242IF G6=0 THEN 2247
02243  PRINT "DATA SET = ";M$;"   GROUP = ";MID$(G$,J6*6-5,J6*6-(J6*6-5)+1)
02244GOTO 2248
02247PRINT "DATA SET = ";M$
02248PRINT
02260GOSUB 2280
02270GOTO 2430
02280GOSUB 2190
02290REM OLD IMAGE
02300PRINT"          ";
02310FOR K5=1 TO V0
02320:"    'CCCCC"
02330SCRATCH#9
02331PRINT#9USING2320,MID$(V$,K5*6-5,K5*6-(K5*6-5)+1)
02332RESTORE#9
02333INPUT#9,Z$
02334PRINTZ$;
02340NEXT K5
02350PRINT
02360GOSUB 2190
02370FOR K5=1 TO V0+1
02380REMOLD IMAGE
02390PRINT"----------";
02400NEXT K5
02410PRINT
02420RETURN
02430REM***********************************************
02440FOR K6=1 TO V0
02450GOSUB 2190
02460:"  'CCCCC  "
02470SCRATCH#9
02471PRINT#9USING2460,MID$(V$,K6*6-5,6)
02472RESTORE#9
02473INPUT#9,Z$
02474PRINTZ$;
02480FOR K5=1 TO K6-1
02490 PRINT "          ";
02510NEXT K5
02520FOR K7=K6 TO V0
02530Q4=(C(K6,K7)-(M(K6)*M(K7))/N0)/N0
02540IF ABS(Q4)<10000 THEN 2590
02550:"##.###^^^^"
02560SCRATCH#9
02561PRINT#9USING2550,Q4
02562RESTORE#9
02563INPUT#9,Z$
02564PRINTZ$;
02570GOTO 2600
02580:"######.## "
02590SCRATCH#9
02591PRINT#9USING2580,Q4
02592RESTORE#9
02593INPUT#9,Z$
02594PRINTZ$;
02600NEXT K7
02610PRINT
02620NEXT K6
02630GOSUB 2190
02640GOSUB 2660
02650GOTO 1900
02660FOR K5=1 TO V0+1
02670REM OLD IMAGE
02680PRINT"----------";
02690NEXT K5
02700PRINT
02710GOSUB 2190
02720PRINT "WHEN YOU ARE READY TO CONTINUE TYPE '1'.";
02730GOSUB 9000
02740RETURN
02750PRINT L$
02760PRINT "                  CORRELATION COEFFICIENTS"
02761PRINT
02762IF G6=0 THEN 2767
02763  PRINT "DATA SET = ";M$;"  GROUP = ";MID$(G$,J6*6-5,6) 
02764GOTO 2768
02767PRINT "DATA SET = ";M$
02768PRINT
02770PRINT
02780GOSUB 2280
02790FOR K6=1 TO V0
02800GOSUB 2190
02810SCRATCH#9
02811PRINT#9USING2460,MID$(V$,K6*6-5,6)
02812RESTORE#9
02813INPUT#9,Z$
02814PRINTZ$;
02820FOR K5=1 TO K6-1
02830REM OLD IMAGE
02840PRINT"          ";
02850NEXT K5
02860FOR K7=K6 TO V0
02870IF ABS(S(K6)*N0-M(K6)*M(K6))<.000001 THEN 2940
02880IF ABS(S(K7)*N0-M(K7)*M(K7))<.000001 THEN 2970
02890R0=(N0*C(K6,K7)-M(K6)*M(K7))/SQR(N0*S(K6)-M(K6)*M(K6))
02900R0=R0/SQR(N0*S(K7)-M(K7)*M(K7))
02910:"#####.##  "
02920SCRATCH#9
02921PRINT#9USING2910,R0
02922RESTORE#9
02923INPUT#9,Z$
02924PRINTZ$;
02930GOTO 2980
02940:"SIGMA-##=0"
02950SCRATCH#9
02951PRINT#9USING2940,K6
02952RESTORE#9
02953INPUT#9,Z$
02954PRINTZ$;
02960GOTO 2980
02970SCRATCH#9
02971PRINT#9USING2940,K7
02972RESTORE#9
02973INPUT#9,Z$
02974PRINTZ$;
02980NEXT K7
02990PRINT
03000NEXT K6
03010GOTO 2630
03020  DIM Q(1000)
03030FOR I=2 TO N0
03040I0=Q(I)
03050I1=I
03060IF I1 <= 1 THEN 3120
03070J=INT(I1/2)
03080IF I0 <= Q(J) THEN 3120
03090Q(I1)=Q(J)
03100I1=J
03110GOTO 3060
03120Q(I1)=I0
03130NEXT I
03140REM***************************************
03150FOR I=N0 TO 2 STEP -1
03160T0=Q(1)
03170Q(1)=Q(I)
03180Q(I)=T0
03190L0=I-1
03200I1=1
03210C0=Q(1)
03220J=I1*2
03230IF J>L0 THEN 3310
03240IF J >= L0 THEN 3270
03250IF Q(J+1) <= Q(J) THEN 3270
03260J=J+1
03270IF Q(J) <= C0 THEN 3310
03280Q(I1)=Q(J)
03290I1=J
03300GOTO 3220
03310Q(I1)=C0
03320NEXT I
03330RETURN
03340M(K5)=M(K5)/N0
03350IF ABS(Q4)<1.E+06 THEN 3410
03360:" ##.##^^^^#
03370SCRATCH#9
03371PRINT#9USING3360,Q4
03372RESTORE#9
03373INPUT#9,Z$
03374PRINTZ$;
03380GOTO 3420
03400:" ######.##"
03410SCRATCH#9
03411PRINT#9USING3400,Q4
03412RESTORE#9
03413INPUT#9,Z$
03414PRINTZ$;
03420RETURN
03430PRINT L$
03440PRINT "        DATA REDUCTION-SUMMARY STATISTICS"
03450SCRATCH#1
03451  PRINT #  1,I1,3,I3
03460CHAIN "CMOD30"
03470IF G6=0 THEN 3475
03472GOTO 145
03475CHAIN "CMOD10"
08490REM----------  READ IN TEMPORARY DATA FILE
08491RESTORE#4
08492INPUT#4,M$
08493INPUT#4,G6
08494INPUT#4,V0
08495INPUT#4,G$
08496INPUT#4,V$
08505 FOR I=1 TO 12
08506 INPUT #4,I(I)
08507NEXTI
08510PRINT L$
08520IF G6=0 THEN 8830
08530PRINT "HERE ARE THE GROUPS IN YOUR DATA SET."
08540FOR J=1 TO G6
08550:## = 'CCCCC
08560  PRINT  USING 8550,J,MID$(G$,J*6-5,J*6-(J*6-5)+1)
08570NEXT J
08580PRINT
08590PRINT "INPUT THE NUMBER OF THE GROUP YOU WANT (NONE=0)";
08600GOSUB 9000
08610IF O1=0 THEN 8910
08620IF O1 <= G6 THEN 8640
08630PRINT "REENTER.  INPUT MUST BE NUMBER OF A GROUP OR 0."
08632GOTO 8600
08640IF O1<1 THEN 8630
08650J6=O1
08660N0=0
08662N1=0
08670FOR J=1 TO J6-1
08680N1=N1+I(J)
08700NEXT J
08710FOR J=1 TO N1*V0
08720  INPUT#4,O1
08722NEXT J
08725N0=I(J6)
08730GOTO 8870
08830N0=I(1)
08870FOR J=1 TO N0*V0
08880  INPUT#4,Y(J)
08890NEXT J
08900RETURN
08905SCRATCH#1
08906  PRINT #  1,I1,I2,I3,I4
08910CHAIN "CMOD10"
09000REM--SUBROUTINE THAT DETERMINES IF RESTART HAS BEEN REQUESTED.
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
09999END