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, else ceqq+pstkq, else atq-ltq) + deferred taxes (txditcq) - preferred stock (pstkrq, else pstkq). Rows whose lagged book equity is <= min_book_equity yield 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 item rdq. We use the announcement date where present; when rdq is missing we fall back to datadate + 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_date is floored at datadate so a stray early rdq cannot 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).