10 PRINT "LINEAR CORRELATION COEFFICIENT"
20 PRINT
30 PRINT "NUMBER OF POINTS";
40 INPUT N
50 J=0
60 K=0
70 L=0
80 M=0
90 R=0
99 REM - ENTER COORDINATES OF DATA POINTS
100 FOR I=1 TO N
110 PRINT "X,Y OF POINT";I;
120 INPUT X,Y
129 REM - ACCUMULATE INTERMEDIATE VALUES
130 J=J+X
140 K=K+Y
150 L=L+X[2
160 M=M+Y[2
170 R=R+X*Y
180 NEXT I
189 REM - CALCULATE COEFFICIENT, PRINT
190 R2=(N*R-J*K)/SQR((N*L-J[2)*(N*M-K[2))
200 PRINT
210 PRINT "COEFFICIENT OF CORRELATION =";R2
220 END
