numeraire_dataset.zones.clean.compustat_quarterly_clean#
- numeraire_dataset.zones.clean.compustat_quarterly_clean(fundq: DataFrame, *, min_book_equity: float = 0.0, rdq_fallback_months: int = 4) DataFrame[source]#
Tidy quarterly Compustat: fresh-earnings ROE with an announcement-dated availability month.
Reproduces the Hou-Xue-Zhang ROE construction from the quarterly file:
roe_q= income before extraordinary items (ibq) over one-quarter-lagged book equity, where quarterly book equity = shareholders’ equity (seqq, elseceqq+pstkq, elseatq-ltq) + deferred taxes (txditcq) - preferred stock (pstkrq, elsepstkq). Rows whose lagged book equity is<= min_book_equityyield a missing ROE and are dropped.The point-in-time part is the availability month
avail_date: HXZ time ROE off the most recent public quarterly earnings announcement, Compustat itemrdq. We use the announcement date where present; whenrdqis missing we fall back todatadate + rdq_fallback_months(default 4 months — conservative relative to the ~2-month typical filing gap, so a missing announcement date never manufactures look-ahead).avail_dateis floored atdatadateso a stray earlyrdqcannot predate the fiscal quarter it reports. Both are month-end stamped; the downstream monthly panel maps each firm-month to its most recently available ROE.Output columns:
gvkey, datadate, rdq, roe_q, avail_date(one row per fiscal quarter).