effective_f_test
Detect weak instruments using the robust effective F statistic, preventing biased causal estimates in IV analysis. Supports heteroskedasticity-robust and clustered variance options.
Instructions
Olea-Pflueger (2013) robust effective F statistic for weak instruments. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exog | No | Included exogenous controls (a constant is added automatically). | |
| vcov | No | Variance estimator for the first-stage residuals: - ``'classic'`` -- homoskedastic; F_eff equals first-stage F. - ``'HC0'`` -- White heteroskedasticity-robust. - ``'HC1'`` -- HC0 with small-sample correction ``n/(n-k)``. Ignored when ``cluster`` is given. | HC1 |
| endog | Yes | Endogenous regressor (single endogenous variable). | |
| absorb | No | High-dimensional fixed effects to partial out of the endogenous regressor, the instruments and the controls before the first stage -- the same residualisation ``sp.iv(absorb=...)`` performs, so the effective F describes the specification actually fitted. The absorbed degrees of freedom are charged to ``df_resid``. | |
| 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 |
| cluster | No | Cluster the first-stage moment variance. ``Omega`` becomes the (multiway, Cameron-Gelbach-Miller) cluster-sum meat with the ``ivreg2`` finite-sample factor ``G_min/(G_min-1) * (n-1)/(n-K)``. This is the right diagnostic whenever the second stage is | |
| 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. | |
| instruments | Yes | Excluded instruments. | |
| 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 | |||