Calculator
Linear regression calculator
In one sentence
Finds the regression line from Sxx and Sxy.
Last checked Source: uk-dfe-alevel-maths-subject-content Source: Department for Education, GCE AS and A level subject content for mathematics (topics derived; every example and value computed here), uk-dfe-alevel-maths-subject-content www.gov.uk (opens in a new tab)
Inputs
- x̄, ȳ, Sxx, Sxy
Worked input
- Input x̄ = 6, ȳ = 45, Sxx = 20, Sxy = 130.
- b = 6.5.
- a = 45 − 39 = 6, so y = 6 + 6.5x.
- Take x̄ = 5, ȳ = 20, Sxx = 10 and Sxy = 25, a case with a positive trend. The gradient is b = 5/2 and the intercept is a = 15/2, so y = (15/2) + (5/2)x. A positive covariance gives a positive gradient, and the regression line always passes through the point of means, so the intercept follows from the gradient and the two means. Check: the line passes through the mean point (5, 20), since 7.5 + 2.5 × 5 = 20.
- Take x̄ = 10, ȳ = 50, Sxx = 40 and Sxy = −60, so the trend is negative. The gradient is b = −3/2 and the intercept is a = 65, so y = (65) + (−3/2)x. A negative covariance gives a negative gradient, so y falls as x rises, and the line of best fit still passes through the point made from the two mean values. Check: a negative Sxy always gives a negative slope, and the line still passes through (10, 50) as every least-squares line does.
- Take x̄ = 3, ȳ = 12, Sxx = 8 and Sxy = 0, a case with no linear trend. The gradient is b = 0 and the intercept is a = 12, so y = (12) + (0)x. A covariance of zero gives a horizontal line at the mean of y, which says that x tells you nothing about y in a linear model, so the best prediction is the average. Check: with Sxy equal to zero the slope is zero, so the fitted line is the flat line y = 12, the mean of y.
How to use it
- Enter the summary values.
- Use the line only within the x range.
Linear regression calculator for your study of A-level maths, with its source.
Related pages include Sine rule: ambiguous case checker, Cosine rule: find a side, Triangle area calculator and Cosine rule: find an angle.
Study brief
- When studying bivariate data for the A level maths, understanding regression involves several key concepts. Students must be familiar with explanatory or independent variables and response or dependent variables. Scatter diagrams provide a visual representation of these relationships. Predictions can be made through interpolation, but caution is necessary when using extrapolation. It is important to remember that correlation does not imply causation. Informal interpretations of correlation include terms such as strong, weak, zero, positive, or negative. To estimate constants in relationships like y = ax or y = kb, a change of variable might be necessary, such as using logarithms to create a linear form. For certain bivariate data, predictions should only be made within the specific range of the explanatory variable values. Other mathematical concepts related to data include measures of central tendency like mean, median, and mode, alongside measures of variation such as range, variance, and standard deviation. Data can be presented as continuous or discrete, and may be grouped or ungrouped. During examinations, students are responsible for the working condition and power supply of their calculator, ensuring it is clear of any stored information like databanks, dictionaries, or mathematical formulas.
Practise for free
Test yourself with exam-style questions and see why each answer is right or wrong.