wild_cluster_bootstrap
Corrects cluster-robust inference when the number of clusters is small (G < 30) by resampling cluster-level weights to build a percentile-t distribution, preventing over-rejection.
Instructions
Cameron-Gelbach-Miller (2008) wild cluster bootstrap -- the canonical fix for cluster-robust inference with few clusters (G < 30). Re-samples cluster-level Rademacher weights to construct a percentile-t reference distribution that has correct size when the standard cluster-robust z-test rejects too often. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Do NOT use when: the number of clusters is large (say > 50) -- ordinary CRV1 standard errors are already reliable and much cheaper. Cost: Runtime is roughly n_boot x (one restricted refit). This is the intended trade for few-cluster validity -- do not raise n_boot inside an outer search loop. Assumptions: Errors are exchangeable within clusters (Rademacher weights are robust to most departures); Number of clusters G >= 5 for finite-sample validity. Pre-conditions: long-format dataset with a cluster identifier present; treatment / test variable varies within at least some clusters; test_var (or first column of x) is the coefficient under test. Failure modes: Multi-way clustering requested -> Multi-way wild cluster bootstrap is not yet supported; see sp.subcluster_wild_bootstrap...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Right-hand-side variables | |
| y | Yes | Outcome variable | |
| h0 | No | Null value of the coefficient | |
| seed | No | Random seed for reproducible stochastic steps. | |
| alpha | No | Significance level for confidence intervals and tests. | |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| n_boot | No | Number of bootstrap replications. | |
| cluster | Yes | Cluster identifier | |
| test_var | No | Variable being tested; defaults to first in x | |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | Yes | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| weight_type | No | Bootstrap weight distribution | rademacher |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||