Steps ofvVector Estimating Error correction model
1. Specify model: Ovtest
2. prepare stata for for time series analysis
3. stationary test
4. determine optimum lag length (P) for model
5. perform johnsen cointegration test
6. with no cointegration: VAR model
7. with co-integration; VECM model
8. perform diagnostic
A. Augmented Dikkey Fuller test (ADF): Finding I(0) or I(1)
1. Set time series data: tsset year, yearly
2. Fill missing data for Time Series analysis: ipolate x time, gen(xi) epolate
3. Check unit root using Augmented Dikker Fuller test (ADF): at integrative of order zero
ADF unit root test using constant
dfuller x
ADF test for constant and trend:
dfuller x, trend
if a variable has unit root, we take difference as follows:
dfuller d.x
ADF test after differencing for constant and trend:
dfuller d.x, trend
B. Checking assumption of linear ordinary least regression
1. If you want to have summary statistics: sum y x1 x2 x3 x4
2. How to run correlation matrix for your data: correlate y x1 x2 x3 x4
3. Command for running regression model: regress y x1 x2 x3 x4
4. If you want to check normality after running regression model, run two commands consecutively:
predict yhat, r
sktest yhat
5. Testing of Auto correlation
Visual method
regress y x1 x2 x3 x4
predict yhat, r
tsline yhat
Clusttering of value
dwstat
Correction
1. First difference transformation
reg d.y d.x1 dx2
predict dhat, r
tsline dhat
2. Generalized list square approach
prais y x, corc
if about this does not eliminate the problem of auto correlation
3. Newey-West Robust standard Error
neway y x, lag(1)
4. Heteroscedasticity
estat hettest
Note: Prob value below 10% means there is heteroskedasticity problem in the model:
Correction Measure
Log transformation of variable
Weighted list Method: reg y x (aw=1/one of the variable) trail and error process
robus option
reg y x, robus
estato robust
re-estimate the model with robus option
estato ols
estatout
5. Model Specification: estat ovtest
C. Determine Optimum lag
Command for selecting optimum lags for your model is given below:
varsoc y x1 x2 x3 x4, maxlag(4)
the asterisk (*) indicates the appropriate lag selected
D. VECM model
Command for testing co-integration:
vecrank y x1 x2 x3 x4, trend(constant)
When co-integration is established, run VECM otherwise unrestricted VAR model is
appropriate.
Assuming variables are co-integrated, we run VECM using the following command:
vec y x1 x2 x3 x4, trend(contant)
The long-run causality must be negative, significant and in between 0 to 1, representing
error correction term or speed of adjustment
Correction for auto-correlation
First difference transformation
Generalized difference
Drop missing variable
Drop Year=.