Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0025/unista.bas
There are 2 other files named unista.bas in the archive. Click here to see a list.
700READU
701PRINT"MODIFIED 08/06/68"
702IFU=5E37THEN 1042
703PRINT
704RESTORE
706PRINT
707LETB1=0
708PRINT"PLEASE SPECIFY A TYPICAL CLASS INTERVAL"
709LETB2=0
710PRINT"FOR FREQUENCY DISTRIBUTIONS:  LOWER,UPPER =";
712INPUTW1,W2
714PRINT
716PRINT
718DIMX(300),S(3),Y(3),Z(4)
720DIMC(50),G(50),E(50),F(50)
722DEFFNR(M)=.001*INT(1000*M+.5)
724DATA5E37,0,0,0,0,0,0,0
726LETI=-1
728LETI=I+1
730READX(I)
732IFX(I)<>5E37THEN 728
734LETN1=I
736LETN=N1-1
737FORI=0TO3
738LETS(I)=0
739NEXTI
740FORI=0TON
741LETB1=B1+X(I)
742LETY(0)=X(I)
743LETB2=B2+X(I)^2
744LETY(1)=X(I)^2
745LETA1=B1/N1
746LETY(2)=Y(0)*Y(1)
748LETY(3)=Y(1)^2
749FORJ=0TO3
750LETS(J)=S(J)+Y(J)
751NEXTJ
752NEXTI
754LETS=S(0)
755FORI=0TO3
756LETY(I)=(1/N1)*S(I)
757NEXTI
758LETS(1)=Y(1)-Y(0)^2
760LETS(2)=Y(2)-3*Y(0)*Y(1)+2*Y(0)^3
762	LET S(3)=Y(3)-(4*Y(2)-6*Y(1)*Y(0))*Y(0)
763	LET S(3)=S(3)-3*Y(0)*Y(0)*Y(0)*Y(0)
764LETY(1)=SQR(S(1))
766LETY(2)=S(2)/(S(1)*Y(1))
768LETY(3)=(S(3)/S(1)^2)-3
769LETA2=(B2-A1*B1)/N1
770LETA3=A2*N1/(N1-1)
771LETA4=SQR(A3)
772PRINT"S U M M A R Y   S T A T I S T I C S"
774PRINT
778PRINT"    NUMBER OF VARIATES =";N1
780PRINT"       ARITHMETIC MEAN =";Y(0)
781PRINT"     STD DEV OF SAMPLE =";Y(1)
782PRINT"       SAMPLE VARIANCE =";S(1)
783PRINT"      EST TRUE STD DEV =";A4
784PRINT"     EST TRUE VARIANCE =";A3
785PRINT"    COEFF OF VAR (PCT) =";FNR(100*Y(1)/Y(0))
786PRINT"     STANDARD SKEWNESS = ";FNR(Y(2))
788PRINT"       STANDARD EXCESS = ";FNR(Y(3))
790PRINT
792PRINT
794FORI=0TON-1
796FORJ=I+1TON
798IFX(I)<X(J)THEN 806
800LETY1=X(I)
802LETX(I)=X(J)
804LETX(J)=Y1
806NEXTJ
808NEXTI
810PRINT"O R D E R  S T A T I S T I C S"
812PRINT
814PRINT"      SMALLEST VARIATE =";X(0)
816LETP1=10
818GOSUB 1024
820LETT1=P2
822PRINT"          LOWER DECILE =";T1
824LETP1=25
826GOSUB 1024
828LETT2=P2
830PRINT"        FIRST QUARTILE =";T2
832LETP1=50
834GOSUB 1024
836PRINT"                MEDIAN =";P2
837LETP5=P2
838LETP1=75
840GOSUB 1024
842LETT3=P2
844PRINT"        THIRD QUARTILE =";T3
846LETP1=90
848GOSUB 1024
850LETT4=P2
852PRINT"          UPPER DECILE =";T4
854PRINT"       LARGEST VARIANT =";X(N)
856PRINT
858LETU=X(N)-X(0)
860PRINT"           TOTAL RANGE =";U
862PRINT"          DECILE RANGE =";T4-T1
864PRINT"   SEMI-QUARTILE RANGE =";(T3-T2)/2
866PRINT"     BOWLEY'S SKEWNESS = ";FNR((T3+T2-2*P5)/(T3-T2))
868PRINT"      PEARSON SKEWNESS = ";FNR(3*(Y(0)-P5)/Y(1))
870PRINT
872PRINT
874PRINT
878LETD=ABS(W2-W1)
882 IF D=0 THEN 1044
884 LETY1=W1-INT((W1-X(0))/D+.99999)*D
886 LETL=INT((X(N)-Y1+.00001)/D)+1
888 IF L>50 THEN 1034
890FORI=0TOL
892 LETC(I)=Y1+I*D
894LETF(I)=0
896LETE(I)=0
898NEXTI
916PRINT"F R E Q U E N C Y   D I S T R I B U T I O N"
918PRINT
920PRINT"             UP TO BUT"," ","PERCENT"
922PRINT"FROM       NOT INCLUDING   FREQUENCY","FREQUENCY"
924PRINT
926FORI=0TON
928LETH=1+INT((X(I)-C(0))/D+1E-6)
930LETF(H)=F(H)+1
932LETE(H)=E(H)+X(I)
934NEXTI
935LETJ=0
936LETJ=J+1
938LETG(J)=100*F(J)/N1
940PRINTC(J-1),C(J),F(J),FNR(G(J))
941 IFJ=LTHEN944
942GOTO 936
944FORJ=2TOL
946LETF(J)=F(J-1)+F(J)
948LETG(J)=100*F(J)/N1
950LETE(J)=E(J-1)+E(J)
952NEXTJ
954PRINT
956PRINT
958PRINT"C U M U L A T I V E   D I S T R I B U T I O N"
960PRINT
962PRINT"            NUMBER LESS    PERCENT LESS   VARIATE SUM - PCT"
964PRINT" VALUE      THAN VALUE     THAN VALUE     LESS THAN VALUE"
966PRINT
967LETJ=0
968LETJ=J+1
970LETE(J)=100*E(J)/S
972PRINTC(J),F(J),FNR(G(J)),FNR(E(J))
973IFJ=LTHEN976
974GOTO 968
976PRINT
978PRINT
980PRINT"O R D E R E D   A R R A Y"
982PRINT
984LETM=INT(N1/4-.05)+1
986LETH=4*(M-1)
988LETL=N1-H
990FORI=0TOM-2
992LETK1=I+M
994IFL=1THEN 1000
996LETK2=I+2*M
998GOTO 1002
1000LETK2=I+2*M-1
1002IF(L-1)*(L-2)=0THEN 1008
1004LETK3=I+3*M
1006GOTO 1010
1008LETK3=I+3*M-2/L
1010PRINTX(I),X(K1),X(K2),X(K3)
1012NEXTI
1014FORI=1TOL
1016PRINTX(I*M-1),
1018NEXTI
1020PRINT
1022STOP
1024LETG5=P1*(N1+1)/100
1025LETP2=X(0)
1026IFG5<1THEN 1032
1027LETP2=X(N1-1)
1028IFG5>N1THEN 1032
1029LETQ5=INT(G5)
1030 LET H5=G5-Q5
1031LETP2=H5*X(Q5)+(1-H5)*X(Q5-1)
1032RETURN
1034PRINT
1036PRINT"CLASS INTERVAL CHOSEN IS TO SMALL."
1038PRINT"LIMIT IS 50 CLASSES.  RESPECIFY."
1039INPUTW1,W2
1040GOTO870
1042 PRINT"LIST THE FILE 'STADES***' FOR INSTRUCTIONS."
1044END