ClearAll;

n = 4;

x = {0.75, 2.5, 4.5, 1.25};

y = {3.25, 1, 3.5, 2.75};

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], 
          PlotRange -> {0, 3.5}];

g = 
        Plot[m*t + q, {t, 0, 4.5}, PlotRange -> {0, 3.5}];

Show[p, g]