Professional Documents
Culture Documents
Lesson 5 10 Linear Regression Residuals
Lesson 5 10 Linear Regression Residuals
Tom Broekel
Diagnostics: Residuals
1 © TBroekel
Diagnostics of linear regression: Residuals
Requirement
2 © TBroekel
s
3 © TBroekel
s
40000
20000
Residual
−20000
0 100 200
Index
4 © TBroekel
t
5 © TBroekel
n
Coefficients correc
6 © TBroekel
t
What to do
Missing variables
7 © TBroekel
?
Function reports additional tests with usually little differences and similar
interpretation
Normal distribution
hypothesis to be rejected
because p-value below 0.01
8 © TBroekel
t
9 © TBroekel
s
“No heteroscedasticity
10 © TBroekel
”
Source: https://clevertap.com/blog/a-brief-primer-on-linear-regression-part-ii/
11 © TBroekel
Diagnostics of linear regression: Residuals
12 © TBroekel
n
Rejection of homoscedasticity
Implication
Coefficients correc
13 © TBroekel
s
Missing variables
14 © TBroekel
?
Prob>Chi2 = p-value
p-value above 0.01 implying
homoscedasticity cannot be
rejected
15 © TBroekel
R
16 © TBroekel
s
17 © TBroekel
)
18 © TBroekel
Diagnostics of linear regression: Residuals
19 © TBroekel
m
Regression residual
^
Residual = Y − Y
40000
20000
20 © TBroekel
d
Moran-correlation coefficient I
Pn Pn
n i=1 j=1 wij (xi x̄)(xj x̄)
I = Pn Pn Pn
i=1 j=1 wij i=1 (xi x̄)2
21 © TBroekel
s
Estimation of
correlation coef cient=Moran’s I
22 © TBroekel
fi
Diagnostics of linear regression: Residuals
23 © TBroekel
)
Weighting based on distance (growing distance implies less weight in region i’s
estimation
24 © TBroekel
…
25 © TBroekel
)
Usually, a “map
Use of sf (simple feature) library makes working with such data eas
26 © TBroekel
27 © TBroekel
y
fi
y
28 © TBroekel
Diagnostics of linear regression: Residuals
29 © TBroekel
)
fi
e
31 © TBroekel
fi
:
Number of observation
Linearit
Multicollinearit
Outlie
Heteroscedasticit
Autocorrelation (spatial/temporal)
32 © TBroekel
r
33 © TBroekel