View source: R/download_data_fred.R
| download_data_fred_md | R Documentation |
Downloads a vintage of the FRED-MD (monthly) or FRED-QD (quarterly)
macroeconomic database - a curated, balanced panel of macro series
maintained by the Federal Reserve Bank of St. Louis - and returns it as a
wide tibble (one column per series), matching the layout of other
factor/predictor datasets such as download_data_factors_ff().
download_data_fred_md(
database = "FRED-MD",
transform = FALSE,
vintage = "latest"
)
database |
Which database to download: |
transform |
Logical. If |
vintage |
Which release(s) to download: |
Each series carries a McCracken-Ng stationarity transform code (tcode,
1-7); transform = TRUE applies it per series (all transforms are causal,
i.e. point-in-time safe). FRED-MD/QD publish a new vintage every month, so
a specific historical release can be requested via vintage, or the
entire real-time panel via vintage = "all", for point-in-time analysis
that avoids look-ahead bias from data revisions. Recent vintages are
hosted individually; older ones are extracted from the St. Louis Fed
historical vintage archive ZIP files.
A tibble [date, <series...>]. For a specific vintage or
"all", a vintage column (the "YYYY-MM" release label) is inserted
after date.
McCracken, M. W., & Ng, S. (2016). FRED-MD: A monthly database for macroeconomic research. Journal of Business & Economic Statistics, 34(4), 574-589. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07350015.2015.1086655")}
McCracken, M. W., & Ng, S. (2021). FRED-QD: A quarterly database for macroeconomic research. Federal Reserve Bank of St. Louis Review, 103(1), 1-44. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.20955/r.103.1-44")}
Other download functions:
download_data(),
download_data_constituents(),
download_data_factors_ff(),
download_data_factors_q(),
download_data_fred(),
download_data_huggingface(),
download_data_jkp(),
download_data_macro_predictors(),
download_data_osap(),
download_data_pastor_stambaugh(),
download_data_risk_free(),
download_data_stambaugh_yuan(),
download_data_stock_prices(),
download_factor_library_grid(),
download_factor_library_ids()
download_data_fred_md("FRED-MD")
download_data_fred_md("FRED-MD", transform = TRUE)
download_data_fred_md("FRED-MD", vintage = "2020-03")
download_data_fred_md("FRED-MD", vintage = "all")
download_data_fred_md("FRED-QD")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.