* Data in "gdp.dta" originally loaded from FRED
* GDPC1 = Real GDP (billions of chained 2009 dollars, quarterly, SAAR)
* renamed as GDP
* A191RL1Q225SBEA (percent change from preceding period)
* renamed as gdp
* GDPDEF = GDP implicit price deflator, index, 2009=100
* renamed as PriceLevel
* A191RI1Q225SBEA = percent change from preceding period, SAAR
* renamed as Inf
* FEDFUNDS (effective federal funds rate)
* renamed as FF
* time = quarter time index (created)
clear all
set more off
use gdp
* Plot the series against time
tsline GDP, title("Real GDP")
graph rename GDP
gen LGDP = ln(GDP)
tsline LGDP, title("Log(Real GDP)")
graph rename LGDP
tsline gdp, title("Real GDP Growth Rate")
graph rename gdp
tsline PriceLevel, title("GDP Deflator")
graph rename PriceLevel
tsline Inf, title("Inflation Rate")
graph rename Inf
tsline FF, title("Federal Funds Rate")
graph rename FF
* Estimate an autoregression
reg gdp L(1/4).gdp, r
* Estimate a VAR(1), VAR(4)
var gdp Inf FF, lags(1)
var gdp Inf FF, lags(1/4)
* Model Selection
varsoc gdp Inf FF, maxlag(8)
var gdp Inf FF, lags(1/6)