Processing math: 100%

Linear Regression of Trend Data

The best fit line (using least squares regression) for the n points (X1,Y1), (X2,Y2),...(Xn,Yn) has the form: y=mx+b

Where

Slope:

m=n(ni=1xiyi)(ni=1xi)(ni=1yi)n(ni=1xi2)(ni=1xi)2

Y-Intercept:

b=(ni=1yi)m(ni=1xi)n

xi is the time of the ith data point

yiis the value of the ith data point

The correlation coefficient quantifies the strength of the linear relationship and is calculated by: r=SSXYSSXSSY

Where SSX=ni=1xi2n(ni=1xi)2n2

SSY=ni=1yi2n(ni=1yi)2n2

SSXY=ni=1xiyin(ni=1xi)(ni=1yi)n2