image of READY prompt

Wang2200.org

Listing of file='2A' on disk='vmedia/glbr_22.wvd.zip'

# Sector 746, program filename = '2A'
0010 COM X(10),D(6),E(5),A(5,6),M,N
0015 PRINT "INPUT M,N"
   : INPUT M,N
   : PRINT "INPUT DATA POINTS"
0017 FOR I=1 TO M+2
   : FOR J=1 TO M+1
   : A(J,I)=0
0018 NEXT J
   : D(I)=0
   : NEXT I
0020 FOR K=1 TO N
   : PRINT "POINT";K
0025 INPUT X(1),X(2),X(3),X(4),X(5)
0040 D(M+2)=D(M+2)+X(M+1)^2
   : D(1),A(1,M+2)=A(1,M+2)+X(M+1)
0045 FOR I=1 TO M
   : A(I+1,1),A(1,I+1)=A(1,I+1)+X(I)
0050 D(I+1),A(I+1,M+2)=A(I+1,M+2)+X(I)*X(M+1)
0055 FOR J=I TO M
   : A(I+1,J+1),A(J+1,I+1)=A(I+1,J+1)+X(I)*X(J)
0060 NEXT J
   : NEXT I
   : NEXT K
0065 A(1,1)=N
0070 FOR I=2 TO M+1
   : E(I)=A(1,I)
   : NEXT I
0075 FOR S=1 TO M+1
0080 FOR T=S TO M+1
   : IF A(T,S)<>0 THEN 90
   : NEXT T
0085 PRINT "NO UNIQUE SOLUTION"
   : GOTO 999
0090 GOSUB 130
0095 C=1/A(S,S)
   : GOSUB 160
0100 FOR T=1 TO M+1
   : IF T=S THEN 120
0110 C=-A(T,S)
   : GOSUB 170
0120 NEXT T
   : NEXT S
   : GOTO 180
0130 FOR J=1 TO M+2
0140 B=A(S,J)
   : A(S,J)=A(T,J)
   : A(T,J)=B
0150 NEXT J
   : RETURN
0160 FOR J=1 TO M+2
   : A(S,J)=C*A(S,J)
   : NEXT J
   : RETURN
0170 FOR J=1 TO M+2
   : A(T,J)=A(T,J)+C*A(S,J)
   : NEXT J
   : RETURN
0180 PRINT
0190 FOR T=1 TO M+1
   : PRINT "B(";T-1;")=";A(T,M+2)
   : NEXT T
0195 STOP
   : PRINT HEX(03)
0200 S=0
0210 FOR I=2 TO M+1
   : S=S+A(I,M+2)*(D(I)-E(I)*D(1)/N)
   : NEXT I
0220 T=D(M+2)-D(1)^2/N
   : C=T-S
0230 I=N-M-1
   : J=S/M
   : K=C/I
0240 PRINT
   : PRINT
0250 PRINT " ","  REGRESSION TABLE"
   : PRINT
0260 PRINT "SOURCE","SUM OF SQ.","DEG.FREEDOM","MEAN SQ."
0270 PRINT "REGRESSION",S,M,J
0280 PRINT "RESIDUAL",C,I,K
0290 PRINT "TOTAL",T,N-1
   : PRINT
0300 PRINT "F=";J/K
0310 PRINT
   : PRINT
   : J=S/T
0320 PRINT "COEFF. OF DETERMINATION=";J
0330 PRINT "COEFF. OF MULTIPLE CORRELATION=";SQR(J)
0340 PRINT "STANDARD ERROR OF ESTIMATE=";SQR(C/I)
0350 PRINT
   : PRINT
0360 PRINT "DO YOU WISH TO ESTIMATE VALUES OF Y FROM THE"
0370 PRINT "REGRESSION CURVE? (1=YES,0=NO)"
0380  INPUT I
   : IF I=0 THEN 999
0390 PRINT
   : S=A(1,M+2)
0400 FOR I=1 TO M
   : PRINT "COORDINATE X";I
0410 INPUT T
   : S=S+A(I+1,M+2)*T
   : NEXT I
0420 PRINT "Y=";S
   : PRINT
0430 PRINT "ANOTHER POINT?"
   : GOTO 380
0999 END