The
The Best-Fit
Best-Fit Line
Line
Linear Regression
How do you determine the
best-fit line through data
points?
y-variable Fortunately technology,
such as the graphing calculator
and Excel, can do a better
job than your eye and a ruler!
x-variable
PGCC CHM 103 Sine
x
The Equation of a Straight Line
y = mx + b
where m is the slope or y/x and
b is the y-intercept
In some physical settings, b = 0 so the
equation simplifies to:
y = mx
PGCC CHM 103 Sine
x
Linear regression minimizes
the sum of the squared deviations
y = mx + b
y-variable
deviation = residual
= ydata point – yequation
x-variable
PGCC CHM 103 Sine
x
Linear Regression
• Minimizes the sum of the square of the
deviations for all the points and the best-fit
line
• Judge the goodness of fit with r2
• r2 x100 tells you the percent of the variation
of the y-variable that is explained by the
variation of the x-variable (a perfect fit has
r2 = 1)
PGCC CHM 103 Sine
x
Goodness of Fit: Using r2
r2 is low
y-variable
r2 is high
How about the value of r2?
x-variable
PGCC CHM 103 Sine
x
Strong direct relationship
25 y = 2.0555x - 0.1682
20 R2 = 0.9909
y-variable
15
10
5
0
0 2 4 6 8 10
x-variable
99.1% of the y-variation is due to
the variation of the x-variable
PGCC CHM 103 Sine
x
Noisy indirect relationship
30 y = -2.2182x + 25
2
25 R = 0.8239
y-variable
20
15
10
5
0
0 2 4 6 8 10
x-variable
Only 82% of the y-variation is due to
the variation of the x-variable - what
is the other 18% caused by?
PGCC CHM 103 Sine
x
When there is no trend!
20
15
y-variable
10
5 2
R = 0.0285
0
0 2 4 6 8 10
x-variable
No relationship!
PGCC CHM 103 Sine
x
In Excel
• When the chart is active, go to
chart, and select Add Trendline,
choose the type and on option select
display equation and display r2
• For calibration curves, select the set
intercept = 0 option Does this make
physical sense?
PGCC CHM 103 Sine
x
Does the set intercept = 0 option
make a difference?
Calibration Curve
1 y = 0.8461x + 0.0287
0.8
absorbance
2
0.6
R = 0.9954
0.4 y = 0.8888x
0.2 2
R = 0.9911
0
0 0.2 0.4 0.6 0.8 1
concentration
Using the set intercept = 0 option
lowers the r2 value by a small amount
and changes the slope slightly
PGCC CHM 103 Sine
x
The equation becomes
A = mc
or
A = 0.89c
99.1% of the variation of the
absorbance is due to the
variation of the concentration.
PGCC CHM 103 Sine
x