10 PRINT "LINEAR REGRESSION"
20 PRINT
30 PRINT "NUMBER OF KNOWN POINTS";
40 INPUT N
100 FOR I=1 TO N
110 PRINT "X,Y OF POINT ";I;
120 INPUT X,Y
130 J=J+X
140 K=K+Y
150 L=L+X^2
160 M=M+Y^2
170 R2=R2+X*Y
180 NEXT I
190 B=(N*R2-K*J)/(N*L-J^2)
200 A=(K-B*J)/N
210 PRINT
220 PRINT "F(X) = ";A;" + (";B;" * X)"
230 J=B*(R2-J*K/N)
240 M=M-K^2/N
250 K=M-J
260 PRINT
270 R2=J/M
280 PRINT "COEFFICIENT OF DETERMINATION  (R^2):"
290 PRINT R2
300 PRINT
310 PRINT "COEFFICIENT OF CORRELATION:"
320 PRINT SQR(R2)
330 PRINT
340 PRINT "STANDARD ERROR OF ESTIMATE:"
350 PRINT SQR(K/(N-2))
360 PRINT
370 PRINT "INTERPRETATION: ";
380 PRINT "(ENTER X=0 TO END)"
390 PRINT "X =";
400 INPUT X
410 IF X=0 THEN 450
420 PRINT "Y = ";A+B*X
430 PRINT
440 GOTO 390
450 END