How to Find a Linear Regression Equation
Regression analysis is used to find equations that fit data. Once we have the equation, we can use the statistical model to make predictions. One type of regression analysis is linear analysis. When a correlation coefficient shows that data is likely to be able to predict future outcomes and a scatter graph of the data appears to form a straight line, statisticians may use linear regression to find a predictive function. If you recall from elementary algebra, the equation for a line is y = mx + b. This article shows you how to take data, calculate linear regression, and find the equation y’ = a + bx.
Step 1: Make a chart of your data, filling in the columns in the same way as you would fill in the chart if you were finding the Pearson’s Correlation Coefficient.
| Subject | Age x | Glucose Level y | xy | x2 | y2 |
|---|---|---|---|---|---|
| 1 | 43 | 99 | 4257 | 1849 | 9801 |
| 2 | 21 | 65 | 1365 | 441 | 4225 |
| 3 | 25 | 79 | 1975 | 625 | 6241 |
| 4 | 42 | 75 | 3150 | 1764 | 5625 |
| 5 | 57 | 87 | 4959 | 3249 | 7569 |
| 6 | 59 | 81 | 4779 | 3481 | 6561 |
| Σ | 247 | 486 | 20485 | 11409 | 40022 |
From the above table, Σx = 247, Σy = 486, Σxy = 20485, Σx2 = 11409, Σy2 = 40022. n is the sample size (6, in our case).
Step 2: Use the following equations to find a and b.

a = 553,794
b = .385225
Click here if you want easy, step-by-step instructions for solving this formula.
Find a:
- ((486 × 11,409) – ((247 × 20,485)) / 6 (11,409) – 2472)
- 5,544,774 – (5,059,795 / 7,445)
- =553,794
Find b:
- (6(20,485) – (247 × 486)) / (6 (11409) – 2472)
- (122,910 – 120,042) / 68,454 – 2472
- 2,868 / 7,445
- = .385225
*/ ?>
Step 3: Insert the values into the equation.
y’ = a + bx
y’ = 553,794 + .385225x
That’s it!
* Note that this example has a low correlation coefficient, and therefore wouldn’t be too good at predicting anything.
Related posts:
- How to Find a Linear Regression Slope
- How to Compute a Linear Regression Test Value
- How to Perform a TI 83 Linear Regression
- How to Perform Linear Regression on the TI-89 calculator in Under a Minute!
- How to Compute Pearson’s Correlation Coefficients
How to Do Everything Statistics » How to Find a Linear Regression Slope said:
Nov 06, 09 at 5:53 am[...] If formulas scare you, you can find more comprehensive instructions on how to work the formula in this article on how to find a linear regression equation. [...]
Kimble said:
Nov 06, 09 at 4:29 pmHei!
Let’s say I’ve plotted y in a scatter plot to make some prediction. I know that it’s possible to find functions indicating the “upper and lower” bound for y for a given x with a given percent certainty.
I’ve done some statistics in Norwegian, but I’m not sure about the English term for this. Hope someone understood what I’m trying to do.
Thanks!
Stephanie said:
Nov 07, 09 at 5:52 amKimble, What you are describing is linear regression — I think you’re thinking of confidence interval. Stephanie
Lauren Schultz said:
Nov 12, 09 at 11:45 amYour explination was very helpful. I kept messing up when i put it into the calculator. I had to redo it over and overto get the answer in the ex then follow that process in my problem…
Lisa Barcomb said:
Nov 12, 09 at 7:28 pmThese questions were somewhat difficult but I tried to do my best and hopefully I will understand them as I take my test. Some of this information is not sinking in my head for some reason. I know I will never take a class like this again on line.
Donna Allen said:
Nov 13, 09 at 1:57 amI have to agree with Lisa that I wouldn’t take another math class online. Math is not my strong suit. And, I realize now that I should have been in a classroom setting where I could ask questions face to face. This blog has been very helpful. But, unfortunately it doesn’t make up for my lack of math skills.
Mary Johnson said:
Nov 29, 09 at 3:46 pmI was having trouble in chapter nine with the correlation coefficient, I couldn’t come up with the same answer as Math Zone using the formula to solve for r. The problems don’t show a square route in the denominator but the link to text does. I don’t know if my skills are lacking so much that I just didn’t know that but why would it show it in the text?
Stephanie said:
Dec 01, 09 at 2:41 amThere is a square root: Mathzone is missing it in a couple of the questions.
Kalynn Grabau said:
Dec 02, 09 at 10:03 amThat’s what it is. Mathzone doesn’t explain that to solce for r, you need to square root it. Now, I’m getting it, but before I was so confused. Thanks for this!
Donna Allen said:
Dec 02, 09 at 7:32 pmI found this information very helpful and easy to follow. Compared to chapter 8, so far this has been a breeze.
Donna Allen said:
Dec 05, 09 at 12:08 amThank you for posting it on the main blackboard page that the square root was missing. This saved a lot of time and headache.
Tammy Sutton said:
Dec 07, 09 at 3:35 pmOn this one I found it easier (yes I know lazier) to put it into my calculator. It took me a while to remember how to use my calculator, but once I remembered, I got it down. I’m not sure if there is a part on this site that would give some directions on how to use our calculators for these problems?
Vanessa DuBarry said:
Dec 10, 09 at 5:44 pmThis blog was very helpful and it was very easy to follow, I agree with the others that taking math online is way more difficult, but thanks to this blog its a little bit easier.
AshleyB said:
Feb 20, 10 at 6:30 amHey guys,
I’m from the better USA! and I think I found a new spot to hangout
So, anyone care about the Olympic Games?
Alison Bryant said:
Apr 26, 10 at 12:16 pmI found this aspect fairly easy once I got the equation down. However, I also realized that you can use the linreg function on the calculator and get the same answer.
Athar said:
May 25, 10 at 10:52 pmso i tried using the linreg2 function: as in, A=linreg2(x,y), given both x and y.
sooo what should that tell me. coz im running this in matlab and it doesnt seem to know what it is?!?!?
math for kids said:
Nov 24, 11 at 12:56 pmmath for kids…
[...]Statistics How To» Blog Archive » How to Find a Linear Regression Equation[...]…