/* Apostolos Thomadakis
S2.125
Email: a.thomadakis@warwick.ac.uk
Personal webpage: https://sites.google.com/site/apostolosthomadakis/ */
cap log close
log using "H:\Documents\WESS\2016\Class2\divpr.smcl", replace
set more off
use "H:\Documents\WESS\2016\Class2\divpr.dta", clear
/*******************/
/* Questions 1 */
/*******************/
sum dividends gdp pce pdi profits quarter
sum dividends gdp pce pdi profits quarter, detail
scatter pdi pce
twoway line pdi pce
scatter profits dividends
twoway line profits dividends
kdensity gdp
kdensity pdi
kdensity pce
kdensity profits
kdensity dividends
generate Date = tq(1970q1) + _n-1
format %tq Date
tsset Date
order Date gdp pdi pce profits dividends
twoway line gdp Date /* which is similar to "tsline gdp" */
twoway line pdi Date
twoway line pce Date
twoway line profits Date
twoway line dividends Date
twoway (line pdi Date) (line pce Date)
twoway (line pdi Date) (line pce Date, yaxis(2))
/* All of them display a strong upward trend, which is evicence of nonstationarity.
Alternativelly, we can examine the degree of autocorrelation in each variable
series on its own. Series which are highly autocorrelated are unlikely to be
stationary. A series that is station ary and therefore has movements which are
purely stochastic should show no autocorrelation. */
ac gdp
ac pdi
ac pce
ac profits
ac dividends
/* All five series have an autocorrelation function which starts close to one and
converges monotonically towards the horizontal axis as the order of autocorrelation
increases. */
/*******************/
/* Questions 2 */
/*******************/
/* Let's test now for stationarity using the Dickey-Fuller test.
dfuller performs the augmented Dickey-Fuller test that a variable follows a unit-root
process. The null hypothesis is that the variable contains a unit root, and the
alternative is that the variable was generated by a stationary process. */
dfuller gdp, noconstant regress
dfuller gdp, regress
/* The test-statistic is higher than the critical values, therefore we fail to
reject the null hypothesis that the GDP is nonstationary. We conclude that GDP is
a nonstationary variable.
Since GDP exchibits a clear trend we perform the Dickey-Fuller test including
a trend. */
dfuller gdp, trend regress
/* The test-statistic is higher than the critical values at all significant
levels. This implies that we fail to reject the null at 1%, 5% and 10%. The series
is nonstationary.
However, given the strong evidence of autocorrelation we should also try and include
lags. Therefore we estimate an Augmented Dickey Feller test? */
dfuller gdp, lag(1) trend regress
dfuller gdp, lag(2) trend regress
dfuller gdp, lag(3) trend regress
dfuller gdp, lag(4) trend regress
dfuller gdp, lag(5) trend regress
dfuller gdp, lag(6) trend regress
/* The test-statistic is higher than the critical values at all significant
levels. This implies that we fail to reject the null at 1%, 5% and 10%. The series
is nonstationary. */
* We'll make the series stationary by taking the first difference.
gen dgdp = D.gdp
gen dpdi = D.pdi
gen dpce = D.pce
gen dprofits = D.profits
gen ddividends = D.dividends
tsline dgdp
tsline dpdi
tsline dpce
tsline dprofits
tsline ddividends
/* All of them display a mean reverting property, which suggests that they are
stationary. Let's use the DF test. */
dfuller dgdp
dfuller dpdi
dfuller dpce
dfuller dprofits
dfuller ddividends
/* For all five variables we observe that the test-statistic is much lower than
the critical values. Therefore, we reject the null hyposthesis and conclude that
all of them are first difference stationary series. */
/*******************/
/* Questions 3 */
/*******************/
* Engle-Granger Cointegration Test for Dividends and Profits
/* The main reason why it is important to know whether a time series is stationary
or nonstationary before regressing them is that there is a danger of obtaining
apparently significant results from unrelated data when nonstationary series are
used. */
tsline dividends profits
scatter dividends profits
pwcorr dividends profits
/* We see that there is a positive relationship between them and the correlation
is very high.
Let's regress dividends on profits. */
reg dividends profits
/* This result suggests that the simple regression model fits the data well
(Rsquared=0.62), and that the estimated slope is significantly different from zero
(t-statistic=11.93). Are these results spurious?
We can check that by applying the Engle-Granger test of cointegration. */
predict residuals1, r
tsline residuals1
dfuller residuals1, noconstant regress
reg d.residuals1 l.residuals1, noconstant
/* We fail to reject the null hypothesis, which means that residuals are nonstationary.
The regression is said to be spurious. */
/*******************/
/* Questions 4 */
/*******************/
tsline pce pdi
scatter pce pdi
reg pce pdi
predict residuals2, r
tsline residuals2
dfuller residuals2, noconstant regress
reg d.residuals2 l.residuals2, noconstant
/* We reject the null hypothesis that the least squares residuals are nonstationary
and conclude that they are stationary.
This implies that personal disposable income and consumers expenditure are cointegrated.
In other words, there is a fundamental relationship between these two variables
(the estimated regression relationship between them is valid and not spurious).
If there is a change in one variable, the other variable will also change thereby
ensuring that the effect is transmitted from one to another. */
* Error Correction Model for Dividends and Profits
/* An error correction model includes only I(0) variables. This requires all our
nonstationary variables to be first-differenced, to produce stationary variables.
*/
/* The error correction term is the residual from the cointegrating relationship,
lagged one time period, this too will be I(0) if the variables are cointegrated.*/
reg dpce dpdi l.residuals2
/* First, note that all coefficients are individually statistically significant
at the 5% or lower level. The coefficient of about 0.3 shows that if the personal
disposable income increase by one billion, consumers expenditure will increase on
average by 0.3 billions. Thisis the short-run consumption-income relationship. The
long-run value is given by the cointegrating regression (reg pce pdi), which is
about 0.97. Is that expected?
The coefficient of the error-correction term of about -0.087 suggests that only
about 8.7% of the discrepancy between the long-term and short-term pce is corrected
within a quarter, suggesting a slow rate of adjustment to equilibrium.
Why is that?
One reason the rate of adjustment seems low is that our model is rather simple.
If we had the necessary data on interest rate, wealth of consumer, and so on, probably
we might have seen different result. */
cap log close