-1- Workshop 8.3a: Non-independence part 1 Murray Logan May 28, 2015 Table of contents . 1 Linear modelling assumptions 1 2 Spatial autocorrelation 9 1. Linear modelling assumptions 1.1. Linear modelling assumptions y i = β 0 + β 1 × x i + ε i ϵ i ∼ N (0, σ 2 ) Homogeneity of variance σ 2 . 0 0 ··· . . σ 2 0 . ··· σ 2 ) y i = β 0 + β 1 × x i + ε i ε i ∼ N ( 0 , . V = cov = . . . . . σ 2 � �� � � �� � . . ··· Linearity Normality σ 2 . 0 ··· ··· Zero covariance (=independence) . . . 1.2. Variance-covariance σ 2 0 · · · 0 . . σ 2 · · · . 0 V = . . . . σ 2 . · · · . σ 2 0 · · · · · · � �� � Variance-covariance matrix 1.3. Compound symmetry • constant correlation (and cov) • sphericity
-2- 1 ρ · · · ρ . . · · · ρ 1 . cor ( ε ) = . . ... · · · 1 . ρ · · · · · · 1 � �� � Correlation matrix θ + σ 2 θ · · · θ . . θ + σ 2 θ · · · . V = . . . . θ + σ 2 . · · · . θ + σ 2 θ · · · · · · � �� � Variance-covariance matrix 1.4. Temporal autocorrelation • correlation dependent on proximity • data.t 0 20 40 60 80 100 30 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 20 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● y ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 10 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 100 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 80 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 60 ● ● ● ● ● ● ● ● ● ● ● ● ● x ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 40 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 20 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 2010 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● 2005 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● year 2000 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● 1995 ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 1990 ● ● ● ● ● ● ● ● ● ● 0 10 20 30 1990 1995 2000 2005 2010 1.5. Temporal autocorrelation • Relationship between Y and X > data.t.lm <- lm(y~x, data=data.t) . . > par(mfrow=c(2,3)) > plot(data.t.lm, which=1:6, ask=FALSE)
-3- Residuals vs Fitted Normal Q−Q Scale−Location 96 ● 20 Standardized residuals 6 ● 21 ● ● ● 21 Standardized residuals 2 21 ● 6 ● 6 ● ● ● ● ● ● ● ● ● ● ● ● ● ● 1.2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● 10 ● ● ● ● ● ● ● ● ● ● ● ● ● ● 1 ● ● ● ● ● ● ● ● ● ● Residuals ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.8 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.4 ● ● ● ● ● ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● −20 ● ● ● ● ● ● ● 96 ● ● −2 0.0 ● 96 9.5 10.5 11.5 12.5 −2 −1 0 1 2 9.5 10.5 11.5 12.5 Fitted values Theoretical Quantiles Fitted values Cook's dist vs Leverage h ii ( 1 − Cook's distance Residuals vs Leverage 0.06 2.5 2 1.5 96 96 7 ● 7 ● Standardized residuals 2 ● ● 6 ● ● 7 ● ● ● 6 ● ● 6 ● ● Cook's distance ● Cook's distance ● ● ● ● ● 0.04 ● 1 ● 0.04 ● ● 1 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● 0.02 ● 0.02 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.5 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −2 ● ● ● Cook's distance ● ● ● ● ● ● ● ● ● ● ● 0.00 96 0.00 ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● 0 ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● 0 20 40 60 80 100 0.00 0.01 0.02 0.03 0.04 0.01 0.02 0.03 0.04 Leverage h ii Obs. number Leverage 1.6. Temporal autocorrelation • Relationship between Y and X . . > acf(rstandard(data.t.lm))
-4- Series rstandard(data.t.lm) 1.0 0.8 0.6 ACF 0.4 0.2 0.0 −0.2 0 5 10 15 20 Lag 1.7. Temporal autocorrelation • can we partial out time . . > plot(rstandard(data.t.lm)~data.t$year) 2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 1 ● ● ● ● ● ● ● ● ● ● rstandard(data.t.lm) ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −2 ● 1990 1995 2000 2005 2010 data.t$year
Recommend
More recommend