multiway_cluster_vcov
Compute N-way cluster-robust variance for OLS coefficients to correct standard errors when observations cluster along multiple dimensions, supporting finite-sample adjustments and PSD projection for valid inference.
Instructions
Compute N-way cluster-robust variance of an OLS coefficient vector. Validation: certified parity evidence.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| X | Yes | Design matrix used in the regression. | |
| resid | Yes | OLS residuals. | |
| 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 |
| clusters | Yes | One or more cluster variables, one per dimension. Non-numeric labels are supported. | |
| n_params | No | Override for the ``k`` used in DOF adjustment; useful when FEs have been absorbed (pass total absorbed DOF here). | |
| 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 | No | 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://. | |
| df_adjust | No | If True, apply the G/(G-1) * (n-1)/(n-k) CR1 finite-sample correction per component variance. If False, uses raw sandwich (useful when the caller has already degreed-freedom adjusted). | |
| 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. | |
| psd_correct | No | Project V onto PSD cone by zeroing negative eigenvalues. | |
| 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 | |||