panel
Estimate fixed, random, and dynamic panel regression models, then run built-in diagnostics to choose the correct specification for causal analysis.
Instructions
Unified panel regression: FE, RE, between, FD, pooled OLS, two-way FE, Mundlak/Chamberlain CRE, Arellano-Bond, Blundell-Bond system GMM. Results include built-in diagnostics: .hausman_test(), .bp_lm_test(), .f_test_effects(), .pesaran_cd_test(), .compare(method). Validation: certified parity evidence. Assumptions: Static FE: strict exogeneity of regressors conditional on unit fixed effects (E[u_it | x_i, alpha_i] = 0); Random effects: unit effect uncorrelated with regressors; relax with Mundlak / Chamberlain; Dynamic GMM: weak exogeneity and no second-order serial correlation in differenced errors. Pre-conditions: Data is a long-format panel keyed by (entity, time) with at least 2 time periods per entity; Outcome and regressors are numeric or properly encoded; Method-specific structure satisfied (e.g. dynamic GMM needs T moderate, system GMM needs initial-condition validity). Failure modes: Hausman test rejects RE -> Switch to fixed effects (method='fe') or correlated random effects (method='mundlak'); Few clusters (< 30) inflate Type I error with cluster-robust SEs -> Use wild-cluster bootstrap or CR2/CR3 small-sample corrections; High-dimensional fixed effects make the design si...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lags | No | AR lags for dynamic panel (ab/system) | |
| time | Yes | Time column | |
| 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 |
| entity | Yes | Unit identifier column | |
| method | No | Estimation method | fe |
| robust | No | Standard errors: nonrobust, robust, kernel, driscoll-kraay | nonrobust |
| cluster | No | Cluster variable: entity, time, or twoway | |
| formula | Yes | Regression formula: 'y ~ x1 + x2' | |
| twostep | No | Two-step GMM | |
| gmm_lags | No | GMM instrument lag range | (2, 5) |
| 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. | |
| 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 | |||