download_data_pastor_stambaugh: Download and Process Pastor-Stambaugh Liquidity Factors

View source: R/download_data_pastor_stambaugh.R

download_data_pastor_stambaughR Documentation

Download and Process Pastor-Stambaugh Liquidity Factors

Description

Downloads and processes the liquidity factor data of Pastor and Stambaugh (2003) from Pastor's data library. The source is a whitespace-delimited text file whose header lines start with a percent sign. The function reads the three liquidity series, aligns the monthly date to the beginning of the month, and optionally filters the data based on a provided date range.

Usage

download_data_pastor_stambaugh(
  start_date = NULL,
  end_date = NULL,
  url = paste0("https://faculty.chicagobooth.edu/-/media/faculty/lubos-pastor/data/",
    "liq_data_1962_2025.txt")
)

Arguments

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.

url

A character string with the URL of the liquidity data file. Because the file name embeds the last year of data, the default points to the most recent file known at release time; override it when a newer file becomes available.

Details

The series are already expressed as plain numeric (decimal) values in the source data, so no rescaling is applied. The traded liquidity factor is only available from 1968 onward; earlier observations are coded as -99 in the source file and are returned as NA.

Value

A tibble with the columns date (aligned to the beginning of the month), agg_liq (levels of aggregate liquidity), innov_liq (innovations in aggregate liquidity, the non-traded liquidity factor), and traded_liq (the traded liquidity factor LIQ_V), filtered by the specified date range if start_date and end_date are provided.

References

Pastor, L., & Stambaugh, R. F. (2003). Liquidity risk and expected stock returns. Journal of Political Economy, 111(3), 642-685. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1086/374184")}

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_risk_free(), download_data_stambaugh_yuan(), download_data_stock_prices(), download_factor_library_grid(), download_factor_library_ids()

Examples


  pastor_stambaugh <- download_data_pastor_stambaugh(
    start_date = "2020-01-01", end_date = "2020-12-31"
  )


tidyfinance documentation built on July 3, 2026, 1:09 a.m.