Notes on Residuals

advertisement
A medical researcher wishes to determine how the dosage
(in mg) of a drug affects the heart rate of the patient.
Dosage
Heart rate
0.125
95
0.2
90
0.25
93
0.3
92
0.35
88
0.4
80
0.5
82
1. Find the correlation coefficient &
interpret it.
2. Find & interpret the slope.
3. Find & interpret the y-intercept.
4. Give the least squares regression line.
A medical researcher wishes to determine how the dosage
(in mg) of a drug affects the heart rate of the patient.
Dosage
Heart rate
0.125
95
0.2
90
0.25
93
0.3
92
0.35
88
0.4
80
0.5
82
1. Find the correlation coefficient & interpret
it.
−𝟓. 𝟏𝟕𝟐𝟐𝟗𝟕
𝒓=
= −𝟎. 𝟖𝟔
𝟔
2. Find & interpret the slope.
𝒔𝒚
𝟓. 𝟔𝟓
𝒃 = 𝒓 = −𝟎. 𝟖𝟔
= −𝟑𝟖. 𝟓𝟔
𝒔𝒙
𝟎. 𝟏𝟐𝟔
For every additional mg the heart rate
decreases by 38.56 bpm.
3. Find & interpret the y-intercept.
𝒂 = 𝒚 − 𝒃𝒙
𝒂 = 𝟖𝟖. 𝟓𝟕 − −𝟑𝟖. 𝟓𝟔 . 𝟑𝟎𝟒
𝒂 = 𝟏𝟎𝟎. 𝟐𝟗
4. Write LSRL:
đ‘¯đ’†đ’‚đ’“đ’• 𝑹𝒂𝒕𝒆 = 𝟏𝟎𝟎. 𝟐𝟗 − 𝟑𝟖. 𝟓𝟔 đ‘Ģ𝒐𝒔𝒂𝒈𝒆
RESIDUALS
Section 3.2B
Residuals
• Variation in the y values can be effectively
explained when the residuals are small –
close to the line.
• Remember a residual = observed – exp.
•đ’“đ’†đ’”đ’Šđ’…đ’–đ’‚đ’ = 𝒚 − 𝒚
The equation to explain the relationship between drug
dosage and heart rate is shown below.
đ‘¯đ’†đ’‚đ’“đ’• 𝑹𝒂𝒕𝒆 = 𝟏𝟎𝟎. 𝟐𝟗 − 𝟑𝟖. 𝟓𝟔 đ‘Ģ𝒐𝒔𝒂𝒈𝒆
Dosage
Heart rate
0.125
95
0.2
90
0.25
93
0.3
92
0.35
88
0.4
80
0.5
82
1. Find the predicted value for a dosage
of 0.4 mg.
2. Find the residual for (0.4, 80).
The equation to explain the relationship between drug dosage
and heart rate is shown below.
Find the residuals for each value.
đ‘¯đ’†đ’‚đ’“đ’• 𝑹𝒂𝒕𝒆 = 𝟏𝟎𝟎. 𝟐𝟗 − 𝟑𝟖. 𝟓𝟔 đ‘Ģ𝒐𝒔𝒂𝒈𝒆
Dosage
Heart rate
0.125
95
0.2
90
0.25
93
0.3
92
0.35
88
0.4
80
0.5
82
* The sum of the residuals is always zero!
đ‘Ļ
đ‘Ļ−đ‘Ļ
Residual Plot
• It is a scatterplot of the residuals vs the explanatory
variable.
• They help us to assess how well a regression line fits the
data.
• The residual plot should show no obvious pattern
• The residuals should be relatively small.
The equation to explain the relationship between drug dosage
and heart rate is shown below.
Find the residuals for each value.
đ‘¯đ’†đ’‚đ’“đ’• 𝑹𝒂𝒕𝒆 = 𝟏𝟎𝟎. 𝟐𝟗 − 𝟑𝟖. 𝟓𝟔 đ‘Ģ𝒐𝒔𝒂𝒈𝒆
đ‘Ļ
đ‘Ļ−đ‘Ļ
Dosage
Heart rate
0.125
95
95.47
-0.47
0.2
90
92.58
-2.578
0.25
93
90.65
2.35
0.3
92
88.72
3.278
0.35
88
86.79
1.206
0.4
80
84.87
-4.866
0.5
82
81.01
0.99
* The sum of the residuals is always zero!
Residual Plot
Dosage Residual Plot
4
3
2
1
Residuals
0
0
0.1
0.2
0.3
-1
-2
-3
-4
-5
-6
Dosage
0.4
0.5
0.6
Height vs Shoe size – residual plot
Good residual plot – show relatively
no pattern.
Good or Bad
Standard Deviation of the Residuals
• It represents the approximate size of a
“typical” or “average prediction error
(residual).
• Formula: 𝑠𝑒 =
𝑠𝑒 =
𝑟𝑒𝑠𝑖𝑑đ‘ĸ𝑎𝑙𝑠 2
𝑛−2
đ‘Ļ−đ‘Ļ 2
𝑛−2
The equation to explain the relationship between drug
dosage and heart rate is shown below.
Find the standard deviation of the residuals.
đ‘¯đ’†đ’‚đ’“đ’• 𝑹𝒂𝒕𝒆 = 𝟏𝟎𝟎. 𝟐𝟗 − 𝟑𝟖. 𝟓𝟔 đ‘Ģ𝒐𝒔𝒂𝒈𝒆
đ‘Ļ
đ‘Ļ−đ‘Ļ
đ‘Ļ−đ‘Ļ
Dosage
Heart rate
0.125
95
95.47
-0.47
0.2209
0.2
90
92.59
-2.578
6.6461
0.25
93
90.65
2.35
5.5225
0.3
92
88.72
3.278
10.745
0.35
88
86.79
1.206
1.4544
0.4
80
84.87
-4.866
23.678
0.5
82
81.01
0.99
0.9801
īƒĨī€¨ y ī€­ yˆ ī€Š
ī€Ŋ
nī€­2
2
se ī€Ŋ
49.24726
ī€Ŋ 3.14
5
2
Homework
*Page 191 (43, 45, 55, 60, 62)
Download