How To Calculate Trendline
How To Calculate Trendline
By Timothy Banas
Scientists often apply trendlines, or best fit lines, to their data after they graph it
on an x, y plot. The idea of a trendline is to reveal a linear relationship between
two variables, x and y, in the y = mx + b form. Deriving the line equation that links
two variables allows scientists to extrapolate, or predict, how one variable will
change given any change in the other. Most of the time you cannot simply draw a
line through real life data because rarely will it fit neatly. A statistical tool called
regression analysis is required to calculate the best fit line accurately. Regression
analysis of a large data set will easily fill both sides of a paper with numbers, so if
you can find a program to do it for you, you'll save lots of time.
Step 2
Let a equal n times the summation of all x-values multiplied by their corresponding
y-values, like so:
Step 3
Let b equal the sum of all x-values times the sum of all y-values, like so:
b = (1 + 2 + 3) x (3 + 5 + 6.5) = 87
Step 4
Let c equal n times the sum of all squared x-values, like so:
Step 5
Let d equal the squared sum of all x-values, like so:
d = (1 + 2 + 3)^2 = 36
Step 6
Plug the values that you calculated for a, b, c, and d into the following equation to
calculate the slope, m, of the regression line:
e = (3 + 5 + 6.5) = 14.5
Step 2
Let f equal the slope times the sum of all x-values, like so:
f = 1.75 x (1 + 2 + 3) = 10.5
Step 3
Plug the values you have calculated for e and f into the following equation for the
y-intercept, b, of the trendline:
Step 4
Plug your values for m and b into a linear equation to reveal the final trendline
equation: