download_data_pseudo_compustat: Generate Pseudo Compustat Data

View source: R/download_data_pseudo_compustat.R

download_data_pseudo_compustatR Documentation

Generate Pseudo Compustat Data

Description

Returns pseudo Compustat data with the same column layout as download_data_wrds_compustat(). Useful for testing and for reproducing the workflow of analyses that rely on Compustat without a WRDS subscription. The returned values are simulated and not suitable for inference.

Usage

download_data_pseudo_compustat(
  dataset = NULL,
  start_date = NULL,
  end_date = NULL,
  additional_columns = NULL,
  only_usd = FALSE,
  n_assets = 1000L,
  seed = 1234L
)

Arguments

dataset

A string specifying the dataset to simulate. Supported: "compustat_annual" and "compustat_quarterly".

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.

additional_columns

Additional Compustat columns to include. Filled with plausible random draws so call sites that pass additional_columns continue to work; the values themselves are not economically meaningful.

only_usd

Accepted for API compatibility with download_data_wrds_compustat(); the pseudo universe is treated as USD-denominated, so this argument has no effect.

n_assets

Integer. Number of pseudo firms in the universe. Defaults to 1000.

seed

Integer. Random seed; defaults to 1234. Identical ⁠(seed, n_assets)⁠ produces identical output across calls and matches the identifier universe used by download_data_pseudo_crsp() and download_data_pseudo_ccm_links().

Details

Both "compustat_annual" and "compustat_quarterly" are supported.

Value

For "compustat_annual", a tibble with columns gvkey, date, datadate, the financial-statement variables seq, ceq, at, lt, txditc, txdb, itcb, pstkrv, pstkl, pstk, capx, oancf, sale, cogs, xint, xsga, ib, curcd, plus the derived be, op, at_lag, inv, and any requested additional_columns. For "compustat_quarterly", a tibble with columns gvkey, date, datadate, atq, ceqq, and any requested additional_columns.

See Also

Other pseudo functions: download_data_pseudo_ccm_links(), download_data_pseudo_crsp()

Examples

download_data_pseudo_compustat(
  "compustat_annual",
  start_date = "2020-01-01",
  end_date = "2024-12-31",
  n_assets = 20
)
download_data_pseudo_compustat(
  "compustat_quarterly",
  start_date = "2020-01-01",
  end_date = "2024-12-31",
  n_assets = 20
)

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