Repository Public Research preview
1"""r3k_20_tables_v2.py — FIRC-0002 v2.1: every LaTeX table of the manuscript + the number macros, generated from the v2 result2files (results/r3k_v2/*.json|csv, results/n1/, data/processed_r3k_v2/panel_meta_v2.json) and, for the BEFORE columns of the hygiene3table only, from the committed baseline results/r3k/*.json (HEAD 3cf7560, reproduced by the L0 baseline re-run).4Stage D (L10) wrote the first version; Stage E (Agent 9, exhibits director, 2026-11-05) rebuilt every table to the Part X.15standard: each file paper/tables/tab_*.tex is a SELF-CONTAINED FLOAT (\\ExhibitTable{label}{caption}{size}{threeparttable + notes}),6booktabs, consistent decimals, the inference procedure named in the notes, N / clusters / R^2 rows, an economic-magnitude line,7and a generated-by comment. \\ExhibitTable (defined at the top of paper/tables/macros.tex) emits the full float when the file is8\\input on its own and only the body when it is \\input from inside an existing \\begin{table} wrapper, so both conventions9compile. paper/tables/appendix_exhibits.tex (\\input from main.tex after the appendix) collects the appendix-bound and the10not-yet-placed exhibits behind \\ExhibitOnce guards: an exhibit already \\input earlier in the document is not printed twice.11Every printed number is read from one result field; nothing is typed. Every legacy macro name of r3k_07 keeps the same statistic12(rebuilt panel); the robust versions carry new names (…W, …CDA, …Ttw, …CI, …MDE, …Pwild). Also writes13results/r3k_v2/inline_numbers.json (macro -> value) and paper/tables/EXHIBIT_MAP.json (label, file, placement, sources).14Run from the worktree root: .venv-review/bin/python -I scripts/r3k_20_tables_v2.py15"""16import json, os, re, numpy as np, pandas as pd17V = "data/processed_r3k_v2"; T = "results/r3k_v2"; P = "paper/tables"; TB = "results/r3k"; SCRIPT = "scripts/r3k_20_tables_v2.py"18R = json.load(open(f"{T}/results.json")); R2 = json.load(open(f"{T}/results2.json")); RE = json.load(open(f"{T}/results_event.json")); RS = json.load(open(f"{T}/results_surv.json")); META = json.load(open(f"{V}/panel_meta_v2.json")); HY = json.load(open(f"{T}/hygiene_summary.json")); MD = json.load(open(f"{T}/mktcap_diag.json"))19T17 = json.load(open(f"{T}/t17_refit.json")) if os.path.exists(f"{T}/t17_refit.json") else None; N1 = json.load(open("results/n1/corpus_counts.json")) if os.path.exists("results/n1/corpus_counts.json") else None20RC = json.load(open(f"{T}/results_construct.json")) if os.path.exists(f"{T}/results_construct.json") else None21TA = json.load(open("results/n1/tokenizer_audit.json")) if os.path.exists("results/n1/tokenizer_audit.json") else None22KB = json.load(open("results/n1/keyword_baseline.json")) if os.path.exists("results/n1/keyword_baseline.json") else None23AA = json.load(open("results/n1/alt_anchor_results.json")) if os.path.exists("results/n1/alt_anchor_results.json") else None24RB = json.load(open(f"{TB}/results.json")) if os.path.exists(f"{TB}/results.json") else None; RB2 = json.load(open(f"{TB}/results2.json")) if os.path.exists(f"{TB}/results2.json") else None; RBE = json.load(open(f"{TB}/results_event.json")) if os.path.exists(f"{TB}/results_event.json") else None25BASELINE = "3cf7560"26df = pd.read_parquet(f"{V}/analysis_panel_v2.parquet")27# ---------------------------------------------------------------- formatting helpers (one convention per quantity) ----28def n(x, d=0): return "--" if x is None else f"{float(x):,.{d}f}".replace(",", "{,}")29def pp(x, d=1): return "--" if x is None or (isinstance(x, float) and np.isnan(x)) else f"{x * 100:+.{d}f}" # fraction -> signed pp30def f1(x): return "--" if x is None or (isinstance(x, float) and np.isnan(x)) else f"{x:+.1f}" # already in pp, 1 dec31def f2(x): return "--" if x is None or (isinstance(x, float) and np.isnan(x)) else f"{x:+.2f}" # already in pp, 2 dec32def tv(t): return "--" if t is None or (isinstance(t, float) and np.isnan(t)) else f"{t:.2f}" # t-statistics, 2 dec33def ci(c, d=1, scale=100): return "--" if not c or c[0] is None else f"[{c[0] * scale:+.{d}f}, {c[1] * scale:+.{d}f}]" # fraction CI34def cip(c, d=1): return "--" if not c or c[0] is None else f"[{c[0]:+.{d}f}, {c[1]:+.{d}f}]" # CI already in pp35def pv(p): return "--" if p is None or (isinstance(p, float) and np.isnan(p)) else f"{p:.3f}"36def pct(x, d=1): return "--" if x is None else f"{x * 100:.{d}f}\\%"37def br(t): return "--" if t is None or (isinstance(t, float) and np.isnan(t)) else f"[{t:.2f}]" # t in brackets38def tex(s): return str(s).replace("&", "\\&").replace("%", "\\%").replace("_", "\\_")39def ordinal(x):40 """Rank -> '4th', '21st', '63rd', '11th' (Stage F, NB-4: the suffix is emitted with the rank so the two cannot diverge)."""41 k = int(x); return f"{k}{'th' if 10 <= k % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(k % 10, 'th')}"42MAC = {}; EXHIBITS = []43TABLE_NOTE_SE = ("Inference: NW $t$ = Newey--West (Bartlett kernel, 3 lags) $t$-statistic of the mean of the annual cohort series; plain $t$ = i.i.d. $t$ over cohorts; "44 "95\\% CI = $t$-interval over cohorts (the post period has 3 cohorts, so its CIs are wide by construction). Returns are the look-ahead-free twelve-month forward returns "45 "(July $Y{+}1$--June $Y{+}2$); `wins.' = 1/99 winsorized within the formation year; `median' = median spread within cohort; `raw' = unwinsorized. "46 f"Rebuilt panel: $N$ = {n(R['n_obs'])} firm-years, {n(R['n_firms'])} firms, keyed on CIK $\\times$ year, cleaned returns, corrected market capitalization. No significance stars are used.")47def H(cell, maxlen=15):48 """Break a long header cell into two lines (\\makecell) at the space nearest the middle, never inside $...$."""49 c = cell.strip()50 if "\\multicolumn" in c or "\\cmidrule" in c or "\\makecell" in c or len(re.sub(r"\\[a-zA-Z]+|[{}$]", "", c)) <= maxlen: return c51 depth = 0; cands = []52 for i, ch in enumerate(c):53 if ch == "$": depth ^= 154 elif ch == " " and depth == 0: cands.append(i)55 if not cands: return c56 k = min(cands, key=lambda i: abs(i - len(c) / 2)); return f"\\makecell[b]{{{c[:k]} \\\\ {{{c[k + 1:]}}}}}"57def table(name, label, title, caption, colspec, header, body, notes, size="\\footnotesize", colsep="4pt", placement="main", sources="", notesize=None):58 """Write paper/tables/<name>.tex as a self-contained float. header = list of header-row strings (without the final \\\\); long header cells are wrapped on two lines."""59 header = [" & ".join(H(c) for c in h.split(" & ")) if "\\cmidrule" not in h else h for h in header]60 notesize = notesize or ("\\scriptsize" if size == "\\scriptsize" else "\\footnotesize")61 hdr = "".join(h + " \\\\\n" for h in header); mid = "\\midrule\n" if header else ""62 pre = (f"\\setlength{{\\tabcolsep}}{{{colsep}}}" if colsep else "")63 out = (f"% Generated by {SCRIPT} from {sources or 'results/r3k_v2/'} -- do not edit by hand (FIRC-0002 v2.1, Stage E exhibits).\n"64 f"% Placement decided at Stage E: {placement}. \\input{{tables/{name}}} on its own prints the whole float; inside an existing float wrapper only the body is printed.\n"65 f"\\ExhibitTable{{{label}}}{{\\textbf{{{title}}} {caption}}}{{{size}}}{{%\n\\begin{{threeparttable}}{pre}\n\\begin{{tabular}}{{{colspec}}}\n\\toprule\n{hdr}{mid}{body}\\bottomrule\n\\end{{tabular}}\n"66 f"\\begin{{tablenotes}}[flushleft]{notesize}\n\\item \\emph{{Notes:}} {notes}\n\\end{{tablenotes}}\n\\end{{threeparttable}}}}\n")67 open(f"{P}/{name}.tex", "w").write(out); EXHIBITS.append({"kind": "table", "file": f"paper/tables/{name}.tex", "label": label, "title": title, "placement": placement, "script": SCRIPT, "sources": sources}); print("table", name, placement)68def panel(ncol, text): return f"\\multicolumn{{{ncol}}}{{@{{}}l}}{{\\textit{{{text}}}}} \\\\\n"69NOBS, NFIRMS = n(R["n_obs"]), n(R["n_firms"]); YRS = str(R["yrs"]).replace("-", "--")70def pcell(k, frac, text): return f"\\multicolumn{{{k}}}{{>{{\\raggedright\\arraybackslash}}p{{{frac}\\textwidth}}}}{{{text}}}"71# ================================================================ T2 summary statistics (main) ====72s = pd.read_csv(f"{T}/t1_summary_stats.csv", index_col=0)73lab = {"ai_adoption_wmean": ("AI adoption score (section-weighted cosine)", 4), "ai_infrastructure_wmean": ("AI infrastructure score", 4), "ai_disruption_risk_wmean": ("AI disruption-risk score", 4), "spid_mentions_tech": ("SPID technology-project mentions (count)", 2), "spid_ai_any": ("Any AI-initiative mention (0/1)", 3), "fwd_ret": ("Forward 12-month return, raw (fraction)", 3), "fwd_w": ("Forward 12-month return, wins. within year", 3), "fwd_ret_mktadj": ("Forward return minus SPY (fraction)", 3), "mom_12m": ("Momentum, 12 months (fraction)", 3), "vol_12m": ("Volatility, 12 months, annualized", 3), "log_mktcap": ("log market capitalization (corrected, USD)", 2), "total_chunks": ("Text chunks per firm-year (count)", 0)}74body = ""75for k, (l, d) in lab.items():76 r = s.loc[k]; body += f"{l} & {n(r['count'])} & {r['mean']:.{d}f} & {r['std']:.{d}f} & {r['min']:.{d}f} & {r['1%']:.{d}f} & {r['50%']:.{d}f} & {r['99%']:.{d}f} & {r['max']:.{d}f} \\\\\n"77# Stage F (NB-11): the Max column's extreme market-adjusted forward return is named (firm, formation year, holding window, second-source verdict).78_mx = df.loc[df.fwd_ret_mktadj.idxmax()]; _hl0 = pd.read_csv(f"{T}/hygiene_log.csv"); _hr = _hl0[(_hl0.kind == "firm_year_fwd") & (_hl0.ticker == _mx.ticker) & (_hl0.fiscal_year == _mx.fiscal_year)]79assert len(_hr) == 1, ("maximum forward return without a hygiene verdict", _mx.ticker, _mx.fiscal_year); _hr = _hr.iloc[0]80_mxpct = f"{_mx.fwd_ret_mktadj * 100:+,.0f}".replace(",", "{,}")81MAXRET_NOTE = (f"The maximum of the market-adjusted forward return ({_mx.fwd_ret_mktadj:.2f}, i.e.\\ {_mxpct}\\%) is {tex(_mx.ticker)} in formation year {int(_mx.fiscal_year)} (holding window {_hr.date.replace('..', ' to ')})"82 + (", also the maximum of the raw return" if df.fwd_ret.idxmax() == df.fwd_ret_mktadj.idxmax() else "") + f"; its second-source verdict is `{_hr.verdict.replace('_', ' ')}' (FinData OS daily bars, {tex(_hr.note).replace('->', '$\\to$')}). ")83MAC["maxMadjRetTicker"] = tex(_mx.ticker); MAC["maxMadjRetYear"] = str(int(_mx.fiscal_year)); MAC["maxMadjRetPct"] = _mxpct84table("tab_summary", "tab:summ", "Summary statistics of the estimation sample.",85 f"Firm-years with a valid twelve-month forward return, formation cohorts {YRS} ($N$ = {NOBS} firm-years, {NFIRMS} firms; iShares Russell~3000 holdings of October 2026 plus the S\\&P~500). Semantic scores are section-weighted mean cosine similarities of the firm-year's filing chunks to the anchor concept; returns are simple buy-and-hold fractions.",86 "lrrrrrrrr", ["Variable & $N$ & Mean & SD & Min & P1 & Median & P99 & Max"], body,87 f"Market capitalization = unadjusted FinData OS close $\\times$ point-in-time SEC cover-page shares (log range [{MD['log_cap_min_max_v2'][0]:.1f}, {MD['log_cap_min_max_v2'][1]:.1f}]); {n(META['n_est_without_cap'])} firm-years ({MD['share_est_without_cap_v2'] * 100:.1f}\\%) have no capitalization and enter the equal-weighted sorts only (the committed v2.0 panel had {n(META['n_est_without_cap_v1'])}). "88 f"Return hygiene: {HY['n_flagged_monthly']} monthly returns above 300\\% and {HY['n_flagged_firm_years']} firm-year forward returns above 500\\% were checked against FinData OS daily bars; {HY['verdicts_monthly'].get('series_break', 0)} monthly and {HY['verdicts_firm_year'].get('series_break', 0)} firm-year observations were price splices and are set to missing (Table~\\ref{{tab:hygiene}}), the others are confirmed. "89 f"The winsorized return is the dependent variable of every regression and of the headline sorts; the raw return is reported beside it. " + MAXRET_NOTE + f"Source: data/processed\\_r3k\\_v2/analysis\\_panel\\_v2.parquet, results/r3k\\_v2/t1\\_summary\\_stats.csv, hygiene\\_log.csv.",90 size="\\scriptsize", placement="main", sources="results/r3k_v2/t1_summary_stats.csv, panel_meta_v2.json, mktcap_diag.json, hygiene_summary.json")91# ================================================================ T5 quintile sorts, both universes (main) ====92SIGL = [("AI_ADOPT", "AI adoption"), ("AI_INFRA", "AI infrastructure"), ("AI_RISK", "AI disruption risk"), ("AI_COMPOS", "AI composite"), ("AI_PC1", "PC1 of three facets"), ("AI_formw", "Equal-form composite"), ("AI_10k", "10-K composite"), ("SPID_TECH", "SPID projects (legacy quintiles)")]93WL = {"EW_w": "EW, wins.", "EW": "EW, raw", "EW_med": "EW, median", "VW_w": "VW, wins.", "VW": "VW, raw", "VWcap10_w": "VW, 10\\% cap, wins.", "VWcap10": "VW, 10\\% cap, raw"}94def sort_row(S, k, l, sfx, first):95 key = f"{k}_{sfx}"96 if key not in S: return ""97 r = S[key]; return f"{l if first else ''} & {WL[sfx]} & " + " & ".join(pp(r[f"Q{q}"]) for q in range(1, 6)) + f" & {pp(r['Q5_minus_Q1'])} & {tv(r['t_stat'])} & {tv(r['t_plain'])} & {ci(r['ci95'])} \\\\\n"98HDR5 = ["Signal & Portfolio & Q1 (low) & Q2 & Q3 & Q4 & Q5 (high) & Q5$-$Q1 & NW $t$ & plain $t$ & 95\\% CI"]99body = ""100for sname, lab_ in [("r3k", "Panel A: Russell 3000 universe"), ("sp500", "Panel B: S\\&P 500 members only")]:101 SM = R["samples"][sname]; body += panel(11, f"{lab_} ($N$ = {n(SM['n'])} firm-years, {n(SM['firms'])} firms; {SM['sorts']['AI_COMPOS_EW_w']['n_years']} cohorts)")102 for k, l in SIGL[:5]:103 rows = ["EW_w", "EW", "EW_med", "VW_w"] if k == "AI_COMPOS" else ["EW_w", "VW_w"]104 for i, sfx in enumerate(rows): body += sort_row(SM["sorts"], k, l, sfx, i == 0)105 if sname == "r3k": body += "\\midrule\n"106VD = R["vw_diag"]107# Stage F (NB-1): results.json vw_diag mixes two universes -- max_single_firm_weight_v2 / n_cells_above_25pct_v2 are taken over EVERY108# full-sample VW sort of the nine signals (r3k_15 regex "_VW$|_VW_w$", raw and winsorized variants counted separately), while109# worst_cells_v2 is the composite sort alone. Both statistics are made explicit here from results/r3k_v2/vw_weights_diag.csv (written by110# r3k_15 beside results.json), the worst cell of each universe is named, and the all-sorts figures are asserted equal to vw_diag.111vwd_ = pd.read_csv(f"{T}/vw_weights_diag.csv"); SIGNAME_VW = {"AI_ADOPT": "AI adoption", "AI_INFRA": "AI infrastructure", "AI_RISK": "AI disruption risk", "AI_COMPOS": "AI composite", "AI_PC1": "PC1", "AI_formw": "equal-form composite", "AI_10k": "10-K composite", "SPID_TECH": "SPID technology", "CYBER": "cybersecurity placebo"}112def _vw_universe(suffix_re, prefix_ok=("r3k_", "sp500_")): return vwd_[vwd_["sort"].str.contains(suffix_re, regex=True) & ~vwd_["sort"].str.startswith(prefix_ok)]113def _vw_stats(d):114 w = d.loc[d.max_weight.idxmax()]; base = re.sub(r"_VW(_v1)?(_w)?$", "", w["sort"]); above = d[d.max_weight > 0.25]115 return {"max": float(w.max_weight), "sort": SIGNAME_VW.get(base, base), "ticker": str(w.max_ticker), "cohort": int(w.cohort), "q": int(w.q), "n_above": int(len(above)), "sorts_above": sorted({SIGNAME_VW.get(re.sub(r"_VW(_v1)?(_w)?$", "", x), x) for x in above["sort"]}), "n_above_distinct": int(above.assign(base=above["sort"].str.replace(r"_w$", "", regex=True)).drop_duplicates(["base", "cohort", "q"]).shape[0])}116VWALL = _vw_stats(_vw_universe("_VW$|_VW_w$")); VWCOMP = _vw_stats(vwd_[vwd_["sort"] == "AI_COMPOS_VW"]); VWALL1 = _vw_stats(_vw_universe("_VW_v1$|_VW_v1_w$")); VWCOMP1 = _vw_stats(vwd_[vwd_["sort"] == "AI_COMPOS_VW_v1"])117assert abs(VWALL["max"] - VD["max_single_firm_weight_v2"]) < 1e-6 and VWALL["n_above"] == VD["n_cells_above_25pct_v2"], ("vw_weights_diag.csv and results.json vw_diag disagree", VWALL, VD)118assert abs(VWALL1["max"] - VD["max_single_firm_weight_v1"]) < 1e-6 and VWALL1["n_above"] == VD["n_cells_above_25pct_v1"], ("v1 universe", VWALL1, VD)119def vwcell(x): return f"{x['ticker']}, {x['cohort']} cohort, quintile {x['q']}"120VW_NOTE = (f"VW diagnostic (single-firm weight in a cohort $\\times$ quintile cell): in the composite sort's own cells the maximum is {VWCOMP['max'] * 100:.0f}\\% ({vwcell(VWCOMP)}) and "121 f"{'no cell exceeds' if VWCOMP['n_above'] == 0 else str(VWCOMP['n_above']) + ' cells exceed'} 25\\%; across all nine full-sample VW sorts of Table~\\ref{{tab:sorts}} the maximum is {VWALL['max'] * 100:.0f}\\% "122 f"({VWALL['sort']} sort: {vwcell(VWALL)}) and {VWALL['n_above']} entries exceed 25\\% ({VWALL['n_above_distinct']} distinct cells, each counted once for the raw and once for the winsorized return variant); "123 f"committed v2.0 capitalization: {VD['max_single_firm_weight_v1'] * 100:.1f}\\% and {VD['n_cells_above_25pct_v1']} entries ({VWALL1['n_above_distinct']} distinct cells)")124table("tab_sorts_both", "tab:sortsboth", "Quintile sorts on AI language in the Russell~3000 universe and among S\\&P~500 members.",125 f"Mean forward twelve-month return (percent per year) of the within-cohort quintiles of each signal, averaged over the {R['sorts']['AI_COMPOS_EW_w']['n_years']} formation cohorts {YRS}, with the Q5$-$Q1 spread (percentage points), its Newey--West and i.i.d.\\ $t$-statistics and the 95\\% confidence interval over cohorts. EW = equal-weighted; VW = value-weighted on the corrected capitalization. The headline row of each signal is the within-year winsorized return; for the composite the raw and median versions show the sensitivity of the sort to the return tail.",126 "llrrrrrrrrr", HDR5, body,127 TABLE_NOTE_SE + f" Signals are standardized within year and within panel. Economic magnitude: the composite EW wins.\\ spread of {pp(R['samples']['r3k']['sorts']['AI_COMPOS_EW_w']['Q5_minus_Q1'])} pp per year compares with a Q1 mean of {pp(R['samples']['r3k']['sorts']['AI_COMPOS_EW_w']['Q1'])}\\% per year; the top 1\\% of returns contribute {pp(R['sorts']['AI_COMPOS_EW']['top1pct_contribution'])} pp of the raw spread. "128 + VW_NOTE + f"; the 10\\%-capped VW composite spread is {pp(R['sorts']['AI_COMPOS_VWcap10_w']['Q5_minus_Q1'])} pp (NW $t$ {tv(R['sorts']['AI_COMPOS_VWcap10_w']['t_stat'])}). "129 f"Romano--Wolf adjusted $p$ of the composite EW wins.\\ spread within the ten-member family of this table: {dict(zip(R2['mht']['sorts_full_w']['members'], R2['mht']['sorts_full_w']['p_romano_wolf']))['AI_COMPOS_EW']:.2f} (Table~\\ref{{tab:mht}}). All signals and weightings: Table~\\ref{{tab:sorts}}.",130 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.sorts, vw_diag), results2.json (mht)")131# ================================================================ appendix: full sorts (all signals / weightings, Russell 3000) ====132body = ""133for k, l in SIGL:134 for i, sfx in enumerate(["EW_w", "EW", "EW_med", "VW_w", "VWcap10_w"]): body += sort_row(R["sorts"], k, l, sfx, i == 0)135 body += "\\addlinespace\n"136table("tab_sorts", "tab:sorts", "Quintile sorts on every signal and weighting, Russell~3000 universe.",137 f"Companion to Table~\\ref{{tab:sortsboth}}: mean forward twelve-month return (percent per year) by within-cohort quintile for all eight signals, equal-weighted (winsorized, raw, median) and value-weighted on the corrected capitalization (unrestricted and with single-firm weights capped at 10\\%), averaged over the {R['sorts']['AI_COMPOS_EW']['n_years']} cohorts {YRS} ($N$ = {NOBS} firm-years).",138 "llrrrrrrrrr", HDR5, body,139 TABLE_NOTE_SE + f" The SPID legacy quintiles sort a variable whose median and 75th percentile are both zero, so quintiles 1--4 are tie-broken by row order (Table~\\ref{{tab:spidbinary}} reports the binary contrasts and their minimum detectable effects instead). VW weights use the corrected capitalization (unadjusted close $\\times$ point-in-time shares). Maximum single-firm weight in a cohort $\\times$ quintile cell: {VWALL['max'] * 100:.0f}\\% across the nine VW sorts of this table ({VWALL['sort']} sort: {vwcell(VWALL)}; {VWALL['n_above_distinct']} distinct cells above 25\\%, all in the {' and '.join(VWALL['sorts_above'])} sorts) and {VWCOMP['max'] * 100:.0f}\\% in the composite sort ({vwcell(VWCOMP)}; {'no cell' if VWCOMP['n_above'] == 0 else str(VWCOMP['n_above']) + ' cells'} above 25\\%).",140 size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results.json (sorts, vw_diag)")141# ================================================================ T6 monthly long-short alphas, both universes (main) ====142body = ""143for k, l in SIGL[:5]:144 for sname, sl in [("r3k", "Russell 3000"), ("sp500", "S\\&P 500")]:145 f_ = R["samples"][sname]["ls"][k]["full"]; p_ = R["samples"][sname]["ls"][k]["post"]146 body += f"{l if sname == 'r3k' else ''} & {sl} & {f_['n_months']} & {f_['mean_ls_ann_pct']:+.2f} & {br(f_['hac_t'])} & {f_['sharpe']:.2f} & {f_['ff6_alpha_ann_pct']:+.2f} & {br(f_['ff6_alpha_t'])} & {p_.get('n_months', 0)} & {f2(p_.get('ff6_alpha_ann_pct'))} & {br(p_.get('ff6_alpha_t'))} \\\\\n"147 body += "\\addlinespace\n"148DS = R2["mht"]["deflated_sharpe"]149table("tab_alpha_both", "tab:alphaboth", "Monthly long--short portfolios on AI language: mean return, Sharpe ratio and factor alphas.",150 "Equal-weighted Q5$-$Q1 portfolios selected every June from the cohort quintiles and held July--June (monthly returns, annualized). Mean and alphas in percent per year; $t$-statistics in brackets use Newey--West (HAC, 3 lags) standard errors. FF6 = Fama--French five factors plus momentum (Ken French daily factors aggregated to months). Post = months from July 2023, the first holding year that follows the ChatGPT launch cohort.",151 "llrrrrrrrrr", ["Signal & Universe & Months & Mean (\\%/yr) & [HAC $t$] & Sharpe & FF6 $\\alpha$ (\\%/yr) & [$t$] & Post months & Post FF6 $\\alpha$ & [$t$]"], body,152 f"Deflated Sharpe ratio of the Russell~3000 composite long--short (Bailey and L\\'opez de Prado 2014; trials = {DS['n_trials']} long--short series tried in this study, benchmark SR {DS['full']['sr0_ann']:.2f}): full sample {DS['full']['dsr_prob']:.2f}, pre {DS['pre']['dsr_prob']:.2f}, post {DS['post']['dsr_prob']:.2f} (probability that the true Sharpe ratio exceeds the multiple-testing hurdle; values below 0.95 do not clear it). "153 f"Economic magnitude: the composite earns {R['samples']['r3k']['ls']['AI_COMPOS']['full']['mean_ls_ann_pct']:+.2f}\\% per year over {R['samples']['r3k']['ls']['AI_COMPOS']['full']['n_months']} months in the Russell~3000, a Sharpe ratio of {R['samples']['r3k']['ls']['AI_COMPOS']['full']['sharpe']:.2f}. Splice months (Table~\\ref{{tab:hygiene}}) are set to missing. All signals and sub-periods: Table~\\ref{{tab:alpha}}.",154 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.ls), results2.json (mht.deflated_sharpe)")155# ================================================================ appendix: full alphas ====156body = ""157for k, l in [("AI_COMPOS", "AI composite"), ("AI_ADOPT", "AI adoption"), ("AI_INFRA", "AI infrastructure"), ("AI_RISK", "AI disruption risk"), ("AI_PC1", "PC1"), ("AI_formw", "Equal-form composite"), ("AI_10k", "10-K composite"), ("SPID_TECH", "SPID tech projects"), ("CYBER", "Cybersecurity (placebo)")]:158 L = R["ls_alpha"].get(k)159 if not L: continue160 for per in ["full", "pre", "post"]:161 r = L[per]162 if "mean_ls_ann_pct" not in r: body += f"{l if per == 'full' else ''} & {per} & {r.get('n_months', 0)} & \\multicolumn{{7}}{{l}}{{too few months}} \\\\\n"; continue163 body += f"{l if per == 'full' else ''} & {per} & {r['n_months']} & {r['mean_ls_ann_pct']:+.2f} & {br(r['hac_t'])} & {br(r['plain_t'])} & {r['sharpe']:.2f} & {r['capm_alpha_ann_pct']:+.2f} & {r['ff6_alpha_ann_pct']:+.2f} & {br(r['ff6_alpha_t'])} \\\\\n"164 body += "\\addlinespace\n"165table("tab_alpha", "tab:alpha", "Monthly long--short portfolios by signal and sub-period, Russell~3000 universe.",166 "Companion to Table~\\ref{tab:alphaboth}: equal-weighted Q5$-$Q1 monthly portfolios (annually selected in June, held July--June) for every signal, over the full sample, the pre-launch months (to June 2023) and the post-launch months (from July 2023). Mean and alphas in percent per year.",167 "llrrrrrrrr", ["Signal & Period & Months & Mean (\\%/yr) & [HAC $t$] & [plain $t$] & Sharpe & CAPM $\\alpha$ (\\%/yr) & FF6 $\\alpha$ (\\%/yr) & [$t$]"], body,168 "HAC = Newey--West (3 lags); plain = i.i.d. The post period has 36 months, so its alphas are imprecise; the AI disruption-risk facet is the only signal whose post FF6 alpha has $|t| > 2$ (Table~\\ref{tab:robust}). Factor data: Ken French daily FF5 + momentum, compounded to months. Splice months set to missing.",169 size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results.json (ls_alpha)")170# ================================================================ T8 two-way FE panel (main) ====171PF = R["panel_fe"]; vl = {"z_AI_ADOPT": "AI adoption ($z$)", "z_AI_INFRA": "AI infrastructure ($z$)", "z_AI_RISK": "AI disruption risk ($z$)", "z_AI_COMPOS": "AI composite ($z$)", "z_SPID_TECH": "SPID tech projects ($z$)", "z_size": "Size ($z$, log cap)", "z_mom": "Momentum ($z$)", "z_vol": "Volatility ($z$)"}172specs = list(PF); body = ""173for v in vl:174 if not any(v in PF[s_]["coefs"] for s_ in specs): continue175 body += vl[v] + " & " + " & ".join(f"{PF[s_]['coefs'][v]['coef'] * 100:+.2f}" if v in PF[s_]["coefs"] else "" for s_ in specs) + " \\\\\n & " + " & ".join(br(PF[s_]["coefs"][v]["t"]) if v in PF[s_]["coefs"] else "" for s_ in specs) + " \\\\\n"176nfirms_fe = df.dropna(subset=["fwd_w"]).cik.nunique(); nyears_fe = df.fiscal_year.nunique()177body += "\\midrule\nFirm fixed effects & " + " & ".join("Yes" for _ in specs) + " \\\\\nYear fixed effects & " + " & ".join("Yes" for _ in specs) + " \\\\\nObservations & " + " & ".join(n(PF[s_]["n"]) for s_ in specs) + " \\\\\nClusters (firms / years) & " + " & ".join(f"{n(nfirms_fe)} / {nyears_fe}" for _ in specs) + " \\\\\nWithin $R^2$ & " + " & ".join(f"{PF[s_]['r2_within']:.4f}" for s_ in specs) + " \\\\\n"178table("tab_panel", "tab:panel", "Two-way fixed-effects panel regressions of the forward return on AI language, Russell~3000.",179 "Dependent variable: forward twelve-month return winsorized at 1/99 within the formation year (percentage points). Regressors are standardized within year, so a coefficient is the change in the forward return (pp) for a one-standard-deviation change in the signal relative to same-year peers. Firm and year fixed effects in every column; $t$-statistics in brackets from standard errors clustered two-way by firm and year.",180 "l" + "r" * len(specs), [" & " + " & ".join(f"({i + 1})" for i in range(len(specs)))], body,181 f"Columns: (1) adoption alone; (2)--(4) one facet with size, momentum and volatility; (5) three facets jointly; (6) SPID projects; (7) all signals; (8) composite alone. Within-firm identification removes the firm's average AI language, so the coefficients measure the return response to within-firm changes in language, which the Fama--MacBeth cross-sectional slopes of Table~\\ref{{tab:fmboth}} do not. Economic magnitude: column (7) composite = {PF['M7_all_spid']['coefs']['z_AI_COMPOS']['coef'] * 100:+.2f} pp per SD against a sample mean forward return of {pp(s.loc['fwd_w', 'mean'])}\\%. Controls winsorized within year; the size control uses the corrected capitalization. Source: results/r3k\\_v2/results.json (panel\\_fe), linearmodels PanelOLS.",182 size="\\scriptsize", placement="main", sources="results/r3k_v2/results.json (panel_fe)")183# ================================================================ T7 Fama-MacBeth, both universes (main) ====184FM = R["fama_macbeth"]; FB = FM["compos"]["z_AI_COMPOS"]["fixed_b_cv05"]185body = ""186for spec, v, l in [("compos", "zz_AI_COMPOS", "AI composite"), ("all", "zz_AI_ADOPT", "AI adoption (joint)"), ("all", "zz_AI_INFRA", "AI infrastructure (joint)"), ("all", "zz_AI_RISK", "AI disruption risk (joint)"), ("pc1", "zz_AI_PC1", "PC1 of three facets"), ("formw", "zz_AI_formw", "Equal-form composite"), ("spid", "zz_SPID_TECH", "SPID tech projects"), ("compos", "zz_size", "Size (log cap)"), ("compos", "zz_mom", "Momentum"), ("compos", "zz_vol", "Volatility")]:187 for sfx, rl in [("_w", "wins."), ("", "raw")]:188 a = R["samples"]["r3k"]["fm"][spec + sfx][v]; b = R["samples"]["sp500"]["fm"][spec + sfx][v]189 body += f"{l if sfx == '_w' else ''} & {rl} & {a['mean_coef'] * 100:+.2f} & {br(a['t'])} & {br(a['t_plain'])} & {ci(a['ci95'], 2)} & {b['mean_coef'] * 100:+.2f} & {br(b['t'])} & {ci(b['ci95'], 2)} \\\\\n"190 body += "\\addlinespace\n"191body += f"\\midrule\nCohorts (annual regressions) & & {FM['compos']['n_years']} & & & & {FM['compos']['n_years']} & & \\\\\nMean firms per cross-section & & {n(FM['compos']['n_mean_per_year'])} & & & & {n(R['samples']['sp500']['n'] / FM['compos']['n_years'])} & & \\\\\n"192table("tab_fm_both", "tab:fmboth", "Fama--MacBeth regressions of the forward return on AI language, Russell~3000 and S\\&P~500.",193 f"Time-series average of {FM['compos']['n_years']} annual cross-sectional slopes of the forward twelve-month return on the standardized signal with size, momentum and volatility controls, in percentage points per standard deviation. The headline row of each regressor uses the within-year winsorized return; the raw row shows the tail sensitivity. $t$-statistics in brackets: NW = Newey--West (3 lags) on the series of annual slopes, plain = i.i.d.; the 95\\% CI is the $t$-interval over the annual slopes.",194 "llrrrrrrr", ["Regressor & Returns & \\multicolumn{4}{c}{Russell 3000} & \\multicolumn{3}{c}{S\\&P 500 members}", "\\cmidrule(lr){3-6}\\cmidrule(lr){7-9} & & Slope (pp/SD) & [NW $t$] & [plain $t$] & 95\\% CI & Slope (pp/SD) & [NW $t$] & 95\\% CI"], body,195 f"Joint = the three facets enter one regression. The Kiefer--Vogelsang fixed-$b$ 5\\% critical value for a Newey--West $t$ with 3 Bartlett lags and $T$ = {FM['compos']['n_years']} is {FB:.2f} (simulated), so NW $t$-statistics between 1.96 and {FB:.2f} are not significant at 5\\% under fixed-$b$ asymptotics; the plain $t$ is the conservative reference. Economic magnitude: the Russell~3000 composite slope of {R['samples']['r3k']['fm']['compos_w']['zz_AI_COMPOS']['mean_coef'] * 100:+.2f} pp per SD implies a {R['samples']['r3k']['fm']['compos_w']['zz_AI_COMPOS']['mean_coef'] * 100 * 2:+.1f} pp difference between firms one SD above and one SD below their same-year peers. Signals re-standardized within each panel (`zz'); all controls standardized within year, size from the within-year winsorized corrected log capitalization. Year-by-year slopes: Figure~\\ref{{fig:fmyear}}; all specifications: Table~\\ref{{tab:fm}}.",196 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.fm, fama_macbeth)")197# ================================================================ appendix: full FM ====198def fm_cell(blk, v): c = blk[v]; return f"{c['mean_coef'] * 100:+.2f} & {br(c['t'])} & {br(c['t_plain'])} & {ci(c['ci95'], 2)}"199body = ""200for spec, v, l in [("compos", "z_AI_COMPOS", "AI composite"), ("all", "z_AI_ADOPT", "AI adoption (joint)"), ("all", "z_AI_INFRA", "AI infrastructure (joint)"), ("all", "z_AI_RISK", "AI disruption risk (joint)"), ("risk", "z_AI_RISK", "AI disruption risk (alone)"), ("pc1", "z_AI_PC1", "PC1 of three facets"), ("formw", "z_AI_formw", "Equal-form composite"), ("tenk", "z_AI_10k", "10-K composite"), ("spid", "z_SPID_TECH", "SPID tech projects ($z$)"), ("spid_any_ai", "spid_ai_any", "Any AI project (0/1, pp)"), ("compos_cyber", "z_CYBER", "Cybersecurity ($z$, with composite)"), ("compos", "z_size", "Size"), ("compos", "z_mom", "Momentum"), ("compos", "z_vol", "Volatility")]:201 for sfx, rl in [("_w", "wins."), ("", "raw")]:202 if spec + sfx in FM and v in FM[spec + sfx]: body += f"{l if sfx == '_w' else ''} & {rl} & {fm_cell(FM[spec + sfx], v)} \\\\\n"203 body += "\\addlinespace\n"204body += f"\\midrule\nCohorts & & {FM['compos']['n_years']} & \\multicolumn{{3}}{{l}}{{mean cross-section {n(FM['compos']['n_mean_per_year'])} firms}} \\\\\n"205table("tab_fm", "tab:fm", "Fama--MacBeth regressions, all specifications, Russell~3000 universe.",206 f"Companion to Table~\\ref{{tab:fmboth}}: time-series mean of the {FM['compos']['n_years']} annual cross-sectional slopes (pp per SD, or pp per unit for the 0/1 indicator) of the forward return on each signal with size, momentum and volatility controls, for the within-year winsorized and the raw return.",207 "llrrrr", ["Regressor & Returns & Slope (pp/SD) & [NW $t$] & [plain $t$] & 95\\% CI"], body,208 f"NW $t$ uses 3 Bartlett lags; fixed-$b$ 5\\% critical value {FB:.2f} (simulated); plain = i.i.d.\\ $t$ over the annual slopes; CI = 95\\% $t$-interval over the annual slopes. The SPID $z$-score is $\\log(1 + \\text{{mentions}})$ standardized within year; `Any AI project' is the 0/1 indicator (Table~\\ref{{tab:spidbinary}} for its minimum detectable effect).",209 size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results.json (fama_macbeth)")210# ================================================================ T9 before / after ChatGPT, both universes (main) ====211SP = R["subperiod_spread"]; PO = R["pooled"]212body = panel(8, "Panel A: cohort-level spreads (equal-weighted Q5$-$Q1, pp per year)")213for k, l in SIGL[:5] + [SIGL[7]]:214 for sname, sl in [("r3k", "Russell 3000"), ("sp500", "S\\&P 500")]:215 su = R["samples"][sname]["sub"][k]216 for sfx, rl in ([("_w", "wins."), ("", "raw"), ("_med", "median")] if k == "AI_COMPOS" else [("_w", "wins.")]):217 coh = " / ".join(f"{v * 100:+.1f}" for y, v in su["post" + sfx]["by_cohort"].items())218 body += f"{l if (sname == 'r3k' and sfx == '_w') else ''} & {sl if sfx == '_w' else ''} & {rl} & {pp(su['pre' + sfx]['mean'])} & {ci(su['pre' + sfx]['ci95'])} & {pp(su['post' + sfx]['mean'])} & {ci(su['post' + sfx]['ci95'])} & {coh} \\\\\n"219 body += "\\addlinespace\n"220body += "\\midrule\n" + panel(8, "Panel B: pooled firm-level tests of the composite (Q1/Q5 firm-years, cohort fixed effects)") + "Test & Universe & Returns & Estimate (pp) & [$t$ firm] & [$t$ firm$\\times$cohort] & wild $p$ & $N$ or MDE \\\\\n\\midrule\n"221def pooled_row(lbl, uni, rl, x, extra=None): return f"{lbl} & {uni} & {rl} & {x['coef_pct']:+.1f} & {br(x['t_firm'])} & {br(x.get('t_twoway'))} & {pv(x.get('p_wild_webb'))} & {extra if extra is not None else '$N$ = ' + n(x['n'])} \\\\\n"222body += pooled_row("Post Q5 vs Q1", "Russell 3000", "wins.", PO["post_w"]) + pooled_row("", "", "raw", PO["post"]) + pooled_row("", "S\\&P 500", "wins.", R["samples"]["sp500"]["pooled_post_w"])223body += pooled_row("Pre Q5 vs Q1", "Russell 3000", "wins.", PO["pre_w"]) + pooled_row("Post $-$ pre (hi $\\times$ post)", "Russell 3000", "wins.", PO["diff_w"], f"MDE {PO['diff_w']['mde_pct_firm']:.1f} pp") + pooled_row("", "", "raw", PO["diff"], f"MDE {PO['diff']['mde_pct_firm']:.1f} pp")224body += pooled_row("Post 2022--23 only, Q5 vs Q1", "Russell 3000", "wins.", PO["post_excl_2024_w"])225table("tab_prepost_both", "tab:prepostboth", "AI-language spreads before and after the ChatGPT launch, Russell~3000 and S\\&P~500.",226 f"Panel A: equal-weighted Q5$-$Q1 spreads averaged over the pre-launch cohorts ({R['samples']['r3k']['sub']['AI_COMPOS']['pre_w']['n']}, formation years 2010--2021) and the post-launch cohorts ({R['samples']['r3k']['sub']['AI_COMPOS']['post_w']['n']}, 2022--2024), with 95\\% $t$-intervals over cohorts and the three post-launch cohort spreads. Panel B: firm-level regressions of the forward return of top- and bottom-quintile firm-years on a top-quintile indicator (and its interaction with a post-launch dummy) with cohort fixed effects: $t$-statistics clustered by firm and two-way by firm and cohort, wild-cluster bootstrap $p$ by cohort, and the minimum detectable effect (MDE) at 80\\% power.",227 "lllrrrrr", ["Signal & Universe & Returns & Pre Q5$-$Q1 & 95\\% CI & Post Q5$-$Q1 & 95\\% CI & Post cohorts 2022 / 2023 / 2024"], body,228 TABLE_NOTE_SE + " A Newey--West $t$ on three post-launch cohorts has no useful sampling distribution and is not printed; the post-period evidence rests on the cohort CIs and on the pooled firm-level tests of Panel B. Wild $p$ = restricted wild-cluster bootstrap by cohort (Webb six-point weights, 9,999 draws; only 15 clusters, 3 in the post period, so the bootstrap distribution is coarse). MDE = 2.8 $\\times$ firm-clustered SE. "229 f"Economic magnitude: the winsorized post $-$ pre difference of {PO['diff_w']['coef_pct']:+.1f} pp is smaller than its MDE of {PO['diff_w']['mde_pct_firm']:.1f} pp, so a post-launch increase of the size reported for the S\\&P~500 in v1.1 could not be detected in this design.",230 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.sub, pooled, samples.sp500.pooled_post_w)")231# ================================================================ T10 cohorts (main) ====232C, Cw, Cm = R2["cohorts"], R2["cohorts_w"], R2["cohorts_med"]; PB = R2["placebo_breaks"]; TM = RS["then_members_present"]233body = panel(5, "Panel A: equal-weighted Q5$-$Q1 spread of the composite by formation cohort (pp)") + "Cohort & raw & wins. & median & Then-IWV-members only (wins.) \\\\\n\\midrule\n"234for y, v in C["cohort_spreads_pct"].items():235 tm = TM.get(str(y)); body += f"{y} & {v:+.1f} & {Cw['cohort_spreads_pct'][y]:+.1f} & {Cm['cohort_spreads_pct'][y]:+.1f} & {(pp(tm['spread_members_w']) + ' (' + f'{tm['share_member_then'] * 100:.0f}' + '\\% members)') if tm else '--'} \\\\\n"236body += f"\\midrule\nPre mean (2010--21), 95\\% CI & {C['pre_mean_pct']:+.1f} {cip(C['pre_ci95_pct'])} & {Cw['pre_mean_pct']:+.1f} {cip(Cw['pre_ci95_pct'])} & {Cm['pre_mean_pct']:+.1f} & \\\\\nPost mean (2022--24), 95\\% CI & {C['post_mean_pct']:+.1f} {cip(C['post_ci95_pct'])} & {Cw['post_mean_pct']:+.1f} {cip(Cw['post_ci95_pct'])} & {Cm['post_mean_pct']:+.1f} & \\\\\n"237body += "Post mean leaving out 2022 / 2023 / 2024 & " + " / ".join(f"{v:+.1f}" for v in C["post_loo_pct"].values()) + " & " + " / ".join(f"{v:+.1f}" for v in Cw["post_loo_pct"].values()) + " & " + " / ".join(f"{v:+.1f}" for v in Cm["post_loo_pct"].values()) + " & \\\\\n"238body += "\\midrule\n" + panel(5, "Panel B: is the 2022--24 block unusual? (composite)") + "Test & \\multicolumn{2}{l}{raw} & \\multicolumn{2}{l}{wins.} \\\\\n\\midrule\n"239PBw = PB["winsorized"]240body += f"{pcell(1, 0.3, f"Permutation $p$ (one-sided), 2022--24 vs all {PB['permutation']['n_subsets']} three-cohort subsets (rank)")} & \\multicolumn{{2}}{{l}}{{{PB['permutation']['p_one_sided']:.2f} (rank {PB['permutation']['rank_among_subsets']})}} & \\multicolumn{{2}}{{l}}{{{PBw['permutation']['p_one_sided']:.2f} (rank {PBw['permutation']['rank_among_subsets']})}} \\\\\n"241body += f"{pcell(1, 0.3, 'Contiguous three-cohort blocks with a higher mean than 2022--24')} & \\multicolumn{{2}}{{l}}{{{PB['permutation']['rank_among_contiguous'] - 1} of 12}} & \\multicolumn{{2}}{{l}}{{{PBw['permutation']['rank_among_contiguous'] - 1} of 12}} \\\\\n"242body += f"{pcell(1, 0.3, f"Rank of 2022 among {PB['n_candidates']} candidate break years (post $-$ pre mean)")} & \\multicolumn{{2}}{{l}}{{{PB['rank_of_2022']} of {PB['n_candidates']}}} & \\multicolumn{{2}}{{l}}{{{PBw['rank_of_2022']} of {PBw['n_candidates']}}} \\\\\n"243body += f"{pcell(1, 0.3, 'sup-Wald mean-shift statistic, Andrews (1993), 15\\% trim (simulated $p$)')} & \\multicolumn{{2}}{{l}}{{{PB['sup_wald']['sup_wald']:.2f} ({PB['sup_wald']['p_simulated']:.2f})}} & \\multicolumn{{2}}{{l}}{{{PBw['sup_wald']['sup_wald']:.2f} ({PBw['sup_wald']['p_simulated']:.2f})}} \\\\\n"244table("tab_cohorts", "tab:cohorts", "Cohort-by-cohort spreads of the AI composite and tests of a 2022 break, Russell~3000.",245 f"Panel A: equal-weighted Q5$-$Q1 forward-return spread of the composite for each formation cohort (raw, within-year winsorized, median difference), the same spread restricted to firms that were IWV constituents at formation (Wayback captures exist from 2019 only), and the pre- and post-launch means with 95\\% $t$-intervals and leave-one-out post means. Panel B: an exact permutation test of the 2022--24 block against every three-cohort subset, the contiguous-block comparison, the rank of 2022 among the {PB['n_candidates']} candidate break years, and the Andrews sup-Wald test for a mean shift in the cohort series (simulated finite-sample $p$).",246 "lrrrl", [], body,247 TABLE_NOTE_SE + f" Then-members-only spreads use the IWV holdings capture nearest the formation month (results/r3k\\_v2/results\\_surv.json). The permutation $p$ is the share of the {PB['permutation']['n_subsets']} three-cohort subsets whose mean spread is at least the 2022--24 mean; the sup-Wald $p$ is from {PB['sup_wald']['nsim']:,} simulated series of length {PB['sup_wald']['T']}. "248 f"Economic reading: the post mean leaving out 2024 (wins.\\ {Cw['post_loo_pct']['2024']:+.1f} pp) is at the pre mean ({Cw['pre_mean_pct']:+.1f}); none of the break tests rejects at conventional levels.",249 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results2.json (cohorts*, placebo_breaks), results_surv.json (then_members_present)")250# ================================================================ T11 size groups (main) ====251G = R["groups"]; sn = R["size_neutral"]; CT = R["contrasts"]252body = ""253for g, l in [("large_top1000", "Largest 1,000 (corrected cap)"), ("small_rest", "Remaining firms"), ("large_pct42", "Largest 42\\% within cohort"), ("small_pct42", "Remaining 58\\%"), ("sp500", "S\\&P 500 members"), ("non_sp500", "Non-members")]:254 r = G[g]255 for sfx, rl in [("_w", "wins."), ("", "raw")]:256 loo = " / ".join(f"{v * 100:+.1f}" for v in r["post_loo" + sfx].values()); ex24 = f"{r['pooled_post_excl_2024' + sfx]['coef_pct']:+.1f} {br(r['pooled_post_excl_2024' + sfx]['t_firm'])}" if r.get("pooled_post_excl_2024" + sfx) else "--"257 body += f"{l if sfx == '_w' else ''} & {rl} & {n(r['n']) if sfx == '_w' else ''} & {pp(r['sort_EW' + sfx]['Q5_minus_Q1'])} & {br(r['sort_EW' + sfx]['t_stat'])} & {ci(r['sort_EW' + sfx]['ci95'])} & {pp(r['pre' + sfx]['mean'])} & {pp(r['post' + sfx]['mean'])} & {loo} & {ex24} \\\\\n"258 body += "\\addlinespace\n"259for sfx, rl in [("_w", "wins."), ("", "raw")]:260 body += f"{'Size-neutral quintiles (all)' if sfx == '_w' else ''} & {rl} & {NOBS if sfx == '_w' else ''} & {pp(sn['full' + sfx]['Q5_minus_Q1'])} & {br(sn['full' + sfx]['t_stat'])} & {ci(sn['full' + sfx]['ci95'])} & {pp(sn['pre' + sfx]['mean'])} & {pp(sn['post' + sfx]['mean'])} & -- & -- \\\\\n"261cl = CT["large_vs_small_w"]["hi_x_post_x_group"]; cm_ = CT["member_vs_non_w"]["hi_x_post_x_group"]262table("tab_groups", "tab:groups", "AI-composite spreads by size group and index membership, Russell~3000.",263 f"Equal-weighted Q5$-$Q1 spreads of the composite with quintiles formed within each sub-sample and cohort: full-sample spread with its Newey--West $t$ and 95\\% CI over cohorts, pre- (2010--21) and post-launch (2022--24) means, the post mean leaving out each post cohort in turn, and the pooled firm-level post spread for 2022--23 only (firm-clustered $t$). Size groups are assigned each June on the corrected capitalization: the largest 1,000 firms (Russell~1000 proxy) versus the rest, and a fixed within-cohort percentile partition (largest 42\\%) that keeps the group shares constant as the panel grows. The size-neutral rows form quintiles within size group and cohort over all firms.",264 "llrrrrrrrr", ["Sample & Returns & Firm-years & Full Q5$-$Q1 & [NW $t$] & 95\\% CI & Pre & Post ($n$ = 3) & Post leaving out 2022 / 2023 / 2024 & Post 2022--23 pooled [$t$]"], body,265 TABLE_NOTE_SE + f" Firm-years without a capitalization ({n(META['n_est_without_cap'])}) belong to no size group; {MD['share_firm_years_changing_size_group'] * 100:.1f}\\% of firm-years change group relative to the committed v2.0 capitalization. "266 f"The post-launch CIs over three cohorts are wide (largest 1,000, wins.: {ci(G['large_top1000']['post_w']['ci95'])}; remaining: {ci(G['small_rest']['post_w']['ci95'])}; Figure~\\ref{{fig:sizegroups}}). The large-versus-small post-launch difference is tested in Table~\\ref{{tab:contrasts}}: hi $\\times$ post $\\times$ largest-1,000 = {cl['coef_pct']:+.1f} pp (firm $t$ {cl['t_firm']:.2f}, two-way {tv(cl['t_twoway'])}, wild $p$ {cl['p_wild_webb']:.2f}, MDE {cl['mde_pct_firm']:.1f} pp); hi $\\times$ post $\\times$ member = {cm_['coef_pct']:+.1f} pp ($t$ {cm_['t_firm']:.2f} / {tv(cm_['t_twoway'])}). "267 f"Post FF6 alphas of the sub-sample monthly long--shorts (\\%/yr, [$t$]): largest 1,000 {G['large_top1000']['ls']['post']['ff6_alpha_ann_pct']:+.2f} {br(G['large_top1000']['ls']['post']['ff6_alpha_t'])}, remaining {G['small_rest']['ls']['post']['ff6_alpha_ann_pct']:+.2f} {br(G['small_rest']['ls']['post']['ff6_alpha_t'])}, S\\&P members {G['sp500']['ls']['post']['ff6_alpha_ann_pct']:+.2f} {br(G['sp500']['ls']['post']['ff6_alpha_t'])}. Firms per group and cohort: Table~\\ref{{tab:coverage}}.",268 size="\\scriptsize", colsep="2pt", placement="main", sources="results/r3k_v2/results.json (groups, size_neutral, contrasts)")269# ================================================================ contrasts (main, new) ====270body = panel(8, "Panel A: pooled firm-level interactions (Q1/Q5 firm-years, cohort fixed effects)")271for key, l in [("large_vs_small_w", "hi $\\times$ post $\\times$ largest-1,000"), ("large_vs_small_raw", "hi $\\times$ post $\\times$ largest-1,000"), ("member_vs_non_w", "hi $\\times$ post $\\times$ S\\&P member"), ("member_vs_non_raw", "hi $\\times$ post $\\times$ S\\&P member")]:272 c = CT[key]; rl = "wins." if key.endswith("_w") else "raw"273 for term, tl in [("hi_x_post", "hi $\\times$ post (reference group)"), ("hi_x_group", "hi $\\times$ group (pre-launch)"), ("hi_x_post_x_group", l)]:274 x = c[term]; body += f"{tl} & {rl} & {x['coef_pct']:+.2f} & {br(x['t_firm'])} & {br(x.get('t_twoway'))} & {cip(x['ci95_firm_pct'])} & {pv(x.get('p_wild_rademacher'))} / {pv(x.get('p_wild_webb'))} & {x['mde_pct_firm']:.1f} \\\\\n"275 body += f"\\quad $N$ = {n(c['n'])} & & & & & & & \\\\\n\\addlinespace\n"276body += "\\midrule\n" + panel(8, "Panel B: difference of cohort-level post $-$ pre changes, cohort bootstrap")277for key, l in [("large_minus_small_postpre_boot_w", "(post $-$ pre)$_{\\text{largest 1,000}}$ $-$ (post $-$ pre)$_{\\text{remaining}}$"), ("large_minus_small_postpre_boot_raw", "same, raw returns"), ("member_minus_non_postpre_boot_w", "(post $-$ pre)$_{\\text{S\\&P}}$ $-$ (post $-$ pre)$_{\\text{non-members}}$")]:278 c = CT[key]; body += f"{pcell(1, 0.3, l)} & {'raw' if key.endswith('_raw') else 'wins.'} & {c['diff_in_diff_pct']:+.2f} & & & {cip(c['ci95_boot_pct'])} & & \\\\\n"279table("tab_contrasts", "tab:contrasts", "Formal tests of the large-versus-small and member-versus-non-member post-launch differences.",280 "Panel A: pooled regressions of the forward return of Q1 and Q5 firm-years on a top-quintile indicator (hi), a post-launch dummy, the group indicator and all interactions, with cohort fixed effects. The triple interaction is the post-launch change of the spread in the group relative to the reference group. $t$-statistics in brackets from firm-clustered and two-way (firm $\\times$ cohort) standard errors; 95\\% CI from the firm-clustered SE; wild $p$ from the restricted wild-cluster bootstrap by cohort (Rademacher / Webb weights, 9,999 draws, 15 clusters); MDE = minimum detectable effect at 80\\% power (2.8 $\\times$ firm-clustered SE). Panel B: the difference of the post $-$ pre changes of the cohort-level spreads with a 95\\% cohort-bootstrap interval (12 pre and 3 post cohorts resampled, 9,999 draws).",281 "llrrrrrr", ["Term & Returns & Coefficient (pp) & [$t$ firm] & [$t$ firm$\\times$cohort] & 95\\% CI & wild $p$ (Rad.\\ / Webb) & MDE (pp)"], body,282 f"Economic reading: the point estimate of the large-cap post-launch increase relative to small caps is {cl['coef_pct']:+.1f} pp per year, but its MDE is {cl['mde_pct_firm']:.1f} pp and the wild-bootstrap $p$ is {cl['p_wild_webb']:.2f}, so the difference between the two size groups is not statistically established; the cohort-bootstrap interval in Panel B covers zero. The S\\&P-member contrast is weaker still. Returns winsorized within the formation year unless marked raw. Source: results/r3k\\_v2/results.json (contrasts).",283 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (contrasts)")284# ================================================================ T12 double sort (appendix) ====285body = ""286for per, key in [("Pre-ChatGPT (2010--2021)", "double_sort_pre"), ("Post-ChatGPT (2022--2024)", "double_sort_post")]:287 for sfx, rl in [("_w", "wins."), ("", "raw")]:288 dsx = pd.DataFrame(R2[key + sfx])289 for sz in ["Small", "Mid", "Large"]:290 if sz in dsx.index: body += f"{per if (sz == 'Small' and sfx == '_w') else ''} & {rl if sz == 'Small' else ''} & {sz} & {dsx.loc[sz, 'Lo']:.1f} & {dsx.loc[sz, 'Mid']:.1f} & {dsx.loc[sz, 'Hi']:.1f} & {dsx.loc[sz, 'Hi-Lo']:+.1f} & {n(dsx.loc[sz, 'N'])} \\\\\n"291 body += "\\addlinespace\n"292table("tab_doublesort", "tab:doublesort", "AI language $\\times$ size double sort, Russell~3000.",293 "Mean forward twelve-month return (percent) by tercile of the AI composite within tercile of the corrected market capitalization (both formed within cohort on ranks), for the pre- and post-launch cohorts and for the within-year winsorized and raw returns, with the High$-$Low difference and the number of firm-years per size tercile.",294 "lllrrrrr", ["Period & Returns & Size tercile & Low AI & Mid & High AI & High$-$Low & Firm-years"], body,295 "Descriptive cell means without standard errors; the formal large-versus-small test with clustered inference and MDE is in Table~\\ref{tab:contrasts}, and the post-launch cells average only three cohorts. Firm-years without a capitalization are excluded. Source: results/r3k\\_v2/results2.json (double\\_sort\\_*).",296 placement="appendix", sources="results/r3k_v2/results2.json (double_sort_*)")297# ================================================================ T13 sector / within-sector + TECH (main) ====298Lc = R2["sector_controls"]; M = R2["monthly_ls"]["AI_COMPOS"]; SN = R2["sector_neutral"]; RSd = R2["residual_sort"]299body = panel(5, "Panel A: three within-sector estimators of the composite premium (pp per SD or pp)")300for samp, sl in [("all", "all sectors"), ("ex_energy", "ex-Energy")]:301 for tag, rl in [("w", "wins."), ("raw", "raw")]:302 for st, stl in [("nosector", "FM slope, no sector dummies"), ("sector", "FM slope, GICS-sector dummies")]:303 cells = []304 for per in ["pre", "post", "full"]:305 x = Lc[f"fm_{samp}_{tag}_{st}_{per}"]; cells.append(f"{x['slope_pct']:+.2f} [{tv(x['t_nw'])}; {tv(x['t_plain'])}]")306 body += f"{pcell(1, 0.27, stl)} & {rl}, {sl} & " + " & ".join(cells) + " \\\\\n"307 for per_lbl, key in [("Pooled OLS, cohort FE", "year_fe"), ("Pooled OLS, sector $\\times$ cohort FE", "sector_year_fe")]:308 cells = [f"{Lc[f'pooled_{samp}_{per}'][key]['coef_pct']:+.2f} [{tv(Lc[f'pooled_{samp}_{per}'][key]['t_firm'])}; {tv(Lc[f'pooled_{samp}_{per}'][key]['t_twoway'])}; {pv(Lc[f'pooled_{samp}_{per}'][key].get('p_wild_webb'))}]" for per in ["pre", "post", "full"]]; body += f"{per_lbl} & wins., {sl} & " + " & ".join(cells) + " \\\\\n"309 body += "\\addlinespace\n"310LRS = "Residual sort (returns net of sector $\\times$ cohort FE and controls)"; body += f"{pcell(1, 0.27, 'Sector-neutral quintile sort, Q5$-$Q1 (pp)')} & wins. & {pp(SN['pre_w']['mean'])} [{tv(SN['pre_w']['t'])}] & {pp(SN['post_w']['mean'])} [{tv(SN['post_w']['t'])}] & {pp(SN['full_w']['mean'])} [{tv(SN['full_w']['t'])}] \\\\\n & raw & {pp(SN['pre']['mean'])} [{tv(SN['pre']['t'])}] & {pp(SN['post']['mean'])} [{tv(SN['post']['t'])}] & {pp(SN['full']['mean'])} [{tv(SN['full']['t'])}] \\\\\n & median & & & {pp(SN['full_med']['mean'])} [{tv(SN['full_med']['t'])}] \\\\\n & wins., ex-Energy & & & {pp(SN['full_ex_energy_w']['mean'])} [{tv(SN['full_ex_energy_w']['t'])}] \\\\\n"311body += f"{pcell(1, 0.27, LRS)} & wins. & {pp(RSd['pre_w']['mean'])} [{tv(RSd['pre_w']['t'])}] & {pp(RSd['post_w']['mean'])} [{tv(RSd['post_w']['t'])}] & {pp(RSd['full_w']['mean'])} [{tv(RSd['full_w']['t'])}] \\\\\n\\midrule\n" + panel(5, "Panel B: monthly composite long--short and the TECH factor")312for lab_, key, d in [("Mean (\\%/yr)", "mean_ann_pct", 2), ("HAC $t$", "hac_t", 2), ("Sharpe ratio", "sharpe", 2), ("FF6 $\\alpha$ (\\%/yr) [$t$]", "ff6_alpha_pct", 2), ("FF6 + TECH $\\alpha$ (\\%/yr) [$t$]", "ff6_tech_alpha_pct", 2), ("$\\beta_{\\text{TECH}}$ [$t$]", "tech_beta", 3)]:313 cells = []314 for p_ in ["pre", "post", "full"]:315 v = M[p_].get(key, float("nan")); tkey = {"ff6_alpha_pct": "ff6_t", "ff6_tech_alpha_pct": "ff6_tech_t", "tech_beta": "tech_beta_t"}.get(key)316 cells.append((f"{v:+.{d}f}" if key not in ("hac_t", "sharpe") else f"{v:.2f}") + (f" {br(M[p_].get(tkey))}" if tkey else ""))317 body += f"{lab_} & monthly & " + " & ".join(cells) + " \\\\\n"318body += f"Months & & {M['pre']['n_months']} & {M['post']['n_months']} & {M['full']['n_months']} \\\\\n"319table("tab_sector_tech", "tab:sectortech", "Within-sector estimates of the AI-language premium and technology-factor spanning, Russell~3000.",320 f"Panel A: three estimators of the premium net of sector: Fama--MacBeth slopes of the forward return on the composite with and without GICS-sector dummies (pp per SD; brackets: [NW $t$; plain $t$] over the annual slopes), pooled OLS with cohort or sector $\\times$ cohort fixed effects (brackets: [firm-clustered $t$; two-way $t$; wild-cluster $p$ by cohort]), and the sector-neutral quintile sort (quintiles formed within sector and cohort) and residual sort (pp; brackets: NW $t$). Panel B: the monthly equal-weighted composite long--short and its alpha with and without TECH, the equal-weighted return of the panel's Information Technology constituents minus the equal-weighted return of all constituents (HAC $t$, 3 lags).",321 "llrrr", ["Estimator & Returns / sample & Pre (2010--21) & Post (2022--24) & Full"], body,322 f"NW $t$ on {FM['compos']['n_years']} (pre: 12; post: 3) annual slopes with 3 Bartlett lags; the fixed-$b$ 5\\% critical value is {FB:.2f}, and the post-period NW $t$ on three slopes is reported for completeness only. $N$ (pooled, full sample, all sectors) = {n(Lc['pooled_all_full']['n'])}; ex-Energy drops the GICS Energy sector. The three estimators do not agree: the FM slope with sector dummies and the sector $\\times$ cohort FE regression keep a positive within-sector slope while the sector-neutral sort does not, so the within-sector premium is estimator-dependent. Economic magnitude: the full-sample sector $\\times$ cohort FE slope of {Lc['pooled_all_full']['sector_year_fe']['coef_pct']:+.2f} pp per SD is {Lc['pooled_all_full']['sector_year_fe']['coef_pct'] / Lc['pooled_all_full']['year_fe']['coef_pct'] * 100:.0f}\\% of the slope without sector effects ({Lc['pooled_all_full']['year_fe']['coef_pct']:+.2f}). Source: results/r3k\\_v2/results2.json (sector\\_controls, sector\\_neutral, residual\\_sort, monthly\\_ls).",323 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results2.json (sector_controls, sector_neutral, residual_sort, monthly_ls)")324# ================================================================ T14 placebo factors (appendix) ====325PL = R2["placebo"]; MH = R2["mht"]["placebo_interactions_yearcl"]; rw = dict(zip(MH["members"], MH["p_romano_wolf"])); hb = dict(zip(MH["members"], MH["p_holm_on_wild"]))326body = ""327for k, v in PL.items(): body += f"{k}{' (AI)' if v['is_ai'] else ''} & {pp(v['full_w']['mean'])} & {ci(v['full_w']['ci95'])} & {pp(v['pre_w']['mean'])} & {pp(v['post_w']['mean'])} & {v['interaction']['coef_pct']:+.2f} & {br(v['interaction']['t_firm'])} & {br(v['interaction']['t_twoway'])} & {pv(v['interaction']['p_wild_webb'])} & {rw[k]:.2f} / {hb[k]:.2f} \\\\\n"328table("tab_placebo", "tab:placebo", "Placebo across eight semantic factors scored with the same pipeline, Russell~3000.",329 "Equal-weighted Q5$-$Q1 spreads (within-year winsorized, pp per year) of each anchor concept over the full sample (with 95\\% CI over cohorts) and the two sub-periods, and the coefficient on factor $\\times$ post in the pooled regression of the forward return on the factor, a post-launch dummy, their interaction, size and momentum (pp per SD; $t$ in brackets, firm-clustered and two-way firm $\\times$ cohort; wild $p$ = Webb wild-cluster bootstrap by cohort). The last column adjusts the eight interaction tests for multiple testing: Romano--Wolf step-down $p$ on the shared bootstrap draws and Holm on the wild $p$-values.",330 "lrrrrrrrrr", ["Semantic factor & Full Q5$-$Q1 & 95\\% CI & Pre & Post & Factor $\\times$ post & [$t$ firm] & [$t$ two-way] & wild $p$ & RW $p$ / Holm"], body,331 "Family size 8. Two placebo anchors (cybersecurity, automation/labor) mention AI terms, so the placebo separates AI language from generic technology vocabulary only partially (Table~\\ref{tab:constructvalidity} reports the stripped-anchor variants). The cybersecurity interaction is the only one that survives the Romano--Wolf adjustment; a priced cyber-risk measure of the same construction is documented in the literature (Celeny and Mar\\'echal). Post-period spreads average three cohorts. Source: results/r3k\\_v2/results2.json (placebo, mht.placebo\\_interactions\\_yearcl).",332 size="\\scriptsize", colsep="4pt", placement="appendix", sources="results/r3k_v2/results2.json (placebo, mht)")333# ================================================================ T19 robustness (main) ====334rows = []; M7 = R2["mag7"]; AS = R2["alt_signal"]; AH = R2["alt_horizon"]; AB = R2["alt_benchmark"]; EN = R2["entrants"]; BR = R2["breaks"]; CS = RS["conditional_spreads"]; CK = R2["cluster_k"]335def add(l, pre_w, post_w, pre=None, post=None): rows.append((l, pp(pre_w["mean"]) if pre_w else "--", br(pre_w["t"]) if pre_w else "--", ci(pre_w["ci95"]) if pre_w else "--", pp(post_w["mean"]) if post_w else "--", ci(post_w["ci95"]) if post_w else "--", pp(pre["mean"]) if pre else "--", pp(post["mean"]) if post else "--"))336add("Baseline (EW quintiles, composite)", SP["AI_COMPOS"]["pre_w"], SP["AI_COMPOS"]["post_w"], SP["AI_COMPOS"]["pre"], SP["AI_COMPOS"]["post"]); add("Baseline, strict 12 valid months", None, None, SP["AI_COMPOS"]["pre_strict"], SP["AI_COMPOS"]["post_strict"]); add("Baseline, median spread", None, None, SP["AI_COMPOS"]["pre_med"], SP["AI_COMPOS"]["post_med"])337add("Sector-neutral composite", SN["pre_w"], SN["post_w"], SN["pre"], SN["post"]); add("Residual sort (sector $\\times$ cohort FE, controls)", RSd["pre_w"], RSd["post_w"]); add("Excluding the Magnificent 7", M7["ex_mag7_pre_w"], M7["ex_mag7_post_w"], M7["ex_mag7_pre"], M7["ex_mag7_post"]); add("Excluding the 500 largest firms", M7["ex_top500_pre_w"], M7["ex_top500_post_w"], M7["ex_top500_pre"], M7["ex_top500_post"])338for s_, l in [("mean", "Signal: unweighted chunk mean"), ("top5pct", "Signal: top-5\\% chunks")]: add(l, AS[s_]["pre_w"], AS[s_]["post_w"], AS[s_]["pre"], AS[s_]["post"])339add("Outcome: IWV-adjusted return", AB["iwv_adj"]["pre_w"], AB["iwv_adj"]["post_w"], AB["iwv_adj"]["pre"], AB["iwv_adj"]["post"]); add("Horizon 6 months", AH["6m"]["pre_w"], AH["6m"]["post_w"], AH["6m"]["pre"], AH["6m"]["post"]); add("Horizon 24 months (post = 2022--23)", AH["24m"]["pre_w"], AH["24m"]["post_w"], AH["24m"]["pre"], AH["24m"]["post"])340add("PCA first component", SP["AI_PC1"]["pre_w"], SP["AI_PC1"]["post_w"], SP["AI_PC1"]["pre"], SP["AI_PC1"]["post"]); add("AI disruption-risk facet", SP["AI_RISK"]["pre_w"], SP["AI_RISK"]["post_w"], SP["AI_RISK"]["pre"], SP["AI_RISK"]["post"]); add("Equal-form composite", SP["AI_formw"]["pre_w"], SP["AI_formw"]["post_w"], SP["AI_formw"]["pre"], SP["AI_formw"]["post"]); add("10-K composite", SP["AI_10k"]["pre_w"], SP["AI_10k"]["post_w"], SP["AI_10k"]["pre"], SP["AI_10k"]["post"])341add("Cyber-neutral composite (within cyber tercile)", CK["cyber"]["cyberneutral_sort"]["pre_w"], CK["cyber"]["cyberneutral_sort"]["post_w"]); add("Seasoned firms (listed before July 2009)", EN["seasoned"]["pre_w"], EN["seasoned"]["post_w"], EN["seasoned"]["pre"], EN["seasoned"]["post"]); add("Listed $\\geq$ 36 months at formation", EN["listed36"]["pre_w"], EN["listed36"]["post_w"], EN["listed36"]["pre"], EN["listed36"]["post"])342add("Split at 2021 (pre 2010--20 / post 2021--24)", BR["split_2021"]["pre_w"], BR["split_2021"]["post_w"], BR["split_2021"]["pre"], BR["split_2021"]["post"])343add("Size-group $\\times$ cohort demeaned returns", CS["size_demeaned_w"]["pre"], CS["size_demeaned_w"]["post"]); add("Below-median forward volatility", CS["low_fwd_vol_w"]["pre"], CS["low_fwd_vol_w"]["post"]); add("Below the cohort's 99th percentile (raw)", None, None, CS["below_p99_raw"]["pre"], CS["below_p99_raw"]["post"])344body = "".join(f"{a} & {b} & {c} & {d} & {e} & {f} & {g} & {h} \\\\\n" for a, b, c, d, e, f, g, h in rows)345MR = R2["mht"]346table("tab_robust", "tab:robust", "Construction, horizon, benchmark, universe and survivorship checks on the composite spread, Russell~3000.",347 "Equal-weighted Q5$-$Q1 composite spreads (pp per year) before (2010--21) and after (2022--24) the launch under alternative constructions of the signal, outcome, horizon, universe and break date. Headline columns use the within-year winsorized return with the Newey--West $t$ (brackets) and the 95\\% $t$-interval over cohorts; the last two columns repeat the pre and post means on raw returns.",348 "lrrrrrrr", ["Specification & Pre, wins. & [NW $t$] & 95\\% CI & Post, wins. & 95\\% CI & Pre, raw & Post, raw"], body,349 TABLE_NOTE_SE + f" Pooled firm-clustered post $-$ pre tests (wins.): split at 2022 {BR['split_2022']['pooled_diff_w']['coef_pct']:+.1f} pp [$t$ {BR['split_2022']['pooled_diff_w']['t_firm']:.2f} firm / {tv(BR['split_2022']['pooled_diff_w']['t_twoway'])} two-way], split at 2021 {BR['split_2021']['pooled_diff_w']['coef_pct']:+.1f} pp [{BR['split_2021']['pooled_diff_w']['t_firm']:.2f} / {tv(BR['split_2021']['pooled_diff_w']['t_twoway'])}]. Romano--Wolf adjusted $p$ over the {MR['robustness_pre_w']['family_size']} robustness rows (wins.): smallest pre {min(MR['robustness_pre_w']['p_romano_wolf']):.2f}, smallest post {min(MR['robustness_post_w']['p_romano_wolf']):.2f} (Table~\\ref{{tab:mht}}). "350 "The seasoned and listed-36-months rows condition on entry only; survival to October 2026 is addressed in Table~\\ref{tab:attrition}. Source: results/r3k\\_v2/results2.json, results\\_surv.json (conditional\\_spreads).",351 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results2.json (subperiod_spread, sector_neutral, residual_sort, mag7, alt_*, entrants, breaks, cluster_k), results_surv.json (conditional_spreads), results.json")352# ================================================================ T18 filing type (appendix) ====353N = R2["filing_type"]; hr = N["fm_forms_w"]["horse_race"]; wd = N["fm_forms_w"]["wald_equality"]; hr0 = N["fm_forms_raw"]["horse_race"]; wd0 = N["fm_forms_raw"]["wald_equality"]; c22 = N["cohort2022"]354body = panel(8, "Panel A: one form at a time")355for t, l in [("10k", "Form 10-K only"), ("10q", "Form 10-Q only"), ("8k", "Form 8-K only"), ("formw", "Equal-form composite (mean of three $z$)")]:356 v = N[t]; fmv = N["fm_forms_w"]["single"].get(f"z_AI_{t}") if t != "formw" else None357 fms = f"{fmv['slope_pct']:+.2f} [{tv(fmv['t'])}; {tv(fmv['t_plain'])}]" if fmv else f"{FM['formw_w']['z_AI_formw']['mean_coef'] * 100:+.2f} [{tv(FM['formw_w']['z_AI_formw']['t'])}; {tv(FM['formw_w']['z_AI_formw']['t_plain'])}]"358 body += f"{l} & {v['share_firm_years'] * 100:.1f}\\% & {v['corr_with_baseline']:.2f} & {pp(v['full_w']['mean'])} & {ci(v['full_w']['ci95'])} & {pp(v['pre_w']['mean'])} & {pp(v['post_w']['mean'])} & {fms} \\\\\n"359body += "\\midrule\n" + panel(8, "Panel B: horse race, the three form composites entered jointly (Fama--MacBeth, pp per SD [NW $t$])")360body += "Returns & 10-K & 10-Q & 8-K & \\multicolumn{4}{l}{Wald $\\chi^2_2$ ($p$), equal slopes} \\\\\n\\midrule\n"361body += f"wins. & {hr['z_AI_10k']['slope_pct']:+.2f} {br(hr['z_AI_10k']['t'])} & {hr['z_AI_10q']['slope_pct']:+.2f} {br(hr['z_AI_10q']['t'])} & {hr['z_AI_8k']['slope_pct']:+.2f} {br(hr['z_AI_8k']['t'])} & \\multicolumn{{4}}{{l}}{{{wd['stat']:.2f} ({wd['p']:.3f})}} \\\\\nraw & {hr0['z_AI_10k']['slope_pct']:+.2f} {br(hr0['z_AI_10k']['t'])} & {hr0['z_AI_10q']['slope_pct']:+.2f} {br(hr0['z_AI_10q']['t'])} & {hr0['z_AI_8k']['slope_pct']:+.2f} {br(hr0['z_AI_8k']['t'])} & \\multicolumn{{4}}{{l}}{{{wd0['stat']:.2f} ({wd0['p']:.3f})}} \\\\\n"362body += "\\midrule\n" + panel(8, "Panel C: text of the 2022 cohort filed after the launch (30 November 2022)")363lc1 = "Share of the cohort's filings / chunks dated after the launch"; lc2 = f"Cohort spread, pre-launch filings only vs full-year text ({n(c22['n_firms_with_prelaunch_filings'])} firms, wins., pp)"364body += f"{pcell(1, 0.3, lc1)} & \\multicolumn{{7}}{{l}}{{{c22['share_filings_post_launch'] * 100:.1f}\\% / {c22['share_chunks_post_launch'] * 100:.1f}\\%}} \\\\\n{pcell(1, 0.3, lc2)} & \\multicolumn{{7}}{{l}}{{{c22['spread_prelaunch_text_only_w_pct']:+.1f} vs {c22['spread_full_text_same_firms_w_pct']:+.1f}; rank correlation of the two signals {c22['rank_corr_prelaunch_vs_full']:.2f}}} \\\\\n"365table("tab_filing_type", "tab:filingtype", "Form-specific AI composites, Russell~3000.",366 "Panel A: the composite rebuilt from the filing-level scores of one form at a time: share of estimation firm-years with at least one scored filing of that form, correlation with the baseline composite, equal-weighted Q5$-$Q1 spreads (within-year winsorized, pp per year; full sample with 95\\% CI over cohorts, pre and post), and the Fama--MacBeth slope with controls (pp per SD; [NW $t$; plain $t$]). Panel B: the three form composites entered jointly, with a HAC Wald test of equal slopes. Panel C: how much of the 2022 cohort's text post-dates the launch and whether it changes the cohort spread.",367 "lrrrrrrr", ["Signal built from & Firm-years covered & Corr.\\ with baseline & Full Q5$-$Q1 & 95\\% CI & Pre & Post & FM slope (pp/SD)"], body,368 f"Form composites = $\\tfrac12[z(\\text{{adoption}}) + z(\\text{{infrastructure}})]$ from the filings of that form only; the equal-form composite averages the three form $z$-scores. The Wald test rejects equality at 5\\% on winsorized returns but not on raw returns (wins.\\ $p$ = {wd['p']:.3f}, raw {wd0['p']:.3f}); Romano--Wolf $p$ over the three single-form slopes: " + ", ".join(f"{m.replace('z_AI_', '').replace('10k', '10-K').replace('10q', '10-Q').replace('8k', '8-K')}: {p:.2f}" for m, p in zip(R2["mht"]["forms_fm_w"]["members"], R2["mht"]["forms_fm_w"]["p_romano_wolf"])) + f". The claim that annual reports carry the strongest premium is therefore not statistically distinguishable from the other forms. Equation (3) aggregation reproduced from filing-level scores for {c22['aggregation_reproduced_share_1e6'] * 100:.2f}\\% of firm-years. Source: results/r3k\\_v2/results2.json (filing\\_type).",369 size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results2.json (filing_type, mht.forms_fm_w)")370# ================================================================ T15 event study (main) ====371EB = RE["by_benchmark"]; base = EB["mm_2022"]; HL = [("pre_m20_m1", "Pre-launch block [$-$20, $-$1] (1--29 Nov 2022)"), ("car_m1_p1", "Days [$-$1, $+$1]"), ("car_0_5", "Days [0, $+$5]"), ("car_0_20", "Days [0, $+$20]"), ("car_60d", "60 trading days"), ("car_6m", "125 days (6 months)"), ("car_1y", "250 days (1 year)"), ("car_18m", "395 days (18 months)")]372body = panel(8, "Panel A: full sample by horizon (day 0 = 1 December 2022)")373for h, l in HL:374 r = base["full"]["horizons"].get(h)375 if r: body += f"{l} & {r['days']} & {r['High_pct']:+.2f} & {r['Low_pct']:+.2f} & {r['HL_CAR_pct']:+.2f} & {r['t_cda']:.2f} & {tv(r['t_event_sd'])} & {tv(r.get('t_bmp_HL'))} \\\\\n"376body += "\\midrule\n" + panel(8, "Panel B: sub-samples, one-year (250-day) horizon")377for s_, l in [("large", "Largest 1,000 (corrected cap)"), ("small", "Remaining firms"), ("large_within", "Largest 1,000, terciles within group"), ("small_within", "Remaining, terciles within group"), ("sp500", "S\\&P 500 members"), ("non_sp500", "Non-members")]:378 r = base.get(s_)379 if r and "car_1y" in r["horizons"]: x = r["horizons"]["car_1y"]; body += f"{l} ($n$ = {r['n_high']} + {r['n_low']}) & {x['days']} & {x['High_pct']:+.2f} & {x['Low_pct']:+.2f} & {x['HL_CAR_pct']:+.2f} & {x['t_cda']:.2f} & {tv(x['t_event_sd'])} & {tv(x.get('t_bmp_HL'))} \\\\\n"380WR = RE["welch_reference"]; TC = RE["tercile_characteristics"]381table("tab_event", "tab:event", "ChatGPT event study: cumulative abnormal returns by pre-launch AI tercile under the IWV market model, Russell~3000.",382 f"Market-model cumulative abnormal returns (percent) of the high and low terciles of 2021-cohort AI exposure ({n(RE['n_firms'])} firms; terciles on ranks), the High$-$Low difference and three $t$-statistics: CDA = the dependence-robust crude-dependence-adjustment statistic of the daily High$-$Low portfolio (CAR divided by the estimation-window SD of the portfolio $\\times \\sqrt{{\\text{{days}}}}$), event-SD = the same with the event-window SD, BMP = Boehmer--Musumeci--Poulsen standardized-CAR difference, which treats firms as independent. Market model estimated on the iShares Russell~3000 ETF (IWV) over {RE['window']['estimation']}; the pre-launch block is reported separately from the event window.",383 "lrrrrrrr", ["Horizon & Days & High (\\%) & Low (\\%) & High$-$Low (pp) & CDA $t$ & event-SD $t$ & BMP $t$"], body,384 f"The CDA $t$ is the statistic the text relies on; the BMP $t$ is independence-based and overstates significance under a common event date (the Kolari--Pynn\\\"onen factor for $\\bar\\rho$ = {base['full']['rho_bar']:.4f} is {base['full']['kp_factor']:.3f}; it deflates the firm-level $t$, whereas the common component nets out of the High$-$Low portfolio, which is why the two differ). The Welch $t$ reported in v2.0 (independence-based) was: full {WR['full']['t_welch']:.2f}, largest 1,000 {WR['large']['t_welch']:.2f}, remaining {WR['small']['t_welch']:.2f}, S\\&P {WR['sp500']['t_welch']:.2f}, non-S\\&P {WR['non_sp500']['t_welch']:.2f}. "385 f"Tercile characteristics (estimation window): Low $\\beta$ {TC['Low']['beta']:.2f}, log cap {TC['Low']['log_mktcap']:.2f}, share large {TC['Low']['share_large'] * 100:.0f}\\%; High $\\beta$ {TC['High']['beta']:.2f}, log cap {TC['High']['log_mktcap']:.2f}, share large {TC['High']['share_large'] * 100:.0f}\\% --- the terciles differ in beta and size, so Table~\\ref{{tab:eventcda}} re-estimates the one-year gradient under five benchmarks. Levels drift negative because the model was estimated in the 2022 bear market; only differences between terciles are interpretable. Source: results/r3k\\_v2/results\\_event.json.",386 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results_event.json (by_benchmark.mm_2022, welch_reference, tercile_characteristics)")387# ================================================================ T16 event CDA by benchmark + placebo launches (main) ====388body = panel(8, "Panel A: one-year High$-$Low abnormal return (pp) and CDA $t$ by benchmark and sub-sample")389for b_, l in [("mm_2022", "(a) IWV market model, est.\\ Jan--Oct 2022"), ("beta_only", "(b) Beta-only, $r - \\hat\\beta m$"), ("market_adjusted", "(c) Market-adjusted, $r - m$"), ("mm_est2021", "(d) Market model estimated over 2021"), ("size_mom_matched", "(e) Size $\\times$ momentum matched (5 $\\times$ 5)")]:390 for stat, sl in [("HL_CAR_pct", "H$-$L (pp)"), ("t_cda", "CDA $t$")]:391 cells = []392 for s_ in ["full", "large", "small", "sp500", "non_sp500"]:393 r = EB[b_].get(s_); cells.append(f"{r['horizons']['car_1y'][stat]:+.2f}" if (r and "car_1y" in r["horizons"] and stat == "HL_CAR_pct") else (f"{r['horizons']['car_1y'][stat]:.2f}" if r and "car_1y" in r["horizons"] else "--"))394 wi = " / ".join(f"{EB[b_][x]['horizons']['car_1y'][stat]:.2f}" if EB[b_].get(x) else "--" for x in ["large_within", "small_within"]); body += f"{l if stat == 'HL_CAR_pct' else ''} & {sl} & " + " & ".join(cells) + f" & {wi} \\\\\n"395 body += "\\addlinespace\n"396FF = RE["ff6_calendar_time"]; body += "(f) FF5 + MOM calendar-time, 250 days & $\\alpha \\times$ days (pp) & " + " & ".join(f"{FF[s_]['car_1y']['ff6_alpha_cum_pct']:+.2f}" if s_ in FF and "car_1y" in FF[s_] else "--" for s_ in ["full", "large", "small", "sp500", "non_sp500"]) + " & \\\\\n & HAC $t$ & " + " & ".join(f"{FF[s_]['car_1y']['ff6_t']:.2f}" if s_ in FF and "car_1y" in FF[s_] else "--" for s_ in ["full", "large", "small", "sp500", "non_sp500"]) + " & \\\\\n"397PS = RE["placebo_summary"]; PLN = RE["placebo_launches"]398body += "\\midrule\n" + panel(8, "Panel B: placebo launch dates (30 November of each year, same design, benchmark (a))") + "Launch year & Firms & \\multicolumn{2}{l}{Full: H$-$L (pp) / CDA $t$} & \\multicolumn{2}{l}{Largest 1,000: H$-$L / CDA $t$} & \\multicolumn{2}{l}{Remaining: H$-$L / CDA $t$} \\\\\n\\midrule\n"399for y in sorted(PS["HL_1y_by_launch_pct"]):400 if y in PLN: pl = PLN[y]; body += f"{y} & {n(pl['n_firms'])} & \\multicolumn{{2}}{{l}}{{{pl['full']['car_1y']['HL_CAR_pct']:+.1f} / {pl['full']['car_1y']['t_cda']:.2f}}} & \\multicolumn{{2}}{{l}}{{{pl['large']['car_1y']['HL_CAR_pct']:+.1f} / {pl['large']['car_1y']['t_cda']:.2f}}} & \\multicolumn{{2}}{{l}}{{{pl['small']['car_1y']['HL_CAR_pct']:+.1f} / {pl['small']['car_1y']['t_cda']:.2f}}} \\\\\n"401 else: body += f"{y} (ChatGPT) & {n(RE['n_firms'])} & \\multicolumn{{2}}{{l}}{{{PS['HL_1y_by_launch_pct'][y]:+.1f} / {PS['t_cda_by_launch'][y]:.2f}}} & \\multicolumn{{2}}{{l}}{{{base['large']['horizons']['car_1y']['HL_CAR_pct']:+.1f} / {base['large']['horizons']['car_1y']['t_cda']:.2f}}} & \\multicolumn{{2}}{{l}}{{{base['small']['horizons']['car_1y']['HL_CAR_pct']:+.1f} / {base['small']['horizons']['car_1y']['t_cda']:.2f}}} \\\\\n"402ME = RE["mht_event"]403table("tab_event_cda", "tab:eventcda", "Benchmark dependence of the one-year event-study gradient and placebo launch dates.",404 f"Panel A: the one-year High$-$Low abnormal return of the pre-launch AI terciles and its dependence-robust CDA $t$ under six benchmarks: the IWV market model of Table~\\ref{{tab:event}}, a beta-only adjustment, the market-adjusted return, a market model estimated over calendar 2021, a size $\\times$ momentum matched benchmark (5 $\\times$ 5 cells of the 2021-cohort panel) and a Fama--French five-factor-plus-momentum calendar-time regression of the daily High$-$Low portfolio (alpha $\\times$ 250 days, HAC $t$). Panel B: the same design re-run with a fictitious launch on 30 November of 2015--2021. Every cell is dependence-robust (daily High$-$Low portfolio).",405 "llrrrrrr", ["Benchmark & Statistic & Full & Largest 1,000 & Remaining & S\\&P 500 & Non-S\\&P & Within-size large / small"], body,406 f"The largest-1,000 gradient is significant only under the market models (a) and (d); under (b), (c), (e) and (f) its CDA $t$ is below 2, so the event-study evidence for a large-cap re-rating is benchmark-dependent and is reported as such. Holm-adjusted $p$ over the {ME['family_size']} sub-sample $\\times$ horizon CDA statistics of benchmark (a): smallest {min(ME['p_holm']):.3f} (BH: {min(ME['p_bh']):.3f}). The 2022 launch ranks {PS['rank_2022_by_HL']} of {PS['n_launches']} by full-sample H$-$L and {PS['rank_2022_by_t']} by CDA $t$ among the eight launch dates; the placebo $t$'s range over {min(PS['t_cda_by_launch'][y] for y in PS['t_cda_by_launch'] if y != '2022'):.2f} to {max(PS['t_cda_by_launch'][y] for y in PS['t_cda_by_launch'] if y != '2022'):.2f}. A book-to-market match was not run (book equity not in the panel). Source: results/r3k\\_v2/results\\_event.json.",407 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results_event.json (by_benchmark, ff6_calendar_time, placebo_launches, placebo_summary, mht_event)")408# ================================================================ T17 DiD + SPID (main) ====409Dd = R2["did"]; Pp = R2["spid"]410body = panel(5, "Panel A: difference-in-differences with firm and year fixed effects (treatment = pre-determined 2019--21 exposure)")411body += f"Treated (above-median exposure) $\\times$ post & {Dd['binary']['coef'] * 100:+.2f} & -- & {br(Dd['binary']['t'])} & -- \\\\\nContinuous exposure ($z$) $\\times$ post & {Dd['continuous']['coef'] * 100:+.2f} & -- & {br(Dd['continuous']['t'])} & -- \\\\\n\\multicolumn{{5}}{{@{{}}l}}{{\\quad $N$ = {n(Dd['binary']['n'])}; firm + year FE; two-way clustered}} \\\\\n\\midrule\n"412body += panel(5, "Panel B: pooled regressions of the forward return on the SPID project signal, the composite and their post-launch interactions")413for k, l in [("z_SPID_TECH", "SPID technology projects ($z$)"), ("spid_ai_any", "Any AI-initiative project (0/1)"), ("spid_tech_any", "Any technology project (0/1)")]:414 for v, vl_ in [(k, l), (f"{k}:post", l + " $\\times$ post"), ("z_AI_COMPOS", "AI composite ($z$)"), ("z_AI_COMPOS:post", "AI composite $\\times$ post"), ("post", "Post-launch cohorts")]:415 c = Pp[k]["terms"].get(v)416 if c: body += f"{vl_} & {c['coef_pct']:+.2f} & {br(c['t_firm'])} & {br(c['t_twoway'])} & {cip(c['ci95_firm_pct'], 2)} \\\\\n"417 body += f"\\multicolumn{{5}}{{@{{}}l}}{{\\quad $N$ = {n(Pp[k]['n'])}; design rank {Pp[k]['rank']} of {Pp[k]['rank']}; condition number {Pp[k]['cond']:.1f}}} \\\\\n\\addlinespace\n"418t17b = T17["spid_tech"]["base"]["coef"]["z_SPID_TECH:post"] if T17 else None419table("tab_did_spid", "tab:didspid", "Difference-in-differences on pre-determined exposure and the SPID project signal, Russell~3000.",420 "Panel A: forward return (within-year winsorized, pp) on the interaction of pre-determined AI exposure (firm mean of the composite over filing years 2019--2021, binary above-median or continuous) with the post-launch dummy, with firm and year fixed effects and two-way clustered $t$ (brackets); the event-time version with the reference year at zero is in Figure~\\ref{fig:eventtime} and Table~\\ref{tab:eventtime}. Panel B: pooled regressions with the explicit terms signal, post, signal $\\times$ post, composite, composite $\\times$ post, size and momentum (pp per SD, or pp per unit of the indicator); $t$-statistics clustered by firm and two-way by firm and cohort; 95\\% CI from the firm-clustered SE.",421 "lrrrr", ["Specification & Coefficient (pp) & [$t$ firm] & [$t$ firm$\\times$cohort] & 95\\% CI (firm)"], body,422 ("The committed v2.0 exhibit printed $t$ = 0.00 in every row of Panel B from a rank-deficient fit; " + (f"the refit of the committed panel (design rank {T17['spid_tech']['base']['rank']} of {T17['spid_tech']['base']['k']}, condition number {T17['spid_tech']['base']['cond']:.2f}, $N$ = {n(T17['spid_tech']['base']['n'])}) gives SPID $\\times$ post {t17b['coef_pct']:+.2f} pp [$t$ {t17b['t_firm']:.2f} firm / {t17b['t_twoway']:.2f} two-way]" if t17b else "the refit of the committed panel is in results/r3k\\_v2/t17\\_refit.json") +423 f", and the rebuilt panel above gives {Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['coef_pct']:+.2f} [{Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_firm']:.2f} / {Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_twoway']:.2f}]. The parallel-trends condition of Panel A is not satisfied (Table~\\ref{{tab:eventtime}}), so the DiD coefficients are descriptive, not causal. "424 f"The SPID measure is sparse (any-AI prevalence {R['spid']['share_firm_years_any_ai'] * 100:.1f}\\% of firm-years) and unvalidated; its minimum detectable effects are in Table~\\ref{{tab:spidbinary}}. Source: results/r3k\\_v2/results2.json (did, spid), t17\\_refit.json."),425 size="\\scriptsize", placement="main", sources="results/r3k_v2/results2.json (did, spid), t17_refit.json")426# ================================================================ SPID binary contrasts (main, new) ====427SB = Pp["binary_contrasts"]; body = ""428for flag, l in [("spid_ai_any", "Any AI-initiative project vs none"), ("spid_tech_any", "Any technology project vs none")]:429 body += panel(7, l)430 for per in ["full", "pre", "post"]:431 c = SB[flag][per]["cohort_w"]; body += f"{'Cohort level: mean of cohort differences' if per == 'full' else ''} & {per} & {f1(c['mean_pct'])} & {br(c['t_plain'])} & {cip(c['ci95_pct'])} & {c['mde_pct']:.1f} & {c['n_cohorts']} cohorts \\\\\n"432 for per in ["full", "pre", "post"]:433 f_ = SB[flag][per]["firm_w"]; body += f"{'Firm level: cohort FE, size, momentum' if per == 'full' else ''} & {per} & {f1(f_['coef_pct'])} & {br(f_['t_firm'])} & {cip(f_['ci95_pct'])} & {f_['mde_pct']:.1f} & {n(f_['n_treated'])} / {n(f_['n'])} \\\\\n"434 body += "\\addlinespace\n"435tc = Pp["tercile_nonzero_w"]; body += f"T3 $-$ T1 of project counts among firms with $>$ 0 technology projects & full & {f1(tc['mean_pct'])} & {br(tc['t_plain'])} & {cip(tc['ci95_pct'])} & -- & {tc['n_cohorts']} cohorts \\\\\n"436table("tab_spid_binary", "tab:spidbinary", "Binary contrasts on the SPID project signal with minimum detectable effects, Russell~3000.",437 f"Difference in the forward return (within-year winsorized, pp per year) between firm-years with and without a disclosed project, at the cohort level (mean of the cohort differences, plain $t$ and 95\\% $t$-interval over cohorts; cohorts enter only with at least 15 treated firms) and at the firm level (pooled regression with cohort fixed effects, size and momentum; firm-clustered $t$ and CI). MDE = minimum detectable effect at 80\\% power. Any-AI projects are present in {R['spid']['share_firm_years_any_ai'] * 100:.1f}\\% of firm-years ({R['spid']['share_post_any_ai'] * 100:.1f}\\% after the launch).",438 "llrrrrr", ["Contrast & Period & Estimate (pp) & [$t$] & 95\\% CI & MDE (pp) & Cohorts or treated / $N$"], body,439 f"Reading: every estimate is small relative to its MDE, so the design cannot distinguish a zero project premium from a premium of the size of the language premium (Table~\\ref{{tab:sortsboth}}); `no detectable premium' is the supportable statement. The legacy quintile sort on a variable whose median and P75 are zero (MDE {R['spid']['legacy_quintile_full_mde_pct']:.1f} pp at the cohort level) is kept only in Table~\\ref{{tab:sorts}}. Extractor provenance: gpt-4o-mini (FIRC-0001 pipeline snapshot), run 2026-10-27/28; a 200-mention human precision frame with source text was built (results/r3k\\_v2/validation/spid\\_sample.csv) but no human or LLM labels exist, so precision and the attenuation-corrected slope are not available. Source: results/r3k\\_v2/results2.json (spid.binary\\_contrasts).",440 size="\\scriptsize", colsep="2.5pt", placement="main", sources="results/r3k_v2/results2.json (spid.binary_contrasts, spid.tercile_nonzero_w), results.json (spid)")441# ================================================================ reversal + cyber (appendix, new) ====442RV = CK["reversal"]; CY = CK["cyber"]; body = panel(5, "Panel A: reversal tests (AI-washing alternative)")443for key, l in [("month_1_12_w", "High-language firms with vs without disclosed tech projects, months 1--12 (wins.)"), ("month_13_24_w", "same, months 13--24 (wins.)"), ("month_1_24_raw", "same, months 1--24 (raw)")]:444 c = RV["high_language_with_vs_without_projects"][key]; body += f"{pcell(1, 0.42, l)} & {f1(c['mean_pct'])} & {br(c['t'])} {br(c['t_plain'])} & {cip(c['ci95_pct'])} & {c['n_cohorts']} \\\\\n"445for key, l in [("w", "Composite Q5$-$Q1, months 13--24 (wins., cohorts $\\leq$ 2023)"), ("raw", "same, raw"), ("pre_w", "same, pre-launch cohorts (wins.)"), ("post_w", "same, post-launch cohorts 2022--23 (wins.)")]:446 c = RV["Q5_minus_Q1_month_13_24"][key]; body += f"{pcell(1, 0.42, l)} & {pp(c['mean'])} & {br(c['t'])} {br(c['t_plain'])} & {ci(c['ci95'])} & {c['n']} \\\\\n"447c = RV["Q5_minus_Q1_month_1_24"]["w"]; body += f"Composite Q5$-$Q1, months 1--24 (wins.) & {pp(c['mean'])} & {br(c['t'])} {br(c['t_plain'])} & {ci(c['ci95'])} & {c['n']} \\\\\n\\midrule\n" + panel(5, "Panel B: cybersecurity vocabulary")448LCN = "Cyber-neutral composite Q5$-$Q1 (quintiles within cybersecurity tercile), full (wins.)"; body += f"{pcell(1, 0.42, 'Correlation of the cybersecurity and composite $z$-scores')} & {CY['corr_cyber_composite']:.2f} & & & \\\\\n{pcell(1, 0.42, LCN)} & {pp(CY['cyberneutral_sort']['full_w']['mean'])} & {br(CY['cyberneutral_sort']['full_w']['t'])} {br(CY['cyberneutral_sort']['full_w']['t_plain'])} & {ci(CY['cyberneutral_sort']['full_w']['ci95'])} & {CY['cyberneutral_sort']['full_w']['n']} \\\\\n"449body += f"Cybersecurity Q5$-$Q1, full (wins.) [pre / post: {pp(CY['cyber_sort']['pre_w']['mean'])} / {pp(CY['cyber_sort']['post_w']['mean'])}] & {pp(CY['cyber_sort']['full_w']['mean'])} & {br(CY['cyber_sort']['full_w']['t'])} & {ci(CY['cyber_sort']['full_w']['ci95'])} & {CY['cyber_sort']['full_w']['n']} \\\\\n"450fc = CY["fm_compos_with_cyber_w"]; LFC = "Fama--MacBeth, composite with cybersecurity control (wins.): composite / cyber (pp/SD)"; body += f"{pcell(1, 0.42, LFC)} & {fc['z_AI_COMPOS']['mean_coef'] * 100:+.2f} / {fc['z_CYBER']['mean_coef'] * 100:+.2f} & {br(fc['z_AI_COMPOS']['t'])} {br(fc['z_CYBER']['t'])} & & {fc['n_years']} \\\\\n"451table("tab_reversal", "tab:reversal", "Reversal tests and the cybersecurity-vocabulary check, Russell~3000.",452 "Panel A: if AI language without projects were `AI washing', high-language firms without disclosed projects should earn less than those with projects, or the premium should reverse in the second year. Mean differences in forward returns (pp) with Newey--West and plain $t$ in brackets and 95\\% $t$-intervals over cohorts; the month 13--24 return is $(1 + r_{24}) / (1 + r_{12}) - 1$. Panel B: the composite sorted within terciles of the cybersecurity placebo score and a Fama--MacBeth regression with the cybersecurity score as a control.",453 "lrrrr", ["Test & Estimate (pp) & [NW $t$] [plain $t$] & 95\\% CI & $n$ cohorts"], body,454 f"High-language = top quintile of the composite within cohort; `with projects' = SPID technology-project mentions $>$ 0 ({n(RV['high_language_with_vs_without_projects']['n_high_language_with_projects'])} of {n(RV['high_language_with_vs_without_projects']['n_high_language'])} high-language firm-years). No reversal is detected, but the tests are low-powered (CIs span $\\pm$5 pp or more). Source: results/r3k\\_v2/results2.json (cluster\\_k).",455 size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results2.json (cluster_k)")456# ================================================================ MHT summary (main) + full (appendix, two parts) ====457FAM = [("sorts_full_w", "Full-sample spreads, Table~\\ref{tab:sortsboth} (EW and VW, five signals; wins.)"), ("sorts_pre_w", "Pre-launch spreads, same family"), ("sorts_post_w", "Post-launch spreads, same family"), ("forms_fm_w", "Form Fama--MacBeth slopes, Table~\\ref{tab:filingtype}"), ("robustness_pre_w", "Robustness rows, pre, Table~\\ref{tab:robust}"), ("robustness_post_w", "Robustness rows, post, Table~\\ref{tab:robust}")]458body = ""459for fam, fl in FAM:460 f_ = MR[fam]; comp = [i for i, m_ in enumerate(f_["members"]) if m_ in ("AI_COMPOS_EW", "baseline")]461 cp = f"{f_['p'][comp[0]]:.2f} / {f_['p_romano_wolf'][comp[0]]:.2f}" if comp else "--"462 hz = f_["hlz_t_gt_3"]; hz = int(sum(bool(v) for v in hz)) if isinstance(hz, list) else int(hz)463 body += f"{pcell(1, 0.36, fl)} & {f_['family_size']} & {min(f_['p']):.3f} & {min(f_['p_holm']):.3f} & {min(f_['p_bh']):.3f} & {min(f_['p_romano_wolf']):.3f} & {hz} & {cp} \\\\\n"464LP = "Factor $\\times$ post interactions, Table~\\ref{tab:placebo} (wild $p$)"; f_ = MR["placebo_interactions_yearcl"]; body += f"{pcell(1, 0.36, LP)} & {f_['family_size']} & {min(f_['p_wild_webb']):.3f} & {min(f_['p_holm_on_wild']):.3f} & {min(f_['p_bh_on_wild']):.3f} & {min(f_['p_romano_wolf']):.3f} & -- & -- \\\\\n"465LB = "Candidate break years, Table~\\ref{tab:cohorts} (bootstrap $p$)"; f_ = MR["break_dates_w"]; i22 = f_["members"].index("2022"); body += f"{pcell(1, 0.36, LB)} & {f_['family_size']} & {min(f_['p_boot']):.3f} & -- & -- & {min(f_['p_romano_wolf']):.3f} & -- & {f_['p_boot'][i22]:.2f} / {f_['p_romano_wolf'][i22]:.2f} (2022) \\\\\n"466LE = "Event-study CDA statistics, Table~\\ref{tab:eventcda}, benchmark (a)"; body += f"{pcell(1, 0.36, LE)} & {ME['family_size']} & {min(ME['p']):.3f} & {min(ME['p_holm']):.3f} & {min(ME['p_bh']):.3f} & -- & -- & -- \\\\\n"467SCv = R2["spec_curve"]468def mrow(l, v): return f"{pcell(1, 0.36, l)} & \\multicolumn{{7}}{{l}}{{{v}}} \\\\\n"469body += "\\midrule\n" + mrow(f"Deflated Sharpe ratio of the composite long--short ({DS['n_trials']} trials, SR hurdle {DS['full']['sr0_ann']:.2f}): full / pre / post", f"{DS['full']['dsr_prob']:.2f} / {DS['pre']['dsr_prob']:.2f} / {DS['post']['dsr_prob']:.2f}")470body += mrow(f"Specification curve, {SCv['n_specs']:,} specifications (Figure~\\ref{{fig:speccurve}}): positive / positive and NW-significant (plain) / negative and significant", f"{SCv['share_positive'] * 100:.0f}\\% / {SCv['share_positive_sig_nw'] * 100:.0f}\\% ({SCv['share_positive_sig_plain'] * 100:.0f}\\%) / {SCv['share_negative_sig_nw'] * 100:.1f}\\%")471body += mrow("Specification curve: median spread (pp) and interquartile range", f"{SCv['median_spread_pct']:+.1f} [{SCv['iqr_spread_pct'][0]:+.1f}, {SCv['iqr_spread_pct'][1]:+.1f}]")472def hzc(v): return int(sum(bool(x) for x in v)) if isinstance(v, list) else int(v)473body += mrow("Statistics meeting the Harvey--Liu--Zhu $|t| > 3$ hurdle across the cohort families", f"{sum(hzc(v) for v in MR['hlz_summary'].values())} of {sum(MR[k]['family_size'] for k in MR['hlz_summary'])}")474table("tab_mht", "tab:mht", "Multiple-testing adjustments by family of tests.",475 "For each family of tests reported in the paper: the family size, the smallest unadjusted $p$, the smallest Holm (family-wise) and Benjamini--Hochberg (false-discovery-rate) adjusted $p$, the smallest Romano--Wolf step-down $p$ (max-$t$ on shared bootstrap draws), the number of members with $|t| > 3$, and the unadjusted / Romano--Wolf $p$ of the headline member (the EW composite spread or the baseline row). The deflated Sharpe ratio and the specification curve summarize the search over long--short series and specifications.",476 "lrrrrrrr", ["Family & Size & min $p$ & min Holm & min BH & min RW & $|t| > 3$ & Headline $p$ / RW $p$"], body,477 "Cohort families: shared cohort-resampling bootstrap (9,999 draws) with recentred $t$-statistics; interaction family: shared Webb wild-cluster draws by cohort; event family: Holm and BH on the CDA $p$-values. Reading: no family contains a result that survives the Romano--Wolf adjustment except the cybersecurity interaction (Table~\\ref{tab:placebo}); the headline composite spread has a Romano--Wolf $p$ of " + f"{dict(zip(MR['sorts_full_w']['members'], MR['sorts_full_w']['p_romano_wolf']))['AI_COMPOS_EW']:.2f}" + " within its ten-member family. Member-level detail: Tables~\\ref{tab:mhtfull} and \\ref{tab:mhtfullb}. Source: results/r3k\\_v2/results2.json (mht, spec\\_curve), results\\_event.json (mht\\_event).",478 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results2.json (mht, spec_curve), results_event.json (mht_event)")479def member_label(m_): return m_.replace("z_AI_", "").replace("AI_", "AI ").replace("SPID_TECH", "SPID tech").replace("_EW", " EW").replace("_VW", " VW").replace("COMPOS", "composite").replace("ADOPT", "adoption").replace("INFRA", "infrastructure").replace("RISK", "disruption risk").replace("10k", "10-K").replace("10q", "10-Q").replace("8k", "8-K").replace("_", " ")480body = ""481for fam, fl in [("sorts_full_w", "Full-sample spreads, wins."), ("sorts_post_w", "Post-launch spreads, wins."), ("forms_fm_w", "Form FM slopes, wins.")]:482 f_ = MR[fam]; body += panel(6, f"{fl} (family size {f_['family_size']})")483 for i, m_ in enumerate(f_["members"]): body += f"{member_label(m_)} & {f_['t'][i]:.2f} & {f_['p'][i]:.3f} & {f_['p_holm'][i]:.3f} & {f_['p_bh'][i]:.3f} & {f_['p_romano_wolf'][i]:.3f} \\\\\n"484 body += "\\addlinespace\n"485table("tab_mht_full_a", "tab:mhtfull", "Member-level multiple-testing adjustments, part A: portfolio-sort and form families.",486 "Companion to Table~\\ref{tab:mht}: for every member of the sort and form families, the bootstrap $t$, the unadjusted $p$ and the Holm, Benjamini--Hochberg and Romano--Wolf adjusted $p$-values (shared cohort-resampling bootstrap, 9,999 draws, recentred statistics).",487 "lrrrrr", ["Member & $t$ & $p$ & Holm & BH & Romano--Wolf"], body, "Winsorized returns throughout. Source: results/r3k\\_v2/results2.json (mht).", size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results2.json (mht)")488body = ""489for fam, fl in [("robustness_pre_w", "Robustness rows, pre-launch, wins."), ("robustness_post_w", "Robustness rows, post-launch, wins.")]:490 f_ = MR[fam]; body += panel(6, f"{fl} (family size {f_['family_size']})")491 for i, m_ in enumerate(f_["members"]): body += f"{member_label(m_)} & {f_['t'][i]:.2f} & {f_['p'][i]:.3f} & {f_['p_holm'][i]:.3f} & {f_['p_bh'][i]:.3f} & {f_['p_romano_wolf'][i]:.3f} \\\\\n"492 body += "\\addlinespace\n"493f_ = MR["placebo_interactions_yearcl"]; body += panel(6, f"Factor $\\times$ post interactions, cohort-clustered (family size {f_['family_size']}; $p$ = wild-cluster bootstrap)")494for i, m_ in enumerate(f_["members"]): body += f"{m_} & {f_['t_year'][i]:.2f} & {f_['p_wild_webb'][i]:.3f} & {f_['p_holm_on_wild'][i]:.3f} & {f_['p_bh_on_wild'][i]:.3f} & {f_['p_romano_wolf'][i]:.3f} \\\\\n"495body += "\\addlinespace\n"; f_ = MR["break_dates_w"]; body += panel(6, f"Candidate break years, post $-$ pre mean spread, wins. (family size {f_['family_size']}; $t$ = bootstrap SE, $p$ = bootstrap)")496for i, m_ in enumerate(f_["members"]): body += f"{m_} ({f_['diff_pct'][i]:+.1f} pp) & {f_['t_boot_se'][i]:.2f} & {f_['p_boot'][i]:.3f} & -- & -- & {f_['p_romano_wolf'][i]:.3f} \\\\\n"497table("tab_mht_full_b", "tab:mhtfullb", "Member-level multiple-testing adjustments, part B: robustness rows, placebo interactions and break years.",498 "Companion to Table~\\ref{tab:mht}: member-level unadjusted and adjusted $p$-values for the robustness families, the eight factor $\\times$ post interactions (shared Webb wild-cluster draws by cohort) and the ten candidate break years (cohort bootstrap).",499 "lrrrrr", ["Member & $t$ & $p$ & Holm & BH & Romano--Wolf"], body, "Winsorized returns throughout. Source: results/r3k\\_v2/results2.json (mht).", size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results2.json (mht)")500# ================================================================ event-time (appendix, new) ====501ET = {r["year"]: r for r in R2["did_eventtime"]["rows"]}; ETt = {r["year"]: r for r in R2["did_eventtime_trailing"]["rows"]}; body = ""502for y in sorted(ET): r = ET[y]; t_ = ETt.get(y, {}); body += f"{y}{' (reference)' if y == R2['did_eventtime']['ref'] else ''} & {r['abs_slope'] * 100:+.1f} & ({r['abs_se'] * 100:.1f}) & {r['diff_from_ref'] * 100:+.1f} & ({r['diff_se'] * 100:.1f}) & {t_.get('diff_from_ref', 0) * 100:+.1f} & ({t_.get('diff_se', 0) * 100:.1f}) \\\\\n"503table("tab_eventtime", "tab:eventtime", "Event-time profile of the premium on pre-determined AI exposure, Russell~3000.",504 f"Slope of the forward return (within-year winsorized, pp per SD) on pre-determined AI exposure by outcome cohort, with firm-clustered standard errors in parentheses. The first pair of columns reproduces the committed coding (interaction without a main effect, which estimates one absolute slope per cohort); the second pair restores the main effect so that the coefficients are differences from the {R2['did_eventtime']['ref']} reference cohort (zero by construction); the third pair replaces the 2019--21 exposure by the mean composite over the three years before each outcome year.",505 "lrrrrrr", ["Outcome cohort & \\multicolumn{2}{c}{Committed coding: absolute slope} & \\multicolumn{2}{c}{Difference from reference} & \\multicolumn{2}{c}{Trailing exposure: difference}", "\\cmidrule(lr){2-3}\\cmidrule(lr){4-5}\\cmidrule(lr){6-7} & (pp/SD) & (SE) & (pp/SD) & (SE) & (pp/SD) & (SE)"], body,506 f"Reference-cohort slope with the main effect restored: {R2['did_eventtime']['base_slope_ref_year'] * 100:+.1f} pp/SD ($t$ {R2['did_eventtime']['base_t']:.2f}); $N$ = {n(R2['did_eventtime']['n'])} (trailing: {n(R2['did_eventtime_trailing']['n'])}). With the 2019--21 exposure, cohorts before 2019 interact future language with past outcomes (look-back selection, not a pre-trend test). The pre-launch differences are not zero, so the parallel-trends condition behind Table~\\ref{{tab:didspid}} Panel A fails and the post-launch coefficients are relative to a reference year that itself carried the largest slope. Plotted with 95\\% CIs in Figure~\\ref{{fig:eventtime}}. Source: results/r3k\\_v2/results2.json (did\\_eventtime, did\\_eventtime\\_trailing).",507 size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results2.json (did_eventtime*)")508# ================================================================ attrition / survivorship (main, new) ====509AP = RS["attrition_pivot_absent_share"]; AE = RS["annualised_exit_rate"]; att = pd.DataFrame(RS["attrition"]); allrow = att[att.tercile == "all"].set_index("asof")510body = panel(7, "Panel A: share of then-IWV constituents absent from the 28 August 2025 holdings, by market-value tercile within the snapshot")511body += " & ".join(H(c_) for c_ in ["IWV holdings as of", "Small", "Mid", "Large", "All", "Annualised exit, small / large", "Then-members in the panel"]) + " \\\\\n\\midrule\n"512for a in sorted(AP): body += f"{a[:4]}-{a[4:6]}-{a[6:]} & {AP[a]['small'] * 100:.1f}\\% & {AP[a]['mid'] * 100:.1f}\\% & {AP[a]['large'] * 100:.1f}\\% & {allrow.loc[a, 'absent_2026_share'] * 100:.1f}\\% & {(f'{AE[a]['small'] * 100:.1f}' if a in AE and AE[a].get('small') is not None else '--')} / {(f'{AE[a]['large'] * 100:.1f}' if a in AE and AE[a].get('large') is not None else '--')}\\% & {allrow.loc[a, 'in_panel_share'] * 100:.1f}\\% \\\\\n"513body += "\\midrule\n" + panel(7, "Panel B: composite Q5$-$Q1 spread (wins., pp) for all panel firms vs the firms that were IWV members at formation") + " & ".join(H(c_) for c_ in ["Cohort", "Snapshot", "Members then", "Spread, all", "Spread, members", "Mean return, members", "Mean return, non-members"]) + " \\\\\n\\midrule\n"514for y, v in TM.items(): body += f"{y} & {v['snapshot'][:4]}-{v['snapshot'][4:6]} & {v['share_member_then'] * 100:.0f}\\% & {pp(v['spread_all_w'])} & {pp(v['spread_members_w'])} & {pp(v['mean_fwd_members'])}\\% & {pp(v['mean_fwd_nonmembers']) if v['mean_fwd_nonmembers'] is not None else '--'}\\% \\\\\n"515EI = RS["ew_vs_index"]; BD = RS["bounding"]; body += "\\midrule\n" + panel(7, "Panel C: survivor signature at the level and bounding of the spread (pp per year)")516def crow(l, v): return f"{pcell(1, 0.3, l)} & \\multicolumn{{6}}{{l}}{{{v}}} \\\\\n"517body += crow("EW panel return minus IWV total return: all firms, raw / wins.\\ / median", f"{EI['mean_gap_all_minus_iwv_pp']:+.1f} / {EI['mean_gap_all_w_minus_iwv_pp']:+.1f} / {EI['mean_gap_median_minus_iwv_pp']:+.1f}")518body += crow("\\quad largest 1,000 minus IWV / remaining minus IWM / S\\&P members minus IWV", f"{EI['mean_gap_large_minus_iwv_pp']:+.1f} / {EI['mean_gap_small_minus_iwm_pp']:+.1f} / {EI['mean_gap_sp500_minus_iwv_pp']:+.1f}") + crow("\\quad pre-launch cohorts / post-launch cohorts", f"{EI['mean_gap_pre_pp']:+.1f} / {EI['mean_gap_post_pp']:+.1f}")519body += crow(f"Q1 $-$ Q5 exit-rate difference needed to generate the whole spread ({BD['observed_full_spread_w'] * 100:+.1f} pp, wins.), exit return $-$30 / $-$50 / $-$70 / $-$100\\%", " / ".join(f"{v * 100:.1f}" for v in BD["required_exit_rate_difference_e1_minus_e5"].values()) + " pp/yr")520body += crow("Measured small-minus-large annualised exit rate, largest gap across snapshots", f"{BD['max_measured_small_minus_large_exit_rate'] * 100:.1f} pp/yr") + crow("Forward-volatility gradient of the composite sort, Q5 $-$ Q1 (annualized SD)", f"{BD['fwd_vol_gradient_Q5_minus_Q1'] * 100:+.1f} pp")521table("tab_attrition", "tab:attrition", "Survivorship diagnostics on the current-membership universe, Russell~3000.",522 f"Panel A: for each of the {len(RS['snapshots'])} dated IWV holdings files captured by the Internet Archive, the share of then-constituents no longer held on 28 August 2025 (absent = ISIN/CUSIP not in the 2025 holdings and ticker not in the 2026 universe), by market-value tercile within the snapshot, the implied annualised exit rates of the small and large terciles, and the share of then-constituents present in the estimation panel. Panel B: the composite spread of each cohort computed on all panel firms and on the firms that were IWV members at formation. Panel C: the equal-weighted panel return against the index total return, and the exit-rate difference between the bottom and top AI quintiles that survivorship would need to generate the entire observed spread.",523 "lrrrrrr", [], body,524 "No capture exists between 2007 and May 2019, so the then-member comparison covers cohorts 2018--2024 only; for 2010--2017 the entry-side checks of Table~\\ref{tab:robust} are the only executable diagnostics. Delisted firms have no AI scores in any artefact, so attrition by AI quintile (the test the editor asked for) cannot be computed on this corpus; the small-tercile exit rate is two to four times the large-tercile rate, and the forward-volatility gradient shows that Q5 firms are riskier, so the small-firm pre-launch premium is reported as conditional on survival to October 2026. Bounding logic: if exiting firms earn $r_x$ and are dropped, the survivor spread overstates the true spread by $(e_1 - e_5)(\\bar r_{\\text{surv}} - r_x)$. Source: results/r3k\\_v2/results\\_surv.json; captures listed in iwv\\_holdings\\_manifest.json.",525 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results_surv.json (attrition, then_members_present, ew_vs_index, bounding), iwv_holdings_manifest.json")526# ================================================================ construct validity (main, new) ====527if RC:528 sg = RC["signals"]; body = panel(7, "Panel A: alternative measures of AI language (same panel, same return)")529 for key, l in [("z_AI_COMPOS", "AI composite (baseline)"), ("z_KW", "Keyword baseline (core AI terms per 1,000 words)"), ("z_KWlog", "Keyword baseline, $\\log(1 + x)$"), ("z_ALT", "Stripped-anchor composite"), ("z_ALTcore", "Core-AI adoption anchor"), ("z_CYBERstrip", "Cyber anchor stripped of AI terms")]:530 v = sg[key]; body += f"{pcell(1, 0.28, l)} & {v['spearman_with_composite']:.2f} & {pp(v['full_w']['mean'])} & {br(v['full_w']['t'])} {br(v['full_w']['t_plain'])} & {ci(v['full_w']['ci95'])} & {v['fm_w']['slope_pct']:+.2f} {br(v['fm_w']['t'])} & {v['fm']['slope_pct']:+.2f} {br(v['fm']['t'])} \\\\\n"531 ux = RC["ex_utilities_energy"]; LUX = f"Composite ex Utilities and Energy ($N$ = {n(ux['n'])})"; body += f"{pcell(1, 0.28, LUX)} & -- & {pp(ux['full_w']['mean'])} & {br(ux['full_w']['t'])} {br(ux['full_w']['t_plain'])} & {ci(ux['full_w']['ci95'])} & {ux['fm_w']['slope_pct']:+.2f} {br(ux['fm_w']['t'])} & {ux['fm']['slope_pct']:+.2f} {br(ux['fm']['t'])} \\\\\n"532 hw = RC["horse_race_w"]; body += "\\midrule\n" + panel(7, "Panel B: Fama--MacBeth horse races (wins., pp per SD [NW $t$])")533 body += f"{pcell(1, 0.3, 'Composite vs keyword baseline')} & \\multicolumn{{6}}{{l}}{{composite {hw['composite_vs_keyword']['z_AI_COMPOS']['slope_pct']:+.2f} {br(hw['composite_vs_keyword']['z_AI_COMPOS']['t'])}; keyword {hw['composite_vs_keyword']['z_KW']['slope_pct']:+.2f} {br(hw['composite_vs_keyword']['z_KW']['t'])}}} \\\\\n{pcell(1, 0.3, 'Composite vs stripped-anchor composite')} & \\multicolumn{{6}}{{l}}{{composite {hw['composite_vs_stripped']['z_AI_COMPOS']['slope_pct']:+.2f} {br(hw['composite_vs_stripped']['z_AI_COMPOS']['t'])}; stripped {hw['composite_vs_stripped']['z_ALT']['slope_pct']:+.2f} {br(hw['composite_vs_stripped']['z_ALT']['t'])}}} \\\\\n"534 body += "\\midrule\n" + panel(7, "Panel C: encoder truncation and lexical content of the score (node audit of the stored chunks and embeddings)")535 def vrow(l, v): return f"{pcell(1, 0.28, l)} & \\multicolumn{{6}}{{l}}{{{v}}} \\\\\n"536 if TA:537 fr = TA["frames"]; fk = max(fr, key=lambda k_: fr[k_]["n"]); f0 = fr[fk]538 body += vrow("Encoder window (tokens) / chunk length (words) / median tokens per chunk", f"{TA['max_seq_length']} / 512 / {f0['tokens_median']:.0f}")539 body += vrow(f"Chunks truncated (frame {fk}, $n$ = {n(f0['n'])}) / median words read / share of token mass dropped", f"{f0['share_truncated'] * 100:.1f}\\% / {f0['words_in_window_median']:.0f} / {f0['share_of_token_mass_dropped'] * 100:.0f}\\%")540 if f0.get("hits_total"): body += vrow("AI keyword occurrences beyond the encoder window", f"{f0['hits_beyond_window'] / f0['hits_total'] * 100:.0f}\\% of {n(f0['hits_total'])}")541 body += vrow("Spearman correlation of the keyword baseline with the composite / firm-years with zero core AI hits", f"{sg['z_KW']['spearman_with_composite']:.2f} / {sg['z_KW']['share_zero'] * 100:.0f}\\%")542 body += vrow("Utilities: share of top-quintile firm-years vs share of the sample", f"{RC['utilities_share_q5_vs_all'][0] * 100:.1f}\\% vs {RC['utilities_share_q5_vs_all'][1] * 100:.1f}\\%")543 table("tab_construct_validity", "tab:constructvalidity", "Construct validity of the semantic AI score: keyword baseline, stripped anchors, sector composition and encoder truncation.",544 "Panel A: the composite and five alternative measures scored on the same firm-years: Spearman correlation with the composite, equal-weighted full-sample Q5$-$Q1 spreads (within-year winsorized, pp per year; [NW $t$] [plain $t$] and 95\\% CI over cohorts) and Fama--MacBeth slopes with controls (pp per SD, [NW $t$]) on winsorized and raw returns. The stripped anchors re-score the stored chunk embeddings against anchor texts without the cybersecurity and automation vocabulary (no corpus re-embedding). Panel B: horse races. Panel C: what the encoder actually reads and how much of the score is lexical.",545 "lrrrrrr", ["Signal & $\\rho$ with composite & Full Q5$-$Q1, wins. & [NW $t$] [plain $t$] & 95\\% CI & FM slope, wins. [NW $t$] & FM slope, raw [NW $t$]"], body,546 "Keyword baseline = core AI terms (published AI lexicons) per 1,000 words of the section texts, computed on the node audit (code/n1); the keyword and semantic measures agree weakly, and the keyword measure carries a similar sort spread but a weaker regression slope. The encoder reads roughly the first 200 words of each 512-word chunk, so the score is a function of chunk openings; re-chunking to the encoder window (X4) was not executed and the consequences for the premium are unknown. No human- or LLM-labelled validation sample exists: the 1,700-chunk coding frames and codebook were delivered without labels (results/n1/validation\\_*), so precision and recall of the score are not measured. $N$ = " + n(sg["z_AI_COMPOS"]["n"]) + " firm-years in Panel A. Source: results/r3k\\_v2/results\\_construct.json, results/n1/tokenizer\\_audit.json, keyword\\_baseline.json.",547 size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results_construct.json, results/n1/tokenizer_audit.json, results/n1/keyword_baseline.json")548# ================================================================ corr, top firms, coverage, corpus (appendix / main) ====549c = pd.read_csv(f"{T}/t1b_correlations.csv", index_col=0); lab2 = {"z_AI_ADOPT": "AI adoption", "z_AI_INFRA": "AI infrastructure", "z_AI_RISK": "AI disruption risk", "z_AI_PC1": "PC1", "z_SPID_TECH": "SPID tech projects", "z_CYBER": "Cybersecurity", "z_size": "Size", "z_mom": "Momentum", "fwd_ret": "Forward return"}550lab2s = {"z_AI_ADOPT": "Adopt", "z_AI_INFRA": "Infra", "z_AI_RISK": "Risk", "z_AI_PC1": "PC1", "z_SPID_TECH": "SPID", "z_CYBER": "Cyber", "z_size": "Size", "z_mom": "Mom", "fwd_ret": "Fwd ret"}; cols_ = list(c.columns); body = ""551for i_, rname in enumerate(c.index): body += lab2[rname] + " & " + " & ".join(f"{c.loc[rname, cc]:.2f}" if j_ <= i_ else "" for j_, cc in enumerate(cols_)) + " \\\\\n"552table("tab_corr", "tab:corr", "Correlations of the within-year standardized variables.", f"Pearson correlations over the {NOBS} firm-years of the estimation sample; signals and controls standardized within formation year; the forward return is the raw twelve-month return.",553 "l" + "r" * len(cols_), [" & " + " & ".join(lab2s[x] for x in cols_)], body, "Column headers abbreviate the row labels (Adopt = AI adoption, Infra = AI infrastructure, Risk = AI disruption risk, SPID = SPID tech projects, Mom = momentum, Fwd ret = forward return). The three AI facets are highly correlated with each other (and with PC1) and weakly with the SPID project count, which is a count variable with a zero median. Source: results/r3k\\_v2/t1b\\_correlations.csv.", size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/t1b_correlations.csv")554def company_case(s_):555 s_ = str(s_); t_ = s_.title() if s_.isupper() else s_; return " ".join(w.upper() if w.upper() in ("IBM", "HPE", "AI", "C3", "AI,", "C3.AI", "LLC", "INC", "INC.", "PLC") else w for w in t_.split())556tf = df.groupby(["ticker", "company_name", "sector"]).agg(z=("z_AI_COMPOS", "mean"), yrs=("fiscal_year", "count")).reset_index(); tf = tf[tf.yrs >= 5].nlargest(12, "z"); body = ""557for r_ in tf.itertuples(): body += f"{r_.ticker} & {tex(company_case(r_.company_name))[:40]} & {r_.sector} & {r_.z:.2f} & {r_.yrs} \\\\\n"558table("tab_topfirms", "tab:topfirms", "Firms with the highest average AI composite.", "Mean within-year standardized composite over the firm's formation cohorts, for firms with at least five cohorts; the twelve highest of the " + NFIRMS + " firms.",559 "lllrr", ["Ticker & Company & GICS sector & Mean composite ($z$) & Cohorts"], body, "Two electric utilities appear in the list; Table~\\ref{tab:constructvalidity} shows that their composite rests on data-centre and infrastructure vocabulary rather than on AI keywords. Company names as in the SEC company index. Source: analysis\\_panel\\_v2.parquet.", placement="appendix", sources="data/processed_r3k_v2/analysis_panel_v2.parquet")560cv = R2["coverage"]; body = ""561for y in cv["firms_per_cohort"]: body += f"{y} & {n(cv['firms_per_cohort'][y])} & {n(cv['n_large'][y])} & {n(cv['n_small'][y])} & {n(cv['n_nocap'][y])} & {n(cv['n_large_pct42'][y])} & {n(cv['n_sp500'][y])} & {cv['median_filings'][y]:.0f} & {cv['median_chunks'][y]:.0f} \\\\\n"562table("tab_coverage", "tab:coverage", "Estimation sample by formation cohort: firms, size groups and text coverage.", "Number of firms with a valid forward return in each formation cohort, the size-group counts under the two partitions (largest 1,000 at formation on the corrected capitalization; largest 42\\% within cohort), the firm-years without a capitalization, the S\\&P~500 members, and the median number of scored filings and text chunks per firm-year.",563 "lrrrrrrrr", ["Cohort & Firms & Largest 1,000 & Remaining & No cap & Largest 42\\% & S\\&P 500 & Median filings & Median chunks"], body,564 f"The panel grows from {n(cv['firms_per_cohort'][min(cv['firms_per_cohort'])])} firms in {min(cv['firms_per_cohort'])} to {n(cv['firms_per_cohort'][max(cv['firms_per_cohort'])])} in {max(cv['firms_per_cohort'])} because the universe is the October 2026 membership: early cohorts contain only the firms that survived to 2026 (Table~\\ref{{tab:attrition}}). Under the top-1,000 partition the `remaining' group has {n(cv['n_small'][min(cv['n_small'])])} firms in {min(cv['n_small'])} (quintiles of about {int(cv['n_small'][min(cv['n_small'])]) // 5} firms); the 42\\% partition keeps the group shares constant. Rank autocorrelation of the composite: lag 1 {cv['rank_autocorr_lag1']:.2f}, lag 5 {cv['rank_autocorr_lag5']:.2f}. Source: results/r3k\\_v2/results2.json (coverage).",565 size="\\scriptsize", placement="appendix", sources="results/r3k_v2/results2.json (coverage)")566fl = pd.read_parquet("data/raw_russell3000/filings"); body = ""567for fm_ in ["10-K", "10-Q", "8-K"]:568 sub = fl[fl.form_type == fm_]; tag = {"10-K": "n_10k", "10-Q": "n_10q", "8-K": "n_8k"}[fm_]; body += f"{fm_} & {n(len(sub))} & {n(sub.cik.nunique())} & {n((sub.parse_status == 'complete').sum())} & {df[tag].notna().mean() * 100:.1f}\\% \\\\\n"569body += f"\\midrule\nTotal & {n(len(fl))} & {n(fl.cik.nunique())} & {n((fl.parse_status == 'complete').sum())} & \\\\\n"570table("tab_corpus", "tab:corpus", "Corpus composition by form.", f"Filings of the {n(fl.cik.nunique())} issuers of the universe (S\\&P~500 constituents and iShares Russell~3000 holdings) indexed in the EDGAR Research Database for 2010--2026, the number parsed into sections and 512-word chunks, and the share of the {NOBS} estimation firm-years whose signal includes at least one scored filing of that form.",571 "lrrrr", ["Form & Filings 2010--2026 & Issuers & Parsed & Firm-years with a scored filing"], body,572 "Filings index: data/raw\\_russell3000/filings." + (f" Node audit of the parquet copy (results/n1): {n(N1['targets']['chunks'])} chunks, {n(N1['targets']['sections'])} sections, {n(N1['targets']['filings'])} filings; " if N1 and "targets" in N1 else " ") + (f"median chunk length {N1['chunk_word_count']['med']:.0f} words, {N1['chunk_word_count']['share_eq512'] * 100:.1f}\\% of chunks at the 512-word cap. " if N1 and "chunk_word_count" in N1 else "") + "The encoder reads only the first 256 tokens of each chunk (Table~\\ref{tab:constructvalidity}). Unparsed filings are parser errors or files missing on disk.",573 placement="main", sources="data/raw_russell3000/filings, results/n1/corpus_counts.json")574# ================================================================ hygiene + BEFORE/AFTER (appendix) ====575hl = pd.read_csv(f"{T}/hygiene_log.csv"); body = panel(6, "Panel A: price splices removed after the second-source check")576body += "Ticker & Window & Yahoo return & FinData return & FinData first bar & Verdict \\\\\n\\midrule\n"577for r_ in hl[hl.verdict != "confirmed"].sort_values(["kind", "ticker"]).itertuples(): body += f"{r_.ticker} & {r_.date} & {r_.yahoo_ret * 100:+.0f}\\% & {('--' if pd.isna(r_.findata_ret) else f'{r_.findata_ret * 100:+.0f}\\%')} & {r_.findata_first_bar if isinstance(r_.findata_first_bar, str) else '--'} & {r_.verdict.replace('_', ' ')} \\\\\n"578body += "\\midrule\n" + panel(6, f"Panel B: headline statistics before (committed v2.0, HEAD {BASELINE}) and after the corrections") + "Statistic & \\multicolumn{2}{l}{BEFORE (committed v2.0)} & \\multicolumn{3}{l}{AFTER (rebuilt panel): raw $\\rightarrow$ winsorized / robust} \\\\\n\\midrule\n"579S = R["sorts"]; S0 = RB["sorts"] if RB else None; FM0 = RB["fama_macbeth"]["compos"]["z_AI_COMPOS"] if RB else None; SP0 = RB["subperiod_spread"]["AI_COMPOS"] if RB else None; G0 = RB["groups"] if RB else None580def ba(l, before, after): return f"{pcell(1, 0.25, l)} & {pcell(2, 0.19, before)} & {pcell(3, 0.39, after)} \\\\\n"581if RB:582 body += ba("Panel: firm-years / firms / no capitalization", f"{n(META['n_estimation_sample_v1'])} / {n(RB['n_firms'])} / {n(META['n_est_without_cap_v1'])}", f"{NOBS} / {NFIRMS} / {n(META['n_est_without_cap'])}")583 def lr(v): return "$-\\infty$" if v is None or (isinstance(v, float) and np.isinf(v)) else f"{v:.1f}"584 body += ba("log capitalization range (min, max)", f"[{lr(MD['log_cap_min_max_v1'][0])}, {lr(MD['log_cap_min_max_v1'][1])}]", f"[{lr(MD['log_cap_min_max_v2'][0])}, {lr(MD['log_cap_min_max_v2'][1])}]")585 body += ba("AAPL capitalization, June 2011 (USD bn; rank)", f"{MD['AAPL_cohort2010_cap_v1_usd'] / 1e9:.1f} (rank {MD['AAPL_cohort2010_rank_v1']:.0f})", f"{MD['AAPL_cohort2010_cap_v2_usd'] / 1e9:.0f} (rank {MD['AAPL_cohort2010_rank_v2']:.0f})")586 body += ba("Max single-firm VW weight in a cohort $\\times$ quintile, all nine VW sorts (raw and wins.\\ variants); entries $>$ 25\\%", f"{VD['max_single_firm_weight_v1'] * 100:.1f}\\% ({VWALL1['ticker']}); {VD['n_cells_above_25pct_v1']}", f"{VD['max_single_firm_weight_v2'] * 100:.0f}\\% ({VWALL['sort']} sort, {vwcell(VWALL)}); {VD['n_cells_above_25pct_v2']}")587 body += ba("Max single-firm VW weight in a cohort $\\times$ quintile, composite sort; cells $>$ 25\\%", f"{VWCOMP1['max'] * 100:.1f}\\% ({VWCOMP1['ticker']}); {VWCOMP1['n_above']}", f"{VWCOMP['max'] * 100:.0f}\\% ({vwcell(VWCOMP)}); {VWCOMP['n_above']}")588 body += ba("EW composite Q5$-$Q1, full (pp) [NW $t$]", f"{pp(S0['AI_COMPOS_EW']['Q5_minus_Q1'])} [{tv(S0['AI_COMPOS_EW']['t_stat'])}]", f"{pp(S['AI_COMPOS_EW']['Q5_minus_Q1'])} [{tv(S['AI_COMPOS_EW']['t_stat'])}] $\\rightarrow$ {pp(S['AI_COMPOS_EW_w']['Q5_minus_Q1'])} [{tv(S['AI_COMPOS_EW_w']['t_stat'])}; plain {tv(S['AI_COMPOS_EW_w']['t_plain'])}], CI {ci(S['AI_COMPOS_EW_w']['ci95'])}; median {pp(S['AI_COMPOS_EW_med']['Q5_minus_Q1'])} [{tv(S['AI_COMPOS_EW_med']['t_stat'])}]")589 body += ba("VW composite: Q1 / Q5 / Q5$-$Q1 [NW $t$]", f"{pp(S0['AI_COMPOS_VW']['Q1'])} / {pp(S0['AI_COMPOS_VW']['Q5'])} / {pp(S0['AI_COMPOS_VW']['Q5_minus_Q1'])} [{tv(S0['AI_COMPOS_VW']['t_stat'])}]", f"{pp(S['AI_COMPOS_VW']['Q1'])} / {pp(S['AI_COMPOS_VW']['Q5'])} / {pp(S['AI_COMPOS_VW']['Q5_minus_Q1'])} [{tv(S['AI_COMPOS_VW']['t_stat'])}] $\\rightarrow$ wins.\\ {pp(S['AI_COMPOS_VW_w']['Q5_minus_Q1'])} [{tv(S['AI_COMPOS_VW_w']['t_stat'])}]")590 body += ba("Fama--MacBeth composite slope (pp/SD) [NW $t$]", f"{FM0['mean_coef'] * 100:+.2f} [{tv(FM0['t'])}]", f"{FM['compos']['z_AI_COMPOS']['mean_coef'] * 100:+.2f} [{tv(FM['compos']['z_AI_COMPOS']['t'])}] $\\rightarrow$ {FM['compos_w']['z_AI_COMPOS']['mean_coef'] * 100:+.2f} [{tv(FM['compos_w']['z_AI_COMPOS']['t'])}; plain {tv(FM['compos_w']['z_AI_COMPOS']['t_plain'])}], CI {ci(FM['compos_w']['z_AI_COMPOS']['ci95'], 2)}")591 body += ba("Pre / post composite spread (pp)", f"{pp(SP0['pre']['mean'])} [{tv(SP0['pre']['t'])}] / {pp(SP0['post']['mean'])} [{tv(SP0['post']['t'])}, $n$ = 3]", f"{pp(SP['AI_COMPOS']['pre']['mean'])} / {pp(SP['AI_COMPOS']['post']['mean'])} $\\rightarrow$ wins.\\ {pp(SP['AI_COMPOS']['pre_w']['mean'])} {ci(SP['AI_COMPOS']['pre_w']['ci95'])} / {pp(SP['AI_COMPOS']['post_w']['mean'])} {ci(SP['AI_COMPOS']['post_w']['ci95'])}")592 body += ba("Pooled post Q5 vs Q1 (pp) [$t$ firm / two-way]", (lambda q: f"{q['coef_pct']:+.1f} [{q.get('t_firm', q.get('t', float('nan'))):.2f} / --]")(RB2['cohorts']['pooled_post']) if RB2 and "pooled_post" in RB2.get("cohorts", {}) else "--", f"{PO['post']['coef_pct']:+.1f} [{PO['post']['t_firm']:.2f} / {tv(PO['post']['t_twoway'])}] $\\rightarrow$ wins.\\ {PO['post_w']['coef_pct']:+.1f} [{PO['post_w']['t_firm']:.2f} / {tv(PO['post_w']['t_twoway'])}], wild $p$ {pv(PO['post_w']['p_wild_webb'])}")593 body += ba("Largest 1,000: pre / post spread (pp)", f"{pp(G0['large_top1000']['pre']['mean'])} / {pp(G0['large_top1000']['post']['mean'])}", f"{pp(G['large_top1000']['pre']['mean'])} / {pp(G['large_top1000']['post']['mean'])} $\\rightarrow$ wins.\\ {pp(G['large_top1000']['pre_w']['mean'])} / {pp(G['large_top1000']['post_w']['mean'])}; ex-2024 pooled {G['large_top1000']['pooled_post_excl_2024_w']['coef_pct']:+.1f} [{G['large_top1000']['pooled_post_excl_2024_w']['t_firm']:.2f}]")594 body += ba("Remaining firms: pre / post spread (pp)", f"{pp(G0['small_rest']['pre']['mean'])} / {pp(G0['small_rest']['post']['mean'])}", f"{pp(G['small_rest']['pre']['mean'])} / {pp(G['small_rest']['post']['mean'])} $\\rightarrow$ wins.\\ {pp(G['small_rest']['pre_w']['mean'])} / {pp(G['small_rest']['post_w']['mean'])}")595 body += ba("Large-vs-small post-launch contrast (pp) [$t$ firm / two-way; wild $p$]", "not tested", f"{cl['coef_pct']:+.1f} [{cl['t_firm']:.2f} / {tv(cl['t_twoway'])}; {cl['p_wild_webb']:.2f}], MDE {cl['mde_pct_firm']:.1f}")596 body += ba("Within-sector FM slope, full (pp/SD) [NW $t$]", f"{RB2['sector_controls']['fm_full']['slope_sector_pct']:+.2f} [{RB2['sector_controls']['fm_full']['t_sector']:.2f}]" if RB2 else "--", f"{Lc['fm_all_raw_sector_full']['slope_pct']:+.2f} [{tv(Lc['fm_all_raw_sector_full']['t_nw'])}; plain {tv(Lc['fm_all_raw_sector_full']['t_plain'])}] $\\rightarrow$ wins.\\ {Lc['fm_all_w_sector_full']['slope_pct']:+.2f} [{tv(Lc['fm_all_w_sector_full']['t_nw'])}; plain {tv(Lc['fm_all_w_sector_full']['t_plain'])}]; sector-neutral sort {pp(SN['full_w']['mean'])} [{tv(SN['full_w']['t'])}]")597 if RBE: body += ba("Event study, 1-year H$-$L: full / largest 1,000 / remaining (pp) [$t$]", f"{RBE['car_1y']['H_minus_L']:+.1f} [Welch {RBE['car_1y']['t_welch']:.2f}; CDA {[x for x in RBE['cda'] if x['horizon'] == 'car_1y'][0]['t_cda']:.2f}] / {RBE['by_size']['large']['H_minus_L_1y']:+.1f} [Welch {RBE['by_size']['large']['t_welch']:.2f}] / {RBE['by_size']['small']['H_minus_L_1y']:+.1f} [Welch {RBE['by_size']['small']['t_welch']:.2f}]", f"{base['full']['horizons']['car_1y']['HL_CAR_pct']:+.1f} [CDA {base['full']['horizons']['car_1y']['t_cda']:.2f}] / {base['large']['horizons']['car_1y']['HL_CAR_pct']:+.1f} [CDA {base['large']['horizons']['car_1y']['t_cda']:.2f}; beta-only {EB['beta_only']['large']['horizons']['car_1y']['t_cda']:.2f}; FF6 {FF['large']['car_1y']['ff6_t']:.2f}] / {base['small']['horizons']['car_1y']['HL_CAR_pct']:+.1f} [CDA {base['small']['horizons']['car_1y']['t_cda']:.2f}]")598 if RB2: body += ba("SPID $\\times$ post (pp) [$t$]", f"{RB2['spid']['z_SPID_TECH']['z_SPID_TECH:post']['coef_pct']:+.2f} [{RB2['spid']['z_SPID_TECH']['z_SPID_TECH:post']['t']:.2f}] (degenerate fit; post coefficient ${RB2['spid']['z_SPID_TECH']['post']['coef_pct'] / 1e12:.1f} \\times 10^{{12}}$)", (f"{t17b['coef_pct']:+.2f} [{t17b['t_firm']:.2f} / {t17b['t_twoway']:.2f}] (committed panel refit) $\\rightarrow$ " if t17b else "") + f"{Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['coef_pct']:+.2f} [{Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_firm']:.2f} / {Pp['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_twoway']:.2f}]")599 if RB2 and "did_eventtime" in RB2:600 e0 = {r["year"]: r for r in RB2["did_eventtime"]["rows"]} if isinstance(RB2["did_eventtime"], dict) and "rows" in RB2["did_eventtime"] else None601 if e0 and 2022 in e0: body += ba("Event-time 2022 / 2024 coefficient (pp/SD)", f"{e0[2022].get('coef', e0[2022].get('abs_slope', 0)) * 100:+.1f} / {e0[2024].get('coef', e0[2024].get('abs_slope', 0)) * 100:+.1f} (absolute slopes, no main effect)", f"{ET[2022]['diff_from_ref'] * 100:+.1f} / {ET[2024]['diff_from_ref'] * 100:+.1f} relative to 2021 (SE {ET[2022]['diff_se'] * 100:.1f} / {ET[2024]['diff_se'] * 100:.1f})")602table("tab_hygiene", "tab:hygiene", "Return hygiene and the effect of the data corrections on the headline statistics.",603 f"Panel A: every monthly return above 300\\% ({HY['n_flagged_monthly']}) and every firm-year forward return above 500\\% ({HY['n_flagged_firm_years']}) was checked against FinData OS daily bars (split- and dividend-adjusted; {HY['verdicts_monthly'].get('confirmed', 0)} monthly and {HY['verdicts_firm_year'].get('confirmed', 0)} firm-year observations confirmed and kept); the listed series breaks are Yahoo price splices and are set to missing together with every forward return whose window contains them ({META['n_firm_years_fwd_removed_hygiene']} firm-years). Panel B: the committed v2.0 values (BEFORE; reproduced from the committed code by the baseline re-run) against the rebuilt panel (AFTER), raw and then winsorized / dependence-robust.",604 "llrrrl", [], body,605 f"Verification rule: {tex(HY['rule'])}. Second source: FinData OS daily bars (FirstRate), read-only query of {HY['second_source'][-26:-16]}. BEFORE values are the committed v2.0 statistics (raw returns, split-adjusted close $\\times$ as-reported shares, Welch event-study $t$'s, Newey--West on three post cohorts, interaction without main effect) and appear nowhere else in the paper; the 2022/2024 event-time BEFORE values are absolute slopes from a model without a main effect and are not comparable to the AFTER differences.",606 size="\\scriptsize", colsep="4pt", placement="appendix", sources=f"results/r3k_v2/hygiene_log.csv, hygiene_summary.json, results/r3k/*.json (HEAD {BASELINE}), results/r3k_v2/results*.json")607# ================================================================ structural break / interaction table (appendix) ====608B = R["structural_break"]; body = ""609for k, l in [("AI_COMPOS", "AI composite"), ("AI_ADOPT", "AI adoption"), ("AI_INFRA", "AI infrastructure"), ("AI_RISK", "AI disruption risk"), ("AI_PC1", "PC1"), ("AI_formw", "Equal-form composite"), ("SPID_TECH", "SPID tech projects")]:610 b = B[k]; p_ = SP[k]; body += f"{l} & {b['pre_slope'] * 100:+.2f} & {br(b['pre_slope_t_twoway'])} & {b['interaction'] * 100:+.2f} & {br(b['interaction_t_firm'])} & {br(b['interaction_t_twoway'])} & {ci(b['interaction_ci95_firm'], 2)} & {pv(b.get('interaction_p_wild_webb'))} & {pp(p_['pre_w']['mean'])} & {pp(p_['post_w']['mean'])} \\\\\n"611table("tab_break", "tab:break", "Pooled test of a post-launch change in the signal slope, by signal, Russell~3000.",612 "Pooled regression of the within-year winsorized forward return on the signal, a post-launch cohort dummy, their interaction, size and momentum (pp per SD). Pre slope with its two-way clustered $t$; the interaction (post-launch change of the slope) with firm-clustered and two-way $t$, the firm-clustered 95\\% CI and the Webb wild-cluster bootstrap $p$ by cohort; the last two columns repeat the cohort-level pre and post winsorized spreads of Table~\\ref{tab:prepostboth}.",613 "lrrrrrrrrr", ["Signal & Pre slope & [$t$ two-way] & Slope $\\times$ post & [$t$ firm] & [$t$ two-way] & 95\\% CI & wild $p$ & Pre Q5$-$Q1 & Post Q5$-$Q1"], body,614 f"$N$ = {n(B['AI_COMPOS']['n'])} firm-years, {B['AI_COMPOS']['G_years']} cohort clusters, 9,999 bootstrap draws. None of the interactions is significant once clustering by cohort or the wild bootstrap is used; the firm-clustered $t$ overstates precision for a regressor that varies at the cohort level. Source: results/r3k\\_v2/results.json (structural\\_break).",615 size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results.json (structural_break, subperiod_spread)")616# ================================================================ appendix exhibits block + exhibit map ====617FIGS_APPENDIX = [("fig1_quintiles", "fig:quintiles"), ("fig2_cumulative_ls", "fig:cumls"), ("fig17_attrition", "fig:attrition")]618FIGS_MAIN_FALLBACK = [] # fig15 / fig16 are placed in the sections by the writing agent (its own figure wrappers do not set the placement flag, so no fallback copy)619TABS_MAIN_FALLBACK = [e["file"].split("/")[-1][:-4] for e in EXHIBITS if e["placement"] == "main"] # every main-text table, guarded: printed here only if the sections did not place it620TABS_APPENDIX = ["tab_corr", "tab_topfirms", "tab_coverage", "tab_hygiene", "tab_sorts", "tab_alpha", "tab_fm", "tab_break", "tab_doublesort", "tab_placebo", "tab_filing_type", "tab_eventtime", "tab_reversal", "tab_mht_full_a", "tab_mht_full_b"]621assert set(TABS_APPENDIX) == {e["file"].split("/")[-1][:-4] for e in EXHIBITS if e["placement"] == "appendix"}, "appendix list out of sync with placements"622LBL = {e["file"].split("/")[-1][:-4]: e["label"] for e in EXHIBITS}623ax = [f"% Generated by {SCRIPT} -- do not edit by hand (FIRC-0002 v2.1, Stage E exhibits).",624 "% Appendix exhibits. Every \\input below is wrapped in \\ExhibitOnce{label}{...}: an exhibit that was already \\input earlier in the",625 "% document (main text or appendix prose) is skipped here, so this block is a safety net as well as the appendix placement.",626 "% Every main-text table is listed first (guarded), so a table the sections do not \\input yet prints here with an appendix number until",627 "% the writing agent places it; the appendix-bound tables follow. Figures placed through the writing agent's own",628 "% \\begin{figure} wrappers do not set the flag, so no figure fallback is listed).",629 "\\clearpage", "\\renewcommand{\\thesection}{\\Alph{section}}\\renewcommand{\\thetable}{A\\arabic{table}}\\renewcommand{\\thefigure}{A\\arabic{figure}}",630 "\\section{Additional Exhibits}\\label{app:exhibits}",631 "This appendix collects the secondary exhibits referenced in the text: the full-signal versions of the main tables, the member-level multiple-testing adjustments, the return-hygiene and before/after record, and the diagnostic figures. Every exhibit is generated by \\texttt{scripts/r3k\\_19\\_figures\\_v2.py} or \\texttt{scripts/r3k\\_20\\_tables\\_v2.py} from the result files named in its notes.",632 ""]633for t_ in TABS_MAIN_FALLBACK + TABS_APPENDIX: ax.append(f"\\ExhibitOnce{{{LBL[t_]}}}{{\\input{{tables/{t_}}}}}")634for f_, l_ in FIGS_MAIN_FALLBACK + FIGS_APPENDIX: ax.append(f"\\ExhibitOnce{{{l_}}}{{\\input{{figures_r3k/{f_}}}}}")635open(f"{P}/appendix_exhibits.tex", "w").write("\n".join(ax) + "\n"); print("appendix_exhibits.tex:", len(TABS_MAIN_FALLBACK + TABS_APPENDIX), "tables,", len(FIGS_MAIN_FALLBACK + FIGS_APPENDIX), "figures")636S = R["sorts"]; sp = SP["AI_COMPOS"]; la = R["ls_alpha"]["AI_COMPOS"]; E1 = base["full"]["horizons"]["car_1y"]; Cc = R2["cohorts"]; SMr = R["samples"]["r3k"]; SMs = R["samples"]["sp500"]; Lc_ = R2["sector_controls"]; Pp_ = R2["spid"]; PLm = R2["placebo"]; Nf = R2["filing_type"]; Gm = R["groups"]637def f1(x): return f"{x:+.1f}"638MAC.update({"nObs": n(R["n_obs"]), "nFirms": n(R["n_firms"]), "nFirmYearsPanel": n(META["n_firm_years"]), "yrs": R["yrs"], "nLarge": n(R["n_large"]), "nSPfy": n(R["n_sp500_firm_years"]),639 "spreadFull": pp(S["AI_COMPOS_EW"]["Q5_minus_Q1"]), "spreadFullT": tv(S["AI_COMPOS_EW"]["t_stat"]), "spreadFullVW": pp(S["AI_COMPOS_VW"]["Q5_minus_Q1"]), "spreadFullVWT": tv(S["AI_COMPOS_VW"]["t_stat"]),640 "spreadFullW": pp(S["AI_COMPOS_EW_w"]["Q5_minus_Q1"]), "spreadFullWT": tv(S["AI_COMPOS_EW_w"]["t_stat"]), "spreadFullWTplain": tv(S["AI_COMPOS_EW_w"]["t_plain"]), "spreadFullWCI": ci(S["AI_COMPOS_EW_w"]["ci95"]), "spreadFullCI": ci(S["AI_COMPOS_EW"]["ci95"]), "spreadFullTplain": tv(S["AI_COMPOS_EW"]["t_plain"]), "spreadFullMed": pp(S["AI_COMPOS_EW_med"]["Q5_minus_Q1"]), "spreadFullMedT": tv(S["AI_COMPOS_EW_med"]["t_stat"]), "spreadFullVWcap": pp(S["AI_COMPOS_VWcap10"]["Q5_minus_Q1"]), "spreadFullVWcapT": tv(S["AI_COMPOS_VWcap10"]["t_stat"]), "spreadFullStrict": pp(S["AI_COMPOS_EW_strict"]["Q5_minus_Q1"]), "topOnePctContrib": pp(S["AI_COMPOS_EW"]["top1pct_contribution"]),641 "spreadPre": pp(sp["pre"]["mean"]), "spreadPreT": tv(sp["pre"]["t"]), "spreadPost": pp(sp["post"]["mean"]), "spreadPostT": tv(sp["post"]["t"]), "spreadPreW": pp(sp["pre_w"]["mean"]), "spreadPreWT": tv(sp["pre_w"]["t"]), "spreadPostW": pp(sp["post_w"]["mean"]), "spreadPostWT": tv(sp["post_w"]["t"]), "spreadPreCI": ci(sp["pre"]["ci95"]), "spreadPostCI": ci(sp["post"]["ci95"]), "spreadPreWCI": ci(sp["pre_w"]["ci95"]), "spreadPostWCI": ci(sp["post_w"]["ci95"]), "spreadPreMed": pp(sp["pre_med"]["mean"]), "spreadPostMed": pp(sp["post_med"]["mean"]),642 "ffsixFull": f1(la["full"]["ff6_alpha_ann_pct"]), "ffsixFullT": tv(la["full"]["ff6_alpha_t"]), "ffsixPost": f1(la["post"]["ff6_alpha_ann_pct"]), "ffsixPostT": tv(la["post"]["ff6_alpha_t"]), "sharpePre": f"{la['pre']['sharpe']:.2f}", "sharpePost": f"{la['post']['sharpe']:.2f}", "meanLSPre": f1(la["pre"]["mean_ls_ann_pct"]), "meanLSPost": f1(la["post"]["mean_ls_ann_pct"]), "dsrFull": f"{DS['full']['dsr_prob']:.2f}", "dsrPost": f"{DS['post']['dsr_prob']:.2f}", "dsrTrials": str(DS["n_trials"]),643 "cohortsPost": ", ".join(f"{y}: {v:+.1f}" for y, v in Cc["cohort_spreads_pct"].items() if int(y) >= 2022), "cohortsPostW": ", ".join(f"{y}: {v:+.1f}" for y, v in Cw["cohort_spreads_pct"].items() if int(y) >= 2022), "postLOO": ", ".join(f"{v:+.1f}" for v in Cc["post_loo_pct"].values()), "postLOOW": ", ".join(f"{v:+.1f}" for v in Cw["post_loo_pct"].values()), "preMean": f1(Cc["pre_mean_pct"]), "postMean": f1(Cc["post_mean_pct"]), "preMeanW": f1(Cw["pre_mean_pct"]), "postMeanW": f1(Cw["post_mean_pct"]), "preMeanCI": str(Cc["pre_ci95_pct"]).replace("[", "[").replace("]", "]"), "preMin": f1(Cc["pre_min_pct"]),644 "pooledPost": f1(PO["post"]["coef_pct"]), "pooledPostT": f"{PO['post']['t_firm']:.2f}", "pooledPostTtw": tv(PO["post"].get("t_twoway")), "pooledPostPwild": pv(PO["post"].get("p_wild_webb")), "pooledPostW": f1(PO["post_w"]["coef_pct"]), "pooledPostWT": f"{PO['post_w']['t_firm']:.2f}", "pooledPostWTtw": tv(PO["post_w"].get("t_twoway")), "pooledPostWPwild": pv(PO["post_w"].get("p_wild_webb")), "pooledPostWCI": f"[{PO['post_w']['ci95_firm_pct'][0]:+.1f}, {PO['post_w']['ci95_firm_pct'][1]:+.1f}]", "pooledDiff": f1(PO["diff"]["coef_pct"]), "pooledDiffT": f"{PO['diff']['t_firm']:.2f}", "pooledDiffW": f1(PO["diff_w"]["coef_pct"]), "pooledDiffWT": f"{PO['diff_w']['t_firm']:.2f}", "pooledDiffWTtw": tv(PO['diff_w']['t_twoway']), "pooledDiffWMDE": f"{PO['diff_w']['mde_pct_firm']:.1f}", "pooledPostExTwentyFourW": f1(PO["post_excl_2024_w"]["coef_pct"]), "pooledPostExTwentyFourWT": f"{PO['post_excl_2024_w']['t_firm']:.2f}",645 "eventHL": f1(E1["HL_CAR_pct"]), "eventT": f"{WR['full']['t_welch']:.2f}", "eventCDA": f"{E1['t_cda']:.2f}", "eventBMP": tv(E1.get("t_bmp_HL")), "eventN": n(RE["n_firms"]), "eventHLsixty": f1(base["full"]["horizons"]["car_60d"]["HL_CAR_pct"]), "eventCDAsixty": f"{base['full']['horizons']['car_60d']['t_cda']:.2f}", "eventHLpre": f1(base["full"]["horizons"]["pre_m20_m1"]["HL_CAR_pct"]), "eventHLtwenty": f1(base["full"]["horizons"]["car_0_20"]["HL_CAR_pct"]), "eventCDAtwenty": f"{base['full']['horizons']['car_0_20']['t_cda']:.2f}", "eventHLthree": f1(base["full"]["horizons"]["car_m1_p1"]["HL_CAR_pct"]), "evHLeighteen": f1(base["full"]["horizons"]["car_18m"]["HL_CAR_pct"]), "evCDAeighteen": f"{base['full']['horizons']['car_18m']['t_cda']:.2f}", "evCDAsixty": f"{base['full']['horizons']['car_60d']['t_cda']:.2f}", "evRho": f"{base['full']['rho_bar']:.3f}", "evKP": f"{base['full']['kp_factor']:.3f}",646 "largePre": pp(Gm["large_top1000"]["pre"]["mean"]), "largePost": pp(Gm["large_top1000"]["post"]["mean"]), "largePostT": tv(Gm["large_top1000"]["post"]["t"]), "smallPre": pp(Gm["small_rest"]["pre"]["mean"]), "smallPost": pp(Gm["small_rest"]["post"]["mean"]), "smallPostT": tv(Gm["small_rest"]["post"]["t"]), "largePreW": pp(Gm["large_top1000"]["pre_w"]["mean"]), "largePostW": pp(Gm["large_top1000"]["post_w"]["mean"]), "smallPreW": pp(Gm["small_rest"]["pre_w"]["mean"]), "smallPostW": pp(Gm["small_rest"]["post_w"]["mean"]), "largePostLOOW": ", ".join(f"{v * 100:+.1f}" for v in Gm["large_top1000"]["post_loo_w"].values()), "largePostExTwentyFourW": f1(Gm["large_top1000"]["pooled_post_excl_2024_w"]["coef_pct"]), "largePostExTwentyFourWT": f"{Gm['large_top1000']['pooled_post_excl_2024_w']['t_firm']:.2f}", "largePostCI": ci(Gm["large_top1000"]["post_w"]["ci95"]), "smallPostCI": ci(Gm["small_rest"]["post_w"]["ci95"]), "largePreCI": ci(Gm["large_top1000"]["pre_w"]["ci95"]), "smallPreCI": ci(Gm["small_rest"]["pre_w"]["ci95"]),647 "spPre": pp(Gm["sp500"]["pre"]["mean"]), "spPost": pp(Gm["sp500"]["post"]["mean"]), "nonspPre": pp(Gm["non_sp500"]["pre"]["mean"]), "nonspPost": pp(Gm["non_sp500"]["post"]["mean"]), "nonspPostT": tv(Gm["non_sp500"]["post"]["t"]),648 "contrastLarge": f1(CT["large_vs_small_w"]["hi_x_post_x_group"]["coef_pct"]), "contrastLargeT": f"{CT['large_vs_small_w']['hi_x_post_x_group']['t_firm']:.2f}", "contrastLargeTtw": tv(CT['large_vs_small_w']['hi_x_post_x_group']['t_twoway']), "contrastLargePwild": pv(CT["large_vs_small_w"]["hi_x_post_x_group"]["p_wild_webb"]), "contrastLargeMDE": f"{CT['large_vs_small_w']['hi_x_post_x_group']['mde_pct_firm']:.1f}", "contrastLargeCI": f"[{CT['large_vs_small_w']['hi_x_post_x_group']['ci95_firm_pct'][0]:+.1f}, {CT['large_vs_small_w']['hi_x_post_x_group']['ci95_firm_pct'][1]:+.1f}]", "contrastMember": f1(CT["member_vs_non_w"]["hi_x_post_x_group"]["coef_pct"]), "contrastMemberT": f"{CT['member_vs_non_w']['hi_x_post_x_group']['t_firm']:.2f}", "contrastMemberTtw": tv(CT['member_vs_non_w']['hi_x_post_x_group']['t_twoway']), "contrastMemberPwild": pv(CT["member_vs_non_w"]["hi_x_post_x_group"]["p_wild_webb"]), "contrastMemberMDE": f"{CT['member_vs_non_w']['hi_x_post_x_group']['mde_pct_firm']:.1f}",649 "sectNeuPost": pp(SN["post"]["mean"]), "sectNeuPostT": tv(SN["post"]["t"]), "sectNeuFull": pp(SN["full"]["mean"]), "sectNeuFullT": tv(SN["full"]["t"]), "sectNeuFullW": pp(SN["full_w"]["mean"]), "sectNeuFullWT": tv(SN["full_w"]["t"]), "residSortFullW": pp(RSd["full_w"]["mean"]), "residSortFullWT": tv(RSd["full_w"]["t"]), "techBetaPost": f"{M['post'].get('tech_beta', float('nan')):.2f}", "techBetaFull": f"{M['full'].get('tech_beta', float('nan')):.2f}", "ffsixTechFull": f1(M["full"].get("ff6_tech_alpha_pct", float("nan"))), "ffsixTechFullT": f"{M['full'].get('ff6_tech_t', float('nan')):.2f}", "sharpeFull": f"{M['full']['sharpe']:.2f}", "meanLSFull": f1(M["full"]["mean_ann_pct"]), "hacFull": f"{M['full']['hac_t']:.2f}", "ffsixTechPost": f1(M["post"].get("ff6_tech_alpha_pct", float("nan"))), "ffsixTechPostT": f"{M['post'].get('ff6_tech_t', float('nan')):.2f}",650 "fmPostSector": f"{Lc_['fm_all_raw_sector_post']['slope_pct']:+.2f}", "fmPostSectorT": tv(Lc_["fm_all_raw_sector_post"]["t_nw"]), "fmPost": f"{Lc_['fm_all_raw_nosector_post']['slope_pct']:+.2f}", "fmPostT": tv(Lc_["fm_all_raw_nosector_post"]["t_nw"]), "syPost": f"{Lc_['pooled_all_post']['sector_year_fe']['coef_pct']:+.2f}", "syPostT": f"{Lc_['pooled_all_post']['sector_year_fe']['t_firm']:.2f}", "syPostTtw": tv(Lc_['pooled_all_post']['sector_year_fe']['t_twoway']),651 "fmFullSector": f"{Lc_['fm_all_raw_sector_full']['slope_pct']:+.2f}", "fmFullSectorT": tv(Lc_["fm_all_raw_sector_full"]["t_nw"]), "fmFullSectorTplain": tv(Lc_["fm_all_raw_sector_full"]["t_plain"]), "fmFullSectorW": f"{Lc_['fm_all_w_sector_full']['slope_pct']:+.2f}", "fmFullSectorWT": tv(Lc_["fm_all_w_sector_full"]["t_nw"]), "fmFullSectorWTplain": tv(Lc_["fm_all_w_sector_full"]["t_plain"]), "fmFullSectorExEnergyW": f"{Lc_['fm_ex_energy_w_sector_full']['slope_pct']:+.2f}", "fmFullSectorExEnergyWT": tv(Lc_["fm_ex_energy_w_sector_full"]["t_nw"]), "fixedBcv": f"{FB:.2f}", "fmPre": f"{Lc_['fm_all_raw_nosector_pre']['slope_pct']:+.2f}", "fmPreT": tv(Lc_["fm_all_raw_nosector_pre"]["t_nw"]), "fmFull": f"{Lc_['fm_all_raw_nosector_full']['slope_pct']:+.2f}", "fmFullT": tv(Lc_["fm_all_raw_nosector_full"]["t_nw"]), "syFull": f"{Lc_['pooled_all_full']['sector_year_fe']['coef_pct']:+.2f}", "syFullT": f"{Lc_['pooled_all_full']['sector_year_fe']['t_firm']:.2f}", "syFullTtw": tv(Lc_['pooled_all_full']['sector_year_fe']['t_twoway']), "syFullPwild": pv(Lc_["pooled_all_full"]["sector_year_fe"].get("p_wild_webb")),652 "placeboRank": str(PB["rank_of_2022"]), "placeboN": str(PB["n_candidates"]), "placeboRankW": str(PB["winsorized"]["rank_of_2022"]), "placeboRankOrd": ordinal(PB["rank_of_2022"]), "placeboRankWOrd": ordinal(PB["winsorized"]["rank_of_2022"]), "permP": f"{PB['permutation']['p_one_sided']:.2f}", "permPW": f"{PB['winsorized']['permutation']['p_one_sided']:.2f}", "permRank": str(PB["permutation"]["rank_among_subsets"]), "supWald": f"{PB['sup_wald']['sup_wald']:.2f}", "supWaldP": f"{PB['sup_wald']['p_simulated']:.2f}", "supWaldW": f"{PB['winsorized']['sup_wald']['sup_wald']:.2f}", "supWaldWP": f"{PB['winsorized']['sup_wald']['p_simulated']:.2f}", "placeboBest": max(PB["diff_post_minus_pre_pct_by_break_year"], key=PB["diff_post_minus_pre_pct_by_break_year"].get), "placeboDiffTwentyTwo": f1(PB["diff_post_minus_pre_pct_by_break_year"]["2022"]),653 "didCont": f"{Dd['continuous']['coef'] * 100:+.2f}", "didContT": f"{Dd['continuous']['t']:.2f}", "didBin": f"{Dd['binary']['coef'] * 100:+.2f}", "didBinT": f"{Dd['binary']['t']:.2f}",654 "evtTwentyTwo": f1(ET[2022]["abs_slope"] * 100), "evtTwentyFour": f1(ET[2024]["abs_slope"] * 100), "evtEighteen": f1(ET[2018]["abs_slope"] * 100), "evtDiffTwentyTwo": f1(ET[2022]["diff_from_ref"] * 100), "evtDiffTwentyThree": f1(ET[2023]["diff_from_ref"] * 100), "evtDiffTwentyFour": f1(ET[2024]["diff_from_ref"] * 100), "evtDiffTwentyTwoSE": f"{ET[2022]['diff_se'] * 100:.1f}", "evtBase": f1(R2["did_eventtime"]["base_slope_ref_year"] * 100), "evtTrailTwentyTwo": f1(ETt[2022]["diff_from_ref"] * 100), "evtTrailTwentyFour": f1(ETt[2024]["diff_from_ref"] * 100),655 "tenkPost": pp(Nf["10k"]["post"]["mean"]), "tenkPostT": tv(Nf["10k"]["post"]["t"]), "tenkPre": pp(Nf["10k"]["pre"]["mean"]), "tenqPost": pp(Nf["10q"]["post"]["mean"]), "eightkPost": pp(Nf["8k"]["post"]["mean"]), "corrTenK": f"{Nf['10k']['corr_with_baseline']:.2f}", "tenqPre": pp(Nf["10q"]["pre"]["mean"]), "eightkPre": pp(Nf["8k"]["pre"]["mean"]), "corrEightK": f"{Nf['8k']['corr_with_baseline']:.2f}", "hrTenK": f"{hr0['z_AI_10k']['slope_pct']:+.2f}", "hrTenKT": f"{hr0['z_AI_10k']['t']:.2f}", "hrEightK": f"{hr0['z_AI_8k']['slope_pct']:+.2f}", "hrEightKT": f"{hr0['z_AI_8k']['t']:.2f}", "hrTenQ": f"{hr0['z_AI_10q']['slope_pct']:+.2f}", "hrTenQT": f"{hr0['z_AI_10q']['t']:.2f}", "formWaldP": f"{wd['p']:.2f}", "formWaldPraw": f"{wd0['p']:.2f}", "formwFull": pp(Nf["formw"]["full_w"]["mean"]), "formwFullT": tv(Nf["formw"]["full_w"]["t"]), "cohortTwentyTwoPostShare": f"{c22['share_chunks_post_launch'] * 100:.1f}", "cohortTwentyTwoPreOnly": f1(c22["spread_prelaunch_text_only_w_pct"]), "cohortTwentyTwoFullSame": f1(c22["spread_full_text_same_firms_w_pct"]),656 "spidPre": pp(SP["SPID_TECH"]["pre"]["mean"]), "spidPost": pp(SP["SPID_TECH"]["post"]["mean"]), "spidPostT": tv(SP["SPID_TECH"]["post"]["t"]), "spidAnyShare": f"{R['spid']['share_firm_years_any_ai'] * 100:.1f}", "spidAnyPostShare": f"{R['spid']['share_post_any_ai'] * 100:.1f}", "spidAnyPre": f"{SB['spid_ai_any']['pre']['cohort_w']['mean_pct']:+.1f}" if SB["spid_ai_any"]["pre"]["cohort_w"]["mean_pct"] is not None else "--", "spidAnyPost": f"{SB['spid_ai_any']['post']['cohort_w']['mean_pct']:+.1f}", "spidAnyPostT": tv(SB["spid_ai_any"]["post"]["cohort_w"]["t"]), "spidAnyPostCI": str(SB["spid_ai_any"]["post"]["cohort_w"]["ci95_pct"]), "spidAnyFirmFull": f"{SB['spid_ai_any']['full']['firm_w']['coef_pct']:+.1f}", "spidAnyFirmFullT": f"{SB['spid_ai_any']['full']['firm_w']['t_firm']:.2f}", "spidAnyFirmFullMDE": f"{SB['spid_ai_any']['full']['firm_w']['mde_pct']:.1f}", "spidAnyFirmFullCI": f"[{SB['spid_ai_any']['full']['firm_w']['ci95_pct'][0]:+.1f}, {SB['spid_ai_any']['full']['firm_w']['ci95_pct'][1]:+.1f}]", "spidCohortMDE": f"{SB['spid_ai_any']['full']['cohort_w']['mde_pct']:.1f}" if SB["spid_ai_any"]["full"]["cohort_w"]["mde_pct"] else "--", "spidLegacyMDE": f"{R['spid']['legacy_quintile_full_mde_pct']:.1f}", "spidXpost": f"{Pp_['z_SPID_TECH']['terms']['z_SPID_TECH:post']['coef_pct']:+.2f}", "spidXpostT": f"{Pp_['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_firm']:.2f}", "spidXpostTtw": f"{Pp_['z_SPID_TECH']['terms']['z_SPID_TECH:post']['t_twoway']:.2f}", "spidTechFirmFull": f"{SB['spid_tech_any']['full']['firm_w']['coef_pct']:+.1f}", "spidTechFirmFullT": f"{SB['spid_tech_any']['full']['firm_w']['t_firm']:.2f}",657 "esgPost": pp(PLm["ESG commitment"]["post"]["mean"]), "climPost": pp(PLm["Climate risk"]["post"]["mean"]), "cyberPost": pp(PLm["Cybersecurity"]["post"]["mean"]), "autoPost": pp(PLm["Automation/labor"]["post"]["mean"]), "cyberPostW": pp(PLm["Cybersecurity"]["post_w"]["mean"]), "cyberIntT": f"{PLm['Cybersecurity']['interaction']['t_firm']:.2f}", "cyberIntTtw": f"{PLm['Cybersecurity']['interaction']['t_twoway']:.2f}", "cyberIntRW": f"{rw['Cybersecurity']:.2f}", "riskIntTtw": f"{PLm['AI disruption risk']['interaction']['t_twoway']:.2f}", "esgIntTtw": f"{PLm['ESG commitment']['interaction']['t_twoway']:.2f}",658 "riskPost": pp(PLm["AI disruption risk"]["post"]["mean"]), "riskPostT": tv(PLm["AI disruption risk"]["post"]["t"]), "riskPre": pp(PLm["AI disruption risk"]["pre"]["mean"]), "adoptPost": pp(PLm["AI adoption"]["post"]["mean"]), "infraPost": pp(PLm["AI infrastructure"]["post"]["mean"]), "macroPost": pp(PLm["Macro risk"]["post"]["mean"]), "riskFFsixPost": f1(R["ls_alpha"]["AI_RISK"]["post"]["ff6_alpha_ann_pct"]), "riskFFsixPostT": tv(R["ls_alpha"]["AI_RISK"]["post"]["ff6_alpha_t"]), "pcaPostW": pp(SP["AI_PC1"]["post_w"]["mean"]), "pcaFullW": pp(SP["AI_PC1"]["full_w"]["mean"]) if "full_w" in SP["AI_PC1"] else pp(S["AI_PC1_EW_w"]["Q5_minus_Q1"]), "pcaFullWT": tv(S["AI_PC1_EW_w"]["t_stat"]), "pcaEVR": f"{R['pca']['evr'][0] * 100:.1f}", "pcaPost": pp(SP["AI_PC1"]["post"]["mean"]),659 "nEntrantFirms": n(EN["n_firms"] - EN["n_seasoned"]), "nSeasoned": n(EN["n_seasoned"]), "rankAuto": f"{cv['rank_autocorr_lag1']:.2f}", "rankAutoFive": f"{cv['rank_autocorr_lag5']:.2f}", "entrantPrem": f1(EN["entrant_minus_seasoned_fwd_pct"]), "seasonedPost": pp(EN["seasoned"]["post"]["mean"]), "seasonedPre": pp(EN["seasoned"]["pre"]["mean"]), "seasonedFullW": pp(EN["seasoned"]["full_w"]["mean"]), "seasonedFullWT": tv(EN["seasoned"]["full_w"]["t"]), "listedPre": pp(EN["listed36"]["pre"]["mean"]), "listedPost": pp(EN["listed36"]["post"]["mean"]), "magSevenPost": pp(M7["ex_mag7_post"]["mean"]), "exTopFiveHundredPost": pp(M7["ex_top500_post"]["mean"]), "exTopFiveHundredPre": pp(M7["ex_top500_pre"]["mean"]), "sixmPost": pp(AH["6m"]["post"]["mean"]), "iwvPost": pp(AB["iwv_adj"]["post"]["mean"]), "iwvPre": pp(AB["iwv_adj"]["pre"]["mean"]), "fvolPost": f1(R2["fwd_vol"]["post"]["mean"] * 100), "fvolPostT": tv(R2["fwd_vol"]["post"]["t"]), "fvolPre": f1(R2["fwd_vol"]["pre"]["mean"] * 100),660 "breakInfraT": tv(B["AI_INFRA"]["interaction_t_firm"]), "breakComposT": tv(B["AI_COMPOS"]["interaction_t_firm"]), "breakComposTtw": tv(B["AI_COMPOS"]["interaction_t_twoway"]), "breakComposPwild": pv(B["AI_COMPOS"].get("interaction_p_wild_webb")), "breakCompos": f"{B['AI_COMPOS']['interaction'] * 100:+.2f}", "vwQone": pp(S["AI_COMPOS_VW"]["Q1"]), "vwQfive": pp(S["AI_COMPOS_VW"]["Q5"]), "ewQone": pp(S["AI_COMPOS_EW"]["Q1"]), "ewQfive": pp(S["AI_COMPOS_EW"]["Q5"]), "vwMaxWeight": f"{R['vw_diag']['max_single_firm_weight_v2'] * 100:.0f}", "vwMaxWeightVone": f"{R['vw_diag']['max_single_firm_weight_v1'] * 100:.1f}", "vwMaxWeightAll": f"{VWALL['max'] * 100:.0f}", "vwMaxWeightAllSort": VWALL["sort"], "vwMaxWeightAllCell": vwcell(VWALL), "vwCellsAboveAll": str(VWALL["n_above"]), "vwCellsAboveAllDistinct": str(VWALL["n_above_distinct"]), "vwSortsAboveAll": " and ".join(VWALL["sorts_above"]), "vwMaxWeightCompos": f"{VWCOMP['max'] * 100:.0f}", "vwMaxWeightComposCell": vwcell(VWCOMP), "vwCellsAboveCompos": str(VWCOMP["n_above"]), "vwMaxWeightComposVone": f"{VWCOMP1['max'] * 100:.1f}", "vwCellsAboveComposVone": str(VWCOMP1["n_above"]),661 "feCompos": f"{PF['M7_all_spid']['coefs']['z_AI_COMPOS']['coef'] * 100:+.2f}", "feComposT": f"{PF['M7_all_spid']['coefs']['z_AI_COMPOS']['t']:.2f}", "feAdopt": f"{PF['M2_adopt_ctrl']['coefs']['z_AI_ADOPT']['coef'] * 100:+.2f}", "feAdoptT": f"{PF['M2_adopt_ctrl']['coefs']['z_AI_ADOPT']['t']:.2f}", "feInfra": f"{PF['M3_infra_ctrl']['coefs']['z_AI_INFRA']['coef'] * 100:+.2f}", "feInfraT": f"{PF['M3_infra_ctrl']['coefs']['z_AI_INFRA']['t']:.2f}", "feSize": f"{PF['M2_adopt_ctrl']['coefs']['z_size']['coef'] * 100:+.2f}", "feSizeT": f"{PF['M2_adopt_ctrl']['coefs']['z_size']['t']:.2f}",662 "nLargeFirms": n(Gm["large_top1000"]["firms"]), "nSmallFirms": n(Gm["small_rest"]["firms"]), "nSmall": n(Gm["small_rest"]["n"]), "largeFFsixPost": f1(Gm["large_top1000"]["ls"]["post"]["ff6_alpha_ann_pct"]), "largeFFsixPostT": tv(Gm["large_top1000"]["ls"]["post"]["ff6_alpha_t"]), "largeSharpePost": f"{Gm['large_top1000']['ls']['post']['sharpe']:.2f}", "smallSharpePost": f"{Gm['small_rest']['ls']['post']['sharpe']:.2f}", "smallSharpePre": f"{Gm['small_rest']['ls']['pre']['sharpe']:.2f}", "largeSharpePre": f"{Gm['large_top1000']['ls']['pre']['sharpe']:.2f}", "smallFull": pp(Gm["small_rest"]["sort_EW"]["Q5_minus_Q1"]), "smallFullT": tv(Gm["small_rest"]["sort_EW"]["t_stat"]), "largeFull": pp(Gm["large_top1000"]["sort_EW"]["Q5_minus_Q1"]), "largeFullT": tv(Gm["large_top1000"]["sort_EW"]["t_stat"]), "smallFullW": pp(Gm["small_rest"]["sort_EW_w"]["Q5_minus_Q1"]), "smallFullWT": tv(Gm["small_rest"]["sort_EW_w"]["t_stat"]), "largeFullW": pp(Gm["large_top1000"]["sort_EW_w"]["Q5_minus_Q1"]), "largeFullWT": tv(Gm["large_top1000"]["sort_EW_w"]["t_stat"]), "sizeGroupChange": f"{MD['share_firm_years_changing_size_group'] * 100:.1f}", "nNoCap": n(META["n_est_without_cap"]), "nNoCapVone": n(META["n_est_without_cap_v1"]),663 "sizeNeuFull": pp(sn["full"]["Q5_minus_Q1"]), "sizeNeuFullT": tv(sn["full"]["t_stat"]), "sizeNeuPost": pp(sn["post"]["mean"]), "sizeNeuPre": pp(sn["pre"]["mean"]), "sizeNeuFullW": pp(sn["full_w"]["Q5_minus_Q1"]), "sizeNeuFullWT": tv(sn["full_w"]["t_stat"]), "largeCohorts": ", ".join(f"{y}: {v * 100:+.1f}" for y, v in Gm["large_top1000"]["post"]["by_cohort"].items()), "smallCohorts": ", ".join(f"{y}: {v * 100:+.1f}" for y, v in Gm["small_rest"]["post"]["by_cohort"].items()), "largeCohortsW": ", ".join(f"{y}: {v * 100:+.1f}" for y, v in Gm["large_top1000"]["post_w"]["by_cohort"].items()), "smallCohortsW": ", ".join(f"{y}: {v * 100:+.1f}" for y, v in Gm["small_rest"]["post_w"]["by_cohort"].items()),664 "fmPostSectorFull": f"{Lc_['fm_all_raw_sector_full']['slope_pct']:+.2f}", "preCohortsAbove": str(Cc["n_pre_above_2022"]), "preCohortsPositive": f"{Cc['pre_cohorts_positive_share'] * 100:.0f}", "preCohortsPositiveW": f"{Cw['pre_cohorts_positive_share'] * 100:.0f}", "nonSPfirms": n(Gm["non_sp500"]["firms"]),665 "spN": n(SMs["n"]), "spFirms": n(SMs["firms"]), "spSpreadFull": pp(SMs["sorts"]["AI_COMPOS_EW"]["Q5_minus_Q1"]), "spSpreadFullT": tv(SMs["sorts"]["AI_COMPOS_EW"]["t_stat"]), "spSpreadFullW": pp(SMs["sorts"]["AI_COMPOS_EW_w"]["Q5_minus_Q1"]), "spSpreadFullWT": tv(SMs["sorts"]["AI_COMPOS_EW_w"]["t_stat"]), "spSpreadPre": pp(SMs["sub"]["AI_COMPOS"]["pre"]["mean"]), "spSpreadPost": pp(SMs["sub"]["AI_COMPOS"]["post"]["mean"]), "spSpreadPostT": tv(SMs["sub"]["AI_COMPOS"]["post"]["t"]), "spSpreadPreW": pp(SMs["sub"]["AI_COMPOS"]["pre_w"]["mean"]), "spSpreadPostW": pp(SMs["sub"]["AI_COMPOS"]["post_w"]["mean"]), "spCohorts": ", ".join(f"{y}: {v:+.1f}" for y, v in SMs["cohorts_pct"].items() if int(y) >= 2022), "spCohortsW": ", ".join(f"{y}: {v:+.1f}" for y, v in SMs["cohorts_w_pct"].items() if int(y) >= 2022), "spSharpePost": f"{SMs['ls']['AI_COMPOS']['post']['sharpe']:.2f}", "spSharpePre": f"{SMs['ls']['AI_COMPOS']['pre']['sharpe']:.2f}", "spFFsixPost": f1(SMs["ls"]["AI_COMPOS"]["post"]["ff6_alpha_ann_pct"]), "spFFsixPostT": tv(SMs["ls"]["AI_COMPOS"]["post"]["ff6_alpha_t"]), "spPooledPost": f1(SMs["pooled_post"]["coef_pct"]), "spPooledPostT": f"{SMs['pooled_post']['t_firm']:.2f}", "spPooledPostW": f1(SMs["pooled_post_w"]["coef_pct"]), "spPooledPostWT": f"{SMs['pooled_post_w']['t_firm']:.2f}", "spPooledPostWTtw": tv(SMs["pooled_post_w"].get("t_twoway")), "spFMcompos": f"{SMs['fm']['compos']['zz_AI_COMPOS']['mean_coef'] * 100:+.2f}", "spFMcomposT": tv(SMs["fm"]["compos"]["zz_AI_COMPOS"]["t"]), "rkFMcompos": f"{SMr['fm']['compos']['zz_AI_COMPOS']['mean_coef'] * 100:+.2f}", "rkFMcomposT": tv(SMr["fm"]["compos"]["zz_AI_COMPOS"]["t"]), "spFMcomposW": f"{SMs['fm']['compos_w']['zz_AI_COMPOS']['mean_coef'] * 100:+.2f}", "spFMcomposWT": tv(SMs["fm"]["compos_w"]["zz_AI_COMPOS"]["t"]),666 "fmCompos": f"{FM['compos']['z_AI_COMPOS']['mean_coef'] * 100:+.2f}", "fmComposT": tv(FM["compos"]["z_AI_COMPOS"]["t"]), "fmComposTplain": tv(FM["compos"]["z_AI_COMPOS"]["t_plain"]), "fmComposW": f"{FM['compos_w']['z_AI_COMPOS']['mean_coef'] * 100:+.2f}", "fmComposWT": tv(FM["compos_w"]["z_AI_COMPOS"]["t"]), "fmComposWTplain": tv(FM["compos_w"]["z_AI_COMPOS"]["t_plain"]), "fmComposWCI": ci(FM["compos_w"]["z_AI_COMPOS"]["ci95"], 2), "fmComposCI": ci(FM["compos"]["z_AI_COMPOS"]["ci95"], 2),667 "nFilingsCorpus": n(len(fl)), "nIssuersCorpus": n(fl.cik.nunique()), "corrAdoptInfra": f"{c.loc['z_AI_ADOPT', 'z_AI_INFRA']:.2f}", "corrAdoptRisk": f"{c.loc['z_AI_ADOPT', 'z_AI_RISK']:.2f}", "corrSpid": f"{c.loc['z_AI_ADOPT', 'z_SPID_TECH']:.2f}", "corrCyber": f"{CY['corr_cyber_composite']:.2f}", "cyberNeuFullW": pp(CY["cyberneutral_sort"]["full_w"]["mean"]), "cyberNeuFullWT": tv(CY["cyberneutral_sort"]["full_w"]["t"]),668 "dsSmallPost": f1(pd.DataFrame(R2["double_sort_post"]).loc["Small", "Hi-Lo"]), "dsLargePost": f1(pd.DataFrame(R2["double_sort_post"]).loc["Large", "Hi-Lo"]), "dsSmallPre": f1(pd.DataFrame(R2["double_sort_pre"]).loc["Small", "Hi-Lo"]), "dsLargePre": f1(pd.DataFrame(R2["double_sort_pre"]).loc["Large", "Hi-Lo"]), "dsSmallPostW": f1(pd.DataFrame(R2["double_sort_post_w"]).loc["Small", "Hi-Lo"]), "dsLargePostW": f1(pd.DataFrame(R2["double_sort_post_w"]).loc["Large", "Hi-Lo"]),669 "evLarge": f1(base["large"]["horizons"]["car_1y"]["HL_CAR_pct"]), "evLargeT": f"{WR['large']['t_welch']:.2f}", "evLargeCDA": f"{base['large']['horizons']['car_1y']['t_cda']:.2f}", "evSmall": f1(base["small"]["horizons"]["car_1y"]["HL_CAR_pct"]), "evSmallT": f"{WR['small']['t_welch']:.2f}", "evSmallCDA": f"{base['small']['horizons']['car_1y']['t_cda']:.2f}", "evSP": f1(base["sp500"]["horizons"]["car_1y"]["HL_CAR_pct"]), "evSPT": f"{WR['sp500']['t_welch']:.2f}", "evSPCDA": f"{base['sp500']['horizons']['car_1y']['t_cda']:.2f}", "evNonSP": f1(base["non_sp500"]["horizons"]["car_1y"]["HL_CAR_pct"]), "evNonSPT": f"{WR['non_sp500']['t_welch']:.2f}", "evNonSPCDA": f"{base['non_sp500']['horizons']['car_1y']['t_cda']:.2f}",670 "evLargeBetaCDA": f"{EB['beta_only']['large']['horizons']['car_1y']['t_cda']:.2f}", "evLargeMadjCDA": f"{EB['market_adjusted']['large']['horizons']['car_1y']['t_cda']:.2f}", "evLargeEstTwentyOneCDA": f"{EB['mm_est2021']['large']['horizons']['car_1y']['t_cda']:.2f}", "evLargeSizeMomCDA": f"{EB['size_mom_matched']['large']['horizons']['car_1y']['t_cda']:.2f}" if EB["size_mom_matched"].get("large") else "--", "evLargeFFsixT": f"{FF['large']['car_1y']['ff6_t']:.2f}" if "large" in FF and "car_1y" in FF["large"] else "--", "evLargeFFsixAlpha": f1(FF["large"]["car_1y"]["ff6_alpha_cum_pct"]) if "large" in FF and "car_1y" in FF["large"] else "--", "evFullFFsixT": f"{FF['full']['car_1y']['ff6_t']:.2f}" if "car_1y" in FF.get("full", {}) else "--", "evLargeWithinCDA": f"{base['large_within']['horizons']['car_1y']['t_cda']:.2f}" if base.get("large_within") else "--", "evLargeEighteenCDA": f"{base['large']['horizons']['car_18m']['t_cda']:.2f}", "evSmallEighteenCDA": f"{base['small']['horizons']['car_18m']['t_cda']:.2f}", "evPlaceboRank": str(PS["rank_2022_by_HL"]), "evPlaceboRankT": str(PS["rank_2022_by_t"]), "evPlaceboN": str(PS["n_launches"]),671 "evXsec": f1(RE["xsec_1y"]["ai_pre_pct"]), "evXsecT": f"{RE['xsec_1y']['t']:.2f}", "evXsecSect": f1(RE["xsec_1y_sector"]["ai_pre_pct"]), "evXsecSectT": f"{RE['xsec_1y_sector']['t']:.2f}",672 "attritionSmallMax": f"{max(v['small'] for v in AP.values()) * 100:.0f}", "attritionLargeMax": f"{max(v['large'] for v in AP.values()) * 100:.0f}", "ewMinusIWV": f1(EI["mean_gap_all_minus_iwv_pp"]), "ewMinusIWVW": f1(EI["mean_gap_all_w_minus_iwv_pp"]), "ewMinusIWVmed": f1(EI["mean_gap_median_minus_iwv_pp"]), "smallMinusIWM": f1(EI["mean_gap_small_minus_iwm_pp"]), "largeMinusIWV": f1(EI["mean_gap_large_minus_iwv_pp"]), "sizeDemeanedFullW": pp(CS["size_demeaned_w"]["full"]["mean"]), "sizeDemeanedFullWT": tv(CS["size_demeaned_w"]["full"]["t"]), "lowVolFullW": pp(CS["low_fwd_vol_w"]["full"]["mean"]), "lowVolFullWT": tv(CS["low_fwd_vol_w"]["full"]["t"]), "belowPninetynineFull": pp(CS["below_p99_raw"]["full"]["mean"]), "belowPninetynineFullT": tv(CS["below_p99_raw"]["full"]["t"]), "fvolGradFull": pp(CS["fwd_vol_gradient"]["full"]["mean"]), "nIWVsnapshots": str(len(RS["snapshots"])),673 "specN": str(R2["spec_curve"]["n_specs"]), "specPos": f"{R2['spec_curve']['share_positive'] * 100:.0f}", "specPosSig": f"{R2['spec_curve']['share_positive_sig_nw'] * 100:.0f}", "specPosSigPlain": f"{R2['spec_curve']['share_positive_sig_plain'] * 100:.0f}", "specMedian": f1(R2["spec_curve"]["median_spread_pct"]), "rwComposFull": f"{dict(zip(MR['sorts_full_w']['members'], MR['sorts_full_w']['p_romano_wolf']))['AI_COMPOS_EW']:.2f}", "hlzCount": str(sum(MR["hlz_summary"].values())),674 "hygieneMonthlyFlagged": str(HY["n_flagged_monthly"]), "hygieneMonthlyBreaks": str(HY["verdicts_monthly"].get("series_break", 0)), "hygieneFYFlagged": str(HY["n_flagged_firm_years"]), "hygieneFYBreaks": str(HY["verdicts_firm_year"].get("series_break", 0)), "hygieneFYRemoved": str(META["n_firm_years_fwd_removed_hygiene"]), "nDedupDropped": str(META["n_rows_before_dedup"] - META["n_rows_after_dedup"]), "nStrictTwelve": n(R["n_strict12"]), "nLtTwelve": str(META["n_est_lt12_valid"]), "aaplCapTwentyEleven": f"{MD['AAPL_cohort2010_cap_v2_usd'] / 1e9:.0f}", "aaplRankTwentyEleven": f"{MD['AAPL_cohort2010_rank_v2']:.0f}", "logCapMin": f"{MD['log_cap_min_max_v2'][0]:.1f}", "logCapMax": f"{MD['log_cap_min_max_v2'][1]:.1f}"})675676# ---------------- new Stage E macros (robust statistics already carried by the legacy block are not duplicated) ----------------677MAC.update({"nExhibitTables": str(len([e for e in EXHIBITS if e["kind"] == "table"])), "nIWVcaptures": str(len(RS["snapshots"])), "attritionSmallExitMax": f"{max(v['small'] for v in AE.values() if v.get('small') is not None) * 100:.1f}", "attritionLargeExitMax": f"{max(v['large'] for v in AE.values() if v.get('large') is not None) * 100:.1f}",678 "boundReqExitHalf": f"{BD['required_exit_rate_difference_e1_minus_e5']['r_x=-0.5'] * 100:.1f}", "boundReqExitFull": f"{BD['required_exit_rate_difference_e1_minus_e5']['r_x=-1.0'] * 100:.1f}", "evLargeWelchRef": f"{WR['large']['t_welch']:.2f}", "evFullWelchRef": f"{WR['full']['t_welch']:.2f}",679 "placeboTmin": f"{min(PS['t_cda_by_launch'][y] for y in PS['t_cda_by_launch'] if y != '2022'):.2f}", "placeboTmax": f"{max(PS['t_cda_by_launch'][y] for y in PS['t_cda_by_launch'] if y != '2022'):.2f}", "evHolmMin": f"{min(ME['p_holm']):.3f}", "evBHMin": f"{min(ME['p_bh']):.3f}",680 "mhtRobustPreRWmin": f"{min(MR['robustness_pre_w']['p_romano_wolf']):.2f}", "mhtRobustPostRWmin": f"{min(MR['robustness_post_w']['p_romano_wolf']):.2f}", "mhtSortsFullRWmin": f"{min(MR['sorts_full_w']['p_romano_wolf']):.2f}", "cyberIntRWp": f"{rw['Cybersecurity']:.2f}",681 "largePostExTwentyFourWCI": cip(G["large_top1000"]["pooled_post_excl_2024_w"]["ci95_firm_pct"]), "contrastLargeMinusSmallBootCI": cip(CT["large_minus_small_postpre_boot_w"]["ci95_boot_pct"]), "contrastLargeMinusSmallBoot": f1(CT["large_minus_small_postpre_boot_w"]["diff_in_diff_pct"]),682 "sectorFEslopeFull": f"{Lc['pooled_all_full']['sector_year_fe']['coef_pct']:+.2f}", "sectorFEslopeFullTtw": tv(Lc["pooled_all_full"]["sector_year_fe"]["t_twoway"]), "sectorFEslopeFullPwild": pv(Lc["pooled_all_full"]["sector_year_fe"].get("p_wild_webb")), "specIQRlo": f1(R2["spec_curve"]["iqr_spread_pct"][0]), "specIQRhi": f1(R2["spec_curve"]["iqr_spread_pct"][1]), "specNegSig": f"{R2['spec_curve']['share_negative_sig_nw'] * 100:.1f}",683 "formWaldStat": f"{wd['stat']:.2f}", "cohortTwentyTwoPostFilingShare": f"{c22['share_filings_post_launch'] * 100:.1f}", "thenMembersCohorts": ", ".join(f"{y}: all {pp(v['spread_all_w'])} vs members {pp(v['spread_members_w'])}" for y, v in TM.items())})684if RC: MAC.update({"kwSpearman": f"{RC['signals']['z_KW']['spearman_with_composite']:.2f}", "kwFullW": pp(RC["signals"]["z_KW"]["full_w"]["mean"]), "kwFullWT": tv(RC["signals"]["z_KW"]["full_w"]["t"]), "kwFMW": f"{RC['signals']['z_KW']['fm_w']['slope_pct']:+.2f}", "kwFMWT": tv(RC["signals"]["z_KW"]["fm_w"]["t"]), "altSpearman": f"{RC['signals']['z_ALT']['spearman_with_composite']:.2f}", "altFullW": pp(RC["signals"]["z_ALT"]["full_w"]["mean"]), "altFullWT": tv(RC["signals"]["z_ALT"]["full_w"]["t"]), "altFMW": f"{RC['signals']['z_ALT']['fm_w']['slope_pct']:+.2f}", "altFMWT": tv(RC["signals"]["z_ALT"]["fm_w"]["t"]), "exUtilFullW": pp(RC["ex_utilities_energy"]["full_w"]["mean"]), "exUtilFullWT": tv(RC["ex_utilities_energy"]["full_w"]["t"]), "utilShareQfive": f"{RC['utilities_share_q5_vs_all'][0] * 100:.1f}", "utilShareAll": f"{RC['utilities_share_q5_vs_all'][1] * 100:.1f}", "kwShareZero": f"{RC['signals']['z_KW']['share_zero'] * 100:.0f}"})685PREAMBLE = r"""% ---- Exhibit wrappers (Stage E, Agent 9). Each generated table/figure file is a self-contained float. ----686% \ExhibitTable{label}{caption}{size}{body}: prints a table float when \input on its own; inside an existing \begin{table}687% wrapper (\@captype defined) it prints only the body, so the old wrappers in the sections keep compiling until they are replaced688% by a bare \input{tables/<name>}. \ExhibitFigure{label}{caption}{content} does the same for figures.689% Both wrappers record the label as placed, and \ExhibitOnce{label}{...} prints its argument only if the label has not been placed yet690% (used by tables/appendix_exhibits.tex as a safety net: an exhibit placed in the sections, in either convention, is not printed twice).691\usepackage{makecell}692\makeatletter693\providecommand{\ExhibitTable}{}\renewcommand{\ExhibitTable}[4]{\global\@namedef{exh@done@#1}{}\ifx\@captype\@undefined\begin{table}[htbp]\centering #3\caption{#2}\label{#1}#4\end{table}\else #4\fi}694\providecommand{\ExhibitFigure}{}\renewcommand{\ExhibitFigure}[3]{\global\@namedef{exh@done@#1}{}\ifx\@captype\@undefined\begin{figure}[htbp]\centering #3\caption{#2}\label{#1}\end{figure}\else #3\fi}695\providecommand{\ExhibitOnce}{}\renewcommand{\ExhibitOnce}[2]{\@ifundefined{exh@done@#1}{\global\@namedef{exh@done@#1}{}#2}{}}696\makeatother697% ---- Number macros: every value below is read from a result file by scripts/r3k_20_tables_v2.py; legacy names keep the legacy698% statistic (e.g. \meventT is the Welch t), the robust versions carry suffixes W / CDA / Ttw / CI / MDE / Pwild. ----699"""700open(f"{P}/macros.tex", "w").write(PREAMBLE + "".join(f"\\newcommand{{\\m{k}}}{{{v}}}\n" for k, v in MAC.items())); json.dump(MAC, open(f"{T}/inline_numbers.json", "w"), indent=1); print("macros", len(MAC))701json.dump({"generated_by": SCRIPT, "baseline": BASELINE, "exhibits": EXHIBITS}, open(f"{P}/EXHIBIT_MAP.json", "w"), indent=1); print("exhibit map", len(EXHIBITS))702FIGM = json.load(open("figures/r3k_v2/FIGURE_MAP.json")) if os.path.exists("figures/r3k_v2/FIGURE_MAP.json") else []703FIG_PLACE = {"fig:trend": "main", "fig:cohortsboth": "main", "fig:cumboth": "main", "fig:cohorts": "main", "fig:placebobreaks": "main", "fig:fmyear": "main", "fig:sizegroups": "main", "fig:event": "main", "fig:eventtime": "main", "fig:speccurve": "main", "fig:placebolaunches": "main", "fig:double": "appendix", "fig:placebo": "appendix", "fig:filingtype": "appendix", "fig:quintiles": "appendix", "fig:cumls": "appendix", "fig:attrition": "appendix"}704md = ["# Exhibit map — FIRC-0002 v2.1 (generated by scripts/r3k_20_tables_v2.py; do not edit)", "", "Every table file in `paper/tables/` and every figure wrapper in `paper/figures_r3k/` is a self-contained float: `\\input{tables/<name>}` or `\\input{figures_r3k/<name>}` prints the float with its caption, label and notes. `paper/tables/appendix_exhibits.tex` (input from `main.tex` after the appendix) prints, behind `\\ExhibitOnce` guards, every table not already placed and the appendix-bound figures. Placement = the Stage E decision (main text vs appendix).", "", "| Label | File | Placement | Title | Sources |", "|---|---|---|---|---|"]705for e in EXHIBITS: md.append(f"| `{e['label']}` | `{e['file']}` | {e['placement']} | {e['title']} | {e['sources']} |")706for e in FIGM: md.append(f"| `{e['label']}` | `{e['wrapper']}` (PDF `{e['file']}`) | {FIG_PLACE.get(e['label'], 'main')} | {e['title']} | {e['script']} |")707open(f"{P}/EXHIBIT_MAP.md", "w").write("\n".join(md) + "\n"); print("EXHIBIT_MAP.md", len(EXHIBITS) + len(FIGM), "rows")708