View source: R/download_data_pseudo_crsp.R
| download_data_pseudo_crsp | R Documentation |
Returns pseudo CRSP data with the same column layout as
download_data_wrds_crsp(). Useful for testing and for reproducing the
workflow of analyses that rely on CRSP without a WRDS subscription. The
returned values are simulated and not suitable for inference.
download_data_pseudo_crsp(
dataset = NULL,
start_date = NULL,
end_date = NULL,
version = "v2",
additional_columns = NULL,
add_ccm_links = FALSE,
adjust_volume = FALSE,
batch_size = 500,
n_assets = 1000L,
seed = 1234L
)
dataset |
A string specifying the dataset to simulate. Supported:
|
start_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the pseudo panel. |
end_date |
Optional. A character string or Date object in "YYYY-MM-DD" format specifying the end date for the pseudo panel. |
version |
Accepted for API compatibility with
|
additional_columns |
Additional CRSP columns to include. Filled with
plausible random draws so call sites that pass |
add_ccm_links |
A logical indicating whether CRSP-Compustat links
should be appended. When |
adjust_volume |
Accepted for API compatibility with
|
batch_size |
Accepted for API compatibility with
|
n_assets |
Integer. Number of pseudo firms in the universe.
Defaults to |
seed |
Integer. Random seed; defaults to |
Both "crsp_monthly" and "crsp_daily" are supported. The daily panel
uses weekdays (Monday-Friday) only; weekend dates are excluded so the
pseudo calendar approximates a trading-day grid.
For "crsp_monthly", a tibble with columns permno, date,
calculation_date, ret, shrout, prc, primaryexch, siccd,
listing_age, mktcap, mktcap_lag, exchange, industry, and
ret_excess. For "crsp_daily", a tibble with columns permno, date,
ret, and ret_excess. If add_ccm_links = TRUE, a gvkey column is
appended.
Other pseudo functions:
download_data_pseudo_ccm_links(),
download_data_pseudo_compustat()
download_data_pseudo_crsp(
"crsp_monthly",
start_date = "2020-01-01",
end_date = "2024-12-31",
n_assets = 20
)
download_data_pseudo_crsp(
"crsp_daily",
start_date = "2020-01-01",
end_date = "2020-03-31",
n_assets = 20
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.