*net install tsg_schemes, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/") replace
set scheme white_tableau, permanently
use "https://github.com/quarcs-lab/data-open/raw/master/ede/Macro_PEBLIF.dta", clear
describe
sum
drop if nwbcode==. | year==.
xtset nwbcode year
Evolution of GDP per capita
tsline rgdpch if country == "ARGENTINA", legend(off)
gen ln_gdp = ln(rgdpch)
tsline ln_gdp if country == "ARGENTINA", legend(off)
Evolution of the investment share
tsline ki if country == "ARGENTINA", legend(off)
gen ln_s = ln(ki)
tsline ln_s if country == "ARGENTINA", legend(off)
Evolution of the (adjusted) population growth rate
gen ln_pop = ln(pop)
gen L1_ln_pop = L.ln_pop
gen n = ln_pop - L1_ln_pop
gen n_g_d = n+0.05
gen ln_n_g_d = ln(n_g_d)
tsline n_g_d if country == "ARGENTINA", legend(off)
tsline ln_n_g_d if country == "ARGENTINA", legend(off)
Solow relationships
tw (sc ln_gdp ln_s if country == "ARGENTINA")(lfit ln_gdp ln_s if country == "ARGENTINA"), ytitle("Ln GDP per capita") xtitle("Ln investment rate") legend(off)
tw (sc ln_gdp ln_n_g_d if country == "ARGENTINA")(lfit ln_gdp ln_n_g_d if country == "ARGENTINA"), ytitle("Ln GDP per capita") xtitle("Ln (adjusted) population growth") legend(off)
reg ln_gdp ln_s ln_n_g_d year if country=="ARGENTINA"
Stationarity
Autocorrelation
quietly reg ln_gdp ln_s ln_n_g_d year if country=="ARGENTINA"
estat dwatson
quietly reg ln_gdp ln_s ln_n_g_d year if country=="ARGENTINA"
predict residuals, resid
reg residuals L.residuals ln_s ln_n_g_d year if country=="ARGENTINA", robust
Dynamic models: DL and ARDL
reg ln_gdp L.ln_gdp ln_s L.ln_s ln_n_g_d L.ln_n_g_d year if country=="ARGENTINA"
predict residuals2, resid
reg residuals2 L.residuals2 L.ln_gdp ln_s L.ln_s ln_n_g_d L.ln_n_g_d year if country=="ARGENTINA", robust
reg D.ln_gdp L.ln_gdp ln_s L.ln_s ln_n_g_d L.ln_n_g_d year if country=="ARGENTINA"
Random walks
use "http://www.principlesofeconometrics.com/poe5/data/stata/spurious.dta", clear
gen time = _n
tsset time
label variable rw1 "Random walk 1"
label variable rw2 "Random walk 2"
tsline rw1 rw2, ytitle("Variables under study")
tw (sc rw1 rw2) (lfit rw1 rw2), legend(off) ytitle("Randon walk 1") xtitle("Randon walk 2")
regress rw1 rw2
tsline D.rw1 D.rw2, ytitle("Variables under study")
tw (sc D.rw1 D.rw2) (lfit D.rw1 D.rw2), legend(off) ytitle("First difference in Randon walk 1") xtitle("First difference in Randon walk 2")
regress D.rw1 D.rw2, robust
Unit root/random walk tests
dfuller rw1
dfuller D.rw1
Random walks in the Solow model?
use "https://github.com/quarcs-lab/data-open/raw/master/ede/Macro_PEBLIF.dta", clear
xtset nwbcode year
gen ln_gdp = ln(rgdpch)
gen ln_s = ln(ki)
gen ln_pop = ln(pop)
gen L1_ln_pop = L.ln_pop
gen n = ln_pop - L1_ln_pop
gen n_g_d = n+0.05
gen ln_n_g_d = ln(n_g_d)
tsline ln_gdp if country == "ARGENTINA", ytitle("Ln GDP per capita") legend(off)
tsline ln_s if country == "ARGENTINA", ytitle("Ln Investment share") legend(off)
tsline ln_n_g_d if country == "ARGENTINA", ytitle("Ln adj. population growth") legend(off)
dfuller ln_gdp if country == "ARGENTINA"
dfuller ln_s if country == "ARGENTINA"
dfuller ln_n_g_d if country == "ARGENTINA"