What Is Bivariate Regression?
Bivariate regression looks at two variables measured on the same cases. Unlike a single fitted line, it recognises that there are two regression lines: one that predicts y from x and another that predicts x from y.
Paste your x and y values and the calculator returns both equations, the correlation r, the sample covariance, R² and a p-value for r. It also shows the check that the two slopes multiply to r², which is a quick way to catch arithmetic slips.
Use the y on x line to predict y and the x on y line to predict x. The two lines cross at the point of means, and they coincide only when the points lie exactly on a straight line.
How to Use the Bivariate Regression Calculator
- Paste the x values and the y values in matching order.
- Read the line of y on x to predict y, or the line of x on y to predict x.
- Use r and its p-value to judge how strong and how reliable the relationship is.
Bivariate Regression Formula
Regression of y on x
Regression of x on y
Correlation
Bivariate Regression Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| byx | Slope of the regression of y on x | Sxy / Sxx |
| bxy | Slope of the regression of x on y | Sxy / Syy |
| r | Correlation coefficient | Between −1 and 1 |
| Sxy | Sum of products of deviations | |
| x̄, ȳ | Means of x and y | Both lines pass through (x̄, ȳ) |
Bivariate Regression Worked Example
With the example values loaded in the calculator above, the steps are:
- n = 8, x̄ = 4.5, ȳ = 9.075.
- Sxx = 42, Syy = 165.195, Sxy = 83.1.
- y on x: slope = Sxy ÷ Sxx = 1.97857, intercept = ȳ − slope·x̄ = 0.171429.
- x on y: slope = Sxy ÷ Syy = 0.503042, intercept = x̄ − slope·ȳ = -0.0651049.
- r = Sxy ÷ √(Sxx·Syy) = 0.997649, and byx × bxy = 0.995304 = r².
Result: Regression of y on x = ŷ = 0.17143 + 1.9786x; Regression of x on y = x̂ = -0.065105 + 0.50304y.
Why there are two regression lines
Least squares minimises vertical distances for y on x and horizontal distances for x on y. The two lines are different unless the points fall exactly on a line (r = ±1).
Both lines pass through the point of means (x̄, ȳ). The weaker the correlation, the wider the angle between them.
Which line should you use?
Use y on x to predict y from a known x. Use x on y to predict x from a known y. Do not invert the first line to predict x: the result is biased toward the wrong answer unless r is close to ±1.
Where Bivariate Regression Is Used
Predicting in either direction
Estimate height from arm length, or arm length from height, using the matching line.
Exam problems on regression coefficients
Verify byx, bxy, r and the point of means in textbook questions.
Quick association check
Read r, covariance and the scatter plot before choosing a model.
Common Bivariate Regression Mistakes to Avoid
- The product of the two slopes equals r². If your hand calculation breaks that identity, recheck the sums.
- A strong r shows association, not cause.
Bivariate Regression Terms and Definitions
- Bivariate data
- Pairs of measurements on two variables for each case.
- Regression coefficient
- The slope of a regression line, byx or bxy.
Bivariate Regression FAQs
What is bivariate regression?
It is regression on two variables measured together. The usual output is a regression line, correlation and covariance for the pair.
What is the difference between regression of y on x and x on y?
They minimise different errors and give different lines. The first predicts y from x, the second predicts x from y.
How are the two regression coefficients related to r?
r = ±√(byx × bxy), and the sign of r matches the sign of both slopes.
Where do the regression lines meet?
At the point of means (x̄, ȳ).
Is bivariate regression the same as simple linear regression?
Simple linear regression usually means the y on x line only. Bivariate analysis also looks at x on y, correlation and covariance.
How many data pairs do I need?
At least 3 for this tool, but small samples give very uncertain slopes and a weak test of r.