View source: R/download_data_jkp.R
| download_data_jkp | R Documentation |
Downloads and processes data from Global Factor Data, the public data library accompanying Jensen, Kelly, and Pedersen (2023). The data are stored as zipped CSV files (and a few plain CSV reference files) in a public AWS S3 bucket. For the factor, portfolio, and industry products the function validates the requested selection against the library's live availability manifest, then downloads the matching archive, unzips it, aligns monthly dates to the beginning of the month, and optionally filters by a date range.
download_data_jkp(
dataset = "factors",
region = "usa",
factors = "all_factors",
classification = "gics",
frequency = "monthly",
weighting = "vw_cap",
start_date = NULL,
end_date = NULL
)
dataset |
The Global Factor Data product to download, one of:
|
region |
A character string with the region or country to download,
using the codes from the availability manifest (e.g., |
factors |
A character string selecting the factor content for the
|
classification |
The industry classification for the |
frequency |
The data frequency, either |
weighting |
The portfolio weighting scheme: |
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. |
Returns are already expressed as plain numeric (decimal) values in the source data, so no rescaling is applied. The data are licensed under CC BY-NC 4.0 (non-commercial use).
A tibble with the processed data. The date column is aligned to
the beginning of the month for monthly data, and all returns are plain
numeric (decimal) values. The remaining columns depend on dataset: the
"factors" data carry location, name, freq, weighting,
direction, n_stocks, n_stocks_min, and ret; the "portfolios"
data add a pf portfolio identifier; the "industry" data carry the
classification code alongside ret; and the reference datasets carry
breakpoint or cutoff columns.
Jensen, T. I., Kelly, B. T., & Pedersen, L. H. (2023). Is there a replication crisis in finance? Journal of Finance, 78(5), 2465-2518. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/jofi.13249")}
Other download functions:
download_data(),
download_data_constituents(),
download_data_factors_ff(),
download_data_factors_q(),
download_data_fred(),
download_data_huggingface(),
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_jkp(
region = "usa", factors = "mkt",
start_date = "2000-01-01", end_date = "2020-12-31"
)
download_data_jkp(
dataset = "portfolios", region = "usa", factors = "be_me",
start_date = "2000-01-01", end_date = "2020-12-31"
)
download_data_jkp(
dataset = "industry", region = "usa", classification = "gics"
)
download_data_jkp(dataset = "nyse_cutoffs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.