How do you calculate the slope and intercept of a regression line?

1 Answer
Jun 29, 2016

#m=(nSigmaxy-(Sigmax)(Sigmay))/(nSigmax^2-(Sigmax)^2)#

and #c=(Sigmay-mSigmax)/n#

Explanation:

Let the data be given as #(x,y)# and data set be

#(x_1,y_1),(x_2,y_2),(x_3,y_3),.......(x_n,y_n)#.

Then the fit for given data is of the type #y=mx+c#, #m# being slope of regression line and #c# being intercept of regression line.

Here #m=(nSigmaxy-(Sigmax)(Sigmay))/(nSigmax^2-(Sigmax)^2)#

and #c=(Sigmay-mSigmax)/n#