Regression from paired data
A least-squares regression uses the explanatory variable as x and the response variable as y. Calculate the slope b, intercept a and correlation r from the paired data, report the stated precision and keep the response variable on the left of the equation
- Set the roles Enter the explanatory variable as x and the response variable as y, regardless of the table order \(\displaystyle x=\text{EV},\quad y=\text{RV}\)
- Calculate the slope The least-squares slope is found before the intercept and gives the average response change per one-unit increase in x. \(\displaystyle b=\frac{S_{xy}}{S_{xx}}\)
- Calculate the intercept Use the unrounded slope when finding the intercept from the two means \(\displaystyle a=\bar{y}-b\bar{x}\)
- Report the output Report a, b and r to the stated number of decimal places and retain the sign of r. \(\displaystyle \hat{y}=a+bx,\quad r=-0.6734\ldots\to-0.67\text{ (2 d.p.)}\)
Worked example
A data set relates weekly practice time x in minutes to practice points y. The paired observations are (10, 42), (20, 47), (30, 51) and (40, 60). Use the data to find the least-squares equation and Pearson's r to 2 decimal places
- \(\displaystyle \bar{x}=25,\quad\bar{y}=50,\quad S_{xy}=290,\quad S_{xx}=500,\quad S_{yy}=174\)Find the two means and the three centred sums from the paired data
- \(\displaystyle b=\frac{290}{500}=0.58,\quad a=50-0.58\times25=35.5\)Find the slope first, then use it without intermediate rounding to find the intercept
- \(\displaystyle \hat{y}=35.5+0.58x\)Write the response variable on the left with the intercept and slope in the form y = a + bx
- \(\displaystyle r=\frac{290}{\sqrt{500\times174}}\approx0.98\)Substitute the centred sums into the correlation formula and round r to 2 decimal places
Common mistakes
Difficulty levels
Questions about this topic
Why is the explanatory variable entered as x?+
The regression direction is part of the question. Entering the explanatory variable as x makes the fitted equation predict the response variable from it
Why is the slope calculated before the intercept?+
The intercept is a = ȳ − b x̄, so its calculation needs the slope b first
Why should intermediate values not be rounded?+
The intercept and final equation depend on the unrounded slope. Early rounding can change the final reported parameters
Can I use a calculator?+
A calculator is allowed unless a question is marked no calculator
Which year level and chapter is this?+
Year 11, VCE Units 1 & 2, General Mathematics, chapter 7: Bivariate data