ClearAll;

n = 10;

x = {170, 176, 165, 171, 177, 167, 179, 185, 175, 180};

y = {68, 70, 67, 78, 83, 60, 77, 89, 77, 76};

xmean = (1/n)*Sum[x[[k]], {k, 1, n}];

ymean = (1/n)*Sum[y[[k]], {k, 1, n}];

sigmaxy = (1/n)*
          Sum[(x[[k]] - xmean) (y[[k]] - ymean), {k, 1, 
              n}];

sigmax = 
        Sqrt[(1/n)*
            Sum[(x[[k]] - xmean)^2, {k, 1, n}]];

sigmay = 
        Sqrt[(1/n)*
            Sum[(y[[k]] - ymean)^2, {k, 1, n}]];

m = N[sigmaxy/sigmax^2]

q = N[ymean - m*xmean]

corr = N[sigmaxy/(sigmax*sigmay)]

p = 
        ListPlot[Table[{x[[i]], y[[i]]}, {i, 1, n}], 
          PlotStyle -> PointSize[0.03]];

g = 
        Plot[m*t + q, {t, Min[x], Max[x]}, 
          PlotRange -> {Min[y], Max[y]}];

Show[p, g]

ClearAll;

n = 10;

x = {68, 70, 67, 78, 83, 60, 77, 89, 77, 76};

y = {170, 176, 165, 171, 177, 167, 179, 185, 175, 180};

xmean = (1/n)*Sum[x[[k]], {k, 1, n}];

ymean = (1/n)*Sum[y[[k]], {k, 1, n}];

sigmaxy = (1/n)*
          Sum[(x[[k]] - xmean) (y[[k]] - ymean), {k, 1, 
              n}];

sigmax = 
        Sqrt[(1/n)*
            Sum[(x[[k]] - xmean)^2, {k, 1, n}]];

sigmay = 
        Sqrt[(1/n)*
            Sum[(y[[k]] - ymean)^2, {k, 1, n}]];

m = N[sigmaxy/sigmax^2]

q = N[ymean - m*xmean]

corr = N[sigmaxy/(sigmax*sigmay)]

p = 
        ListPlot[Table[{x[[i]], y[[i]]}, {i, 1, n}], 
          PlotStyle -> PointSize[0.03]];

g = 
        Plot[m*t + q, {t, Min[x], Max[x]}, 
          PlotRange -> {Min[y], Max[y]}];

Show[p, g]