fepois
Estimate Poisson regression with high-dimensional fixed effects for count outcomes. Controls for group heterogeneity and delivers PPML-consistent coefficients with robust inference.
Instructions
Estimate Poisson regression with high-dimensional fixed effects via pyfixest. Validation: certified parity evidence. Assumptions: Conditional mean exponential link: E[y | x, alpha] = exp(x'beta + alpha); Strict exogeneity conditional on the absorbed fixed effects (PPML consistency). Pre-conditions: Outcome is a non-negative count or non-negative continuous variable; Fixed effects columns are categorical; absorbed groups exist. Failure modes: Convergence failure or extreme exponentiated predictions -> Drop large-magnitude regressors, rescale, or switch to OLS on log(1+y) (with caveats); Separation: some FE level perfectly predicts zero outcomes -> Drop perfectly-predicted groups and rerun; document the restriction. Alternatives: sp.feols, sp.regress, sp.panel. Typical minimum N: 200.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fml | Yes | pyfixest formula. E.g. ``"Y ~ X1 | firm"``. | |
| ssc | No | Small-sample correction. | |
| seed | No | RNG seed for sampled (non-enumerated) ``vce="wild"`` draws. | |
| vcov | No | Variance-covariance estimator (``vce=`` is the canonical alias). Besides the pyfixest values (``"iid"``, ``"HC1"``, ``{"CRV1": "firm"}``, ...), accepts the extended menu: - ``vce="CR2"`` / ``"CR3"`` / ``"jackknife"`` (with ``cluster=``) -- clubSandwich glm bias-reduced cluster-robust SEs on the FE-as-dummies design; matches R ``clubSandwich::vcovCR(glm)``. - ``vce="wild"`` (with ``cluster=``) -- restricted score wild cluster bootstrap (Kline-Santos 2012) with Stata ``boottest``'s exact studentization; bit-exact vs ``boottest`` in the enumerated regime. | |
| 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 id column for the extended ``vce=`` menu; also a shorthand for one-way ``{"CRV1": cluster}``. | |
| weights | No | Column name for regression weights (not supported with the extended ``vce=`` menu). | |
| fixef_rm | No | Singleton fixed effect handling. | none |
| iwls_tol | No | IWLS convergence tolerance. | |
| 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. | |
| wild_reps | No | Replications for ``vce="wild"``. When ``2**G <= wild_reps`` the full Rademacher grid is enumerated (deterministic). | |
| collin_tol | No | Collinearity tolerance. | |
| conley_lat | No | conley_lat parameter (Optional[str]). | |
| conley_lon | No | conley_lon parameter (Optional[str]). | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| iwls_maxiter | No | Max IWLS iterations. | |
| conley_cutoff | No | conley_cutoff parameter (Optional[float]). | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. | |
| wild_weight_type | No | Wild weight distribution (``"rademacher"`` or ``"webb"``). | rademacher |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||