download_data_fred_md: Download and Process FRED-MD / FRED-QD (McCracken-Ng)...

View source: R/download_data_fred.R

download_data_fred_mdR Documentation

Download and Process FRED-MD / FRED-QD (McCracken-Ng) Databases

Description

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().

Usage

download_data_fred_md(
  database = "FRED-MD",
  transform = FALSE,
  vintage = "latest"
)

Arguments

database

Which database to download: "FRED-MD" (monthly) or "FRED-QD" (quarterly). The frequency is implied by the database.

transform

Logical. If TRUE, apply each series' McCracken-Ng stationarity transform (tcode 1-7). If FALSE (the default), return raw levels.

vintage

Which release(s) to download: "latest" (the default, the current vintage), a "YYYY-MM" label for one historical release (e.g. "2020-03"; recent ones are hosted individually, older ones are extracted from the St. Louis Fed vintage archives), or "all" for every archived vintage stacked (the full real-time panel).

Details

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.

Value

A tibble ⁠[date, <series...>]⁠. For a specific vintage or "all", a vintage column (the "YYYY-MM" release label) is inserted after date.

References

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")}

See Also

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()

Examples


  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")


tidyfinance documentation built on Oct. 6, 2026, 1:06 a.m.