80 likes | 517 Views
Bivariate (multivariate) analysis. Aim: to estimate the model: Y t =b*X t + N t ; b= the regression coefficient expressing the effect of X on Y N t =noise term (error term), including other causes of Y besides X.
E N D
Bivariate (multivariate) analysis Aim: to estimate the model: Yt=b*Xt + Nt; b= the regression coefficient expressing the effect of X on Y Nt=noise term (error term), including other causes of Y besides X
Is the series stationary? If not: difference the series: Xt = Xt-Xt-1 The differencing reduces the risk of spurious correlations, since an omitted variable is more likely to be correlated with the explanatory variable due to common trends than as a result of synchronization in the yearly changes. Plot (scattergram) Yt against Xt to detect outliers
Are the series stationary? If not: difference both X and Y; Xt = Xt-Xt-1Plot (scattergram) Yt against Xt to detect outliers. Remedies: shorten series; dummy variable
Estimate the cross-correlations (CCF) between the pre-whitened Xt and the pre-whitened Yt in order to detect lag-structure (separate lecture on CCF, now: assume no lag-structure) • Specify functional form (more details later): • Linear • Semi-logarithmic • Log-log
Yt=b*Xt + Nt; The noise (Nt) is allowed to have a temporal structure that is modelled through AR and/or MA-parameters: Nt= Nt-1+ et. The residuals et= white noise. If the residuals ≠ white noise (but autocorrelated), the estimate of b will be unbiased, but the SE of b will be underestimatedfalse significance. Thus, we must identify and estimate a model for Nt
1. Estimate the model: Yt=b*Xt + Nt ;don’t include any noise parameters. 2. Identify the structure of the noise term on the basis of the ACF and PACF of the residuals. 3. Re-estimate the model including noise parameters. 4. Diagnostic test of the model: are the residuals white noise. If not: modify the noise parameters on the basis of the ACF and PACF of the residuals, and re-estimate the model.
Example: Assaultratet=b* Alkuttott + Nt Assaultrate=assaults/100,000 Alkuttot=public (bars etc) alcohol consumption 1. twoway (line alkuttot year) if year>1955 2. twoway (line assaultrate year) if year>1955 /Trending: should difference, but analyse raw data as an exercise / 3. generate alkutdif=d.alkuttot 4. generate assaultdif=d.assaultrate 5. twoway (scatter assaultdif alkutdif) 6. corrgram assaultdif, lags(20) 7. corrgram alkutdif, lags(20) 8.arima alkutdif, arima(1,0,0) 9.predict resass, r 10. corrgram resass, lags(20)
11. xcorr resass assaultdif, table lags(10) 12. arima assaultrate alkuttot, arima(0,0,0) 13. predict resmod1, r 14. arima assaultrate alkuttot, arima(1,0,0) 15. predict resmod2, r 16. corrgram resmod2, lags(20) 17. arima assaultrate alkuttot, arima(0,1,0) 18. predict resmod3, r 19. corrgram resmod3, lags(20)