| 36 | def pct(x, d=1): return "--" if x is None else f"{x * 100:.{d}f}\\%" |
36 | def pct(x, d=1): return "--" if x is None else f"{x * 100:.{d}f}\\%" |
| 37 | def br(t): return "--" if t is None or (isinstance(t, float) and np.isnan(t)) else f"[{t:.2f}]" # t in brackets |
37 | def br(t): return "--" if t is None or (isinstance(t, float) and np.isnan(t)) else f"[{t:.2f}]" # t in brackets |
| 38 | def tex(s): return str(s).replace("&", "\\&").replace("%", "\\%").replace("_", "\\_") |
38 | def tex(s): return str(s).replace("&", "\\&").replace("%", "\\%").replace("_", "\\_") |
| |
39 | +def 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')}" |
| 39 | MAC = {}; EXHIBITS = [] |
42 | MAC = {}; EXHIBITS = [] |
| 40 | TABLE_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; " |
43 | TABLE_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; " |
| 41 | "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 " |
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 " |
| 71 | body = "" |
74 | body = "" |
| 72 | for k, (l, d) in lab.items(): |
75 | for k, (l, d) in lab.items(): |
| 73 | 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" |
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)] |
| |
79 | +assert 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(",", "{,}") |
| |
81 | +MAXRET_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$')}). ") |
| |
83 | +MAC["maxMadjRetTicker"] = tex(_mx.ticker); MAC["maxMadjRetYear"] = str(int(_mx.fiscal_year)); MAC["maxMadjRetPct"] = _mxpct |
| 74 | table("tab_summary", "tab:summ", "Summary statistics of the estimation sample.", |
84 | table("tab_summary", "tab:summ", "Summary statistics of the estimation sample.", |
| 75 | 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.", |
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.", |
| 76 | "lrrrrrrrr", ["Variable & $N$ & Mean & SD & Min & P1 & Median & P99 & Max"], body, |
86 | "lrrrrrrrr", ["Variable & $N$ & Mean & SD & Min & P1 & Median & P99 & Max"], body, |
| 77 | 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'])}). " |
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'])}). " |
| 78 | 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. " |
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. " |
| 79 | − f"The winsorized return is the dependent variable of every regression and of the headline sorts; the raw return is reported beside it. Source: data/processed\\_r3k\\_v2/analysis\\_panel\\_v2.parquet, results/r3k\\_v2/t1\\_summary\\_stats.csv.", |
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.", |
| 80 | size="\\scriptsize", placement="main", sources="results/r3k_v2/t1_summary_stats.csv, panel_meta_v2.json, mktcap_diag.json, hygiene_summary.json") |
90 | size="\\scriptsize", placement="main", sources="results/r3k_v2/t1_summary_stats.csv, panel_meta_v2.json, mktcap_diag.json, hygiene_summary.json") |
| 81 | # ================================================================ T5 quintile sorts, both universes (main) ==== |
91 | # ================================================================ T5 quintile sorts, both universes (main) ==== |
| 82 | SIGL = [("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)")] |
92 | SIGL = [("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)")] |
| 94 | for i, sfx in enumerate(rows): body += sort_row(SM["sorts"], k, l, sfx, i == 0) |
104 | for i, sfx in enumerate(rows): body += sort_row(SM["sorts"], k, l, sfx, i == 0) |
| 95 | if sname == "r3k": body += "\\midrule\n" |
105 | if sname == "r3k": body += "\\midrule\n" |
| 96 | VD = R["vw_diag"] |
106 | VD = 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 EVERY |
| |
108 | +# full-sample VW sort of the nine signals (r3k_15 regex "_VW$|_VW_w$", raw and winsorized variants counted separately), while |
| |
109 | +# worst_cells_v2 is the composite sort alone. Both statistics are made explicit here from results/r3k_v2/vw_weights_diag.csv (written by |
| |
110 | +# r3k_15 beside results.json), the worst cell of each universe is named, and the all-sorts figures are asserted equal to vw_diag. |
| |
111 | +vwd_ = 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"} |
| |
112 | +def _vw_universe(suffix_re, prefix_ok=("r3k_", "sp500_")): return vwd_[vwd_["sort"].str.contains(suffix_re, regex=True) & ~vwd_["sort"].str.startswith(prefix_ok)] |
| |
113 | +def _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])} |
| |
116 | +VWALL = _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"]) |
| |
117 | +assert 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) |
| |
118 | +assert 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) |
| |
119 | +def vwcell(x): return f"{x['ticker']}, {x['cohort']} cohort, quintile {x['q']}" |
| |
120 | +VW_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)") |
| 97 | table("tab_sorts_both", "tab:sortsboth", "Quintile sorts on AI language in the Russell~3000 universe and among S\\&P~500 members.", |
124 | table("tab_sorts_both", "tab:sortsboth", "Quintile sorts on AI language in the Russell~3000 universe and among S\\&P~500 members.", |
| 98 | 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.", |
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.", |
| 99 | "llrrrrrrrrr", HDR5, body, |
126 | "llrrrrrrrrr", HDR5, body, |
| 100 | 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. " |
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. " |
| 101 | − f"VW diagnostic: maximum single-firm weight in any cohort $\\times$ quintile cell {VD['max_single_firm_weight_v2'] * 100:.0f}\\% (committed v2.0 capitalization: {VD['max_single_firm_weight_v1'] * 100:.1f}\\%); cells above 25\\%: {VD['n_cells_above_25pct_v2']} (v2.0: {VD['n_cells_above_25pct_v1']}); 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'])}). " |
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'])}). " |
| 102 | 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}}.", |
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}}.", |
| 103 | size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.sorts, vw_diag), results2.json (mht)") |
130 | size="\\scriptsize", colsep="3pt", placement="main", sources="results/r3k_v2/results.json (samples.*.sorts, vw_diag), results2.json (mht)") |
| 104 | # ================================================================ appendix: full sorts (all signals / weightings, Russell 3000) ==== |
131 | # ================================================================ appendix: full sorts (all signals / weightings, Russell 3000) ==== |
| 109 | table("tab_sorts", "tab:sorts", "Quintile sorts on every signal and weighting, Russell~3000 universe.", |
136 | table("tab_sorts", "tab:sorts", "Quintile sorts on every signal and weighting, Russell~3000 universe.", |
| 110 | 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).", |
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).", |
| 111 | "llrrrrrrrrr", HDR5, body, |
138 | "llrrrrrrrrr", HDR5, body, |
| 112 | − 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 {VD['max_single_firm_weight_v2'] * 100:.0f}\\%.", |
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\\%).", |
| 113 | size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results.json (sorts, vw_diag)") |
140 | size="\\scriptsize", colsep="3pt", placement="appendix", sources="results/r3k_v2/results.json (sorts, vw_diag)") |
| 114 | # ================================================================ T6 monthly long-short alphas, both universes (main) ==== |
141 | # ================================================================ T6 monthly long-short alphas, both universes (main) ==== |
| 115 | body = "" |
142 | body = "" |
| 556 | def lr(v): return "$-\\infty$" if v is None or (isinstance(v, float) and np.isinf(v)) else f"{v:.1f}" |
583 | def lr(v): return "$-\\infty$" if v is None or (isinstance(v, float) and np.isinf(v)) else f"{v:.1f}" |
| 557 | 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])}]") |
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])}]") |
| 558 | 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})") |
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})") |
| 559 | − body += ba("Max single-firm VW weight in a cohort $\\times$ quintile; cells $>$ 25\\%", f"{VD['max_single_firm_weight_v1'] * 100:.1f}\\%; {VD['n_cells_above_25pct_v1']}", f"{VD['max_single_firm_weight_v2'] * 100:.0f}\\%; {VD['n_cells_above_25pct_v2']}") |
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']}") |
| 560 | 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'])}]") |
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'])}]") |
| 561 | 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'])}]") |
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'])}]") |
| 562 | 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)}") |
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)}") |
| 621 | "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}", |
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}", |
| 622 | "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']), |
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']), |
| 623 | "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")), |
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")), |
| 624 | − "placeboRank": str(PB["rank_of_2022"]), "placeboN": str(PB["n_candidates"]), "placeboRankW": str(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"]), |
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"]), |
| 625 | "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}", |
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}", |
| 626 | "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), |
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), |
| 627 | "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"]), |
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"]), |
| 629 | "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}", |
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}", |
| 630 | "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"]), |
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"]), |
| 631 | "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), |
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), |
| 632 | − "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}", |
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"]), |
| 633 | "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}", |
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}", |
| 634 | "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"]), |
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"]), |
| 635 | "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()), |
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()), |