download_data_macro_predictors: Download and Process Macro Predictor Data

View source: R/download_data_macro_predictors.R

download_data_macro_predictorsR Documentation

Download and Process Macro Predictor Data

Description

Downloads and processes macroeconomic predictor data based on the specified dataset (monthly, quarterly, or annual), date range, and source URL. The function downloads the data from a Google Sheets export link. It processes the raw data into a structured format, calculating additional financial metrics and filtering by the specified date range.

Usage

download_data_macro_predictors(
  dataset = NULL,
  start_date = NULL,
  end_date = NULL,
  type = deprecated(),
  sheet_id = "1bM7vCWd3WOt95Sf9qjLPZjoiafgF_8EG"
)

Arguments

dataset

The dataset to download ("monthly", "quarterly", "annual").

start_date

Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the data. If not provided, the full dataset is returned.

end_date

Optional. A character string or Date object in "YYYY-MM-DD" format specifying the end date for the data. If not provided, the full dataset is returned.

type

[Deprecated] Use dataset instead.

sheet_id

The Google Sheets ID from which to download the dataset, with the default "1bM7vCWd3WOt95Sf9qjLPZjoiafgF_8EG".

Value

A tibble with processed data, filtered by the specified date range and including financial metrics.

References

Welch, I., & Goyal, A. (2008). A comprehensive look at the empirical performance of equity premium prediction. Review of Financial Studies, 21(4), 1455-1508. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/rfs/hhm014")}

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_osap(), download_data_risk_free(), download_data_stock_prices(), download_factor_library_grid(), download_factor_library_ids()

Examples


  download_data_macro_predictors("monthly")
  download_data_macro_predictors("quarterly", "2000-01-01", "2020-12-31")



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