View source: R/download_data_wrds_compustat.R
| download_data_wrds_compustat | R Documentation |
Downloads financial data from the WRDS Compustat database for a given dataset, start date, and end date. It filters the data according to industry format, data format, and consolidation level, and returns the most current data for each reporting period. Additionally, the annual data also includes the calculated book equity (be), operating profitability (op), and investment (inv) for each company following Fama & French (1993, 2015), as well as income before extraordinary items (ib).
download_data_wrds_compustat(
dataset = NULL,
start_date = NULL,
end_date = NULL,
type = deprecated(),
additional_columns = NULL,
only_usd = FALSE,
only_us = deprecated()
)
dataset |
The dataset to download ("compustat_annual" or "compustat_quarterly"). |
start_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the data. If not provided, a subset of the 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, a subset of the dataset is returned. |
type |
|
additional_columns |
Additional columns from the Compustat table as a character vector. |
only_usd |
A logical indicating whether only USD-denominated shares should be returned. |
only_us |
A data frame with financial data for the specified period, including variables for book equity (be), operating profitability (op), investment (inv), and others.
Fama, E. F., & French, K. R. (1993). Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33(1), 3-56. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0304-405X(93)90023-5")}
Fama, E. F., & French, K. R. (2015). A five-factor asset pricing model. Journal of Financial Economics, 116(1), 1-22. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jfineco.2014.10.010")}
Other WRDS functions:
disconnect_connection(),
download_data_wrds(),
download_data_wrds_ccm_links(),
download_data_wrds_crsp(),
download_data_wrds_fisd(),
download_data_wrds_trace_enhanced(),
get_wrds_connection(),
set_wrds_credentials()
## Not run:
download_data_wrds_compustat("compustat_annual", "2020-01-01", "2020-12-31")
download_data_wrds_compustat(
"compustat_quarterly",
"2020-01-01",
"2020-12-31"
)
# Add additional columns
download_data_wrds_compustat(
"compustat_annual",
additional_columns = c("aodo", "aldo")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.