{
  "slug": "io-github-brycewang-stanford-statspai",
  "name": "StatsPAI",
  "auditedAt": "2026-11-16T12:57:35Z",
  "version": "1.43.1",
  "ecosystem": "pypi",
  "package": "statspai",
  "disclaimer": "Automated smoke test, not a security guarantee.",
  "complete": true,
  "checks": {
    "versionPin": {
      "status": "pass",
      "detail": "Pinned pypi statspai@1.43.1",
      "version": "1.43.1"
    },
    "vulnerabilities": {
      "status": "pass",
      "detail": "No critical, high, or medium advisories were returned.",
      "critical": 0,
      "high": 0,
      "medium": 0,
      "low": 0,
      "packagesScanned": 1
    },
    "license": {
      "status": "pass",
      "detail": "MIT",
      "spdx": "MIT"
    },
    "installScripts": {
      "status": "pass",
      "detail": "No preinstall, install, postinstall, or prepare script.",
      "scripts": []
    },
    "secrets": {
      "status": "pass",
      "detail": "No credential patterns in the published artifact.",
      "findings": []
    },
    "packageSize": {
      "status": "pass",
      "detail": "11724982 bytes",
      "bytes": 11724982
    },
    "activity": {
      "status": "pass",
      "detail": "Active 4 days ago.",
      "ageDays": 4
    },
    "sandbox": {
      "status": "pass",
      "detail": "MCP handshake completed. 45 tools listed.",
      "starts": true,
      "handshake": true,
      "timeToReadyMs": 9689,
      "tools": [
        {
          "name": "audit",
          "description": "Reviewer-grade audit on a result. Returns the literature checklist (parallel-trends test, honest-DID, Bacon decomposition, placebo, balance, ...) with status per item and the concrete suggest_function to call to fill any missing high-import"
        },
        {
          "name": "audit_result",
          "description": "Reviewer-grade audit of a fitted result (result_id from an as_handle=true call): every robustness check the literature expects for the design, with status 'passed|failed|missing|not_applicable' and a suggest_function for each missing one. n"
        },
        {
          "name": "bacon_decomposition",
          "description": "Goodman-Bacon (2021) decomposition: breaks the two-way fixed-effects DID estimator into its 2x2 comparison weights. Reveals whether treated-vs-treated comparisons (which can have negative weights) dominate the estimate. Run this before trus"
        },
        {
          "name": "bibtex",
          "description": "Return verified BibTeX entries from paper.bib (StatsPAI's single source of truth for citations). Pass one or more bib keys (e.g. 'callaway2021difference'). NEVER invent citations -- call this tool instead. Unknown keys return an empty entry"
        },
        {
          "name": "brief",
          "description": "One-line brief of a fitted result (estimand, estimate, SE, CI, N). Same output as brief_result."
        },
        {
          "name": "brief_result",
          "description": "Return the one-line agent-friendly brief for a fitted result. Uses sp.brief(). Useful when an agent wants to summarise a chained workflow without paying for the full JSON payload again."
        },
        {
          "name": "call_function",
          "description": "Run ANY registered StatsPAI function by name with keyword arguments -- the escape hatch for the ~1,200 functions that are not individually listed as tools. `arguments` follows the parameter schema from describe_function; column names refer "
        },
        {
          "name": "callaway_santanna",
          "description": "Staggered DID (Callaway-Sant'Anna 2021): group-time ATT with doubly-robust, IPW, or regression-adjusted estimators. Robust to heterogeneous treatment effects where TWFE fails. Requires a cohort column g (first-treatment period; 0 = never-tr"
        },
        {
          "name": "causal",
          "description": "End-to-end causal workflow: diagnose -> recommend estimator -> fit -> run robustness -> return result. The one-shot entry point that lets an agent analyse a dataset in a single call without orchestrating stages itself."
        },
        {
          "name": "check_identification",
          "description": "Design-level identification diagnostics: bad controls, overlap, cohort sizes, IV first-stage F, clustering. Run BEFORE fitting any estimator to surface design problems."
        },
        {
          "name": "cross_validate",
          "description": "Cross-validate ONE estimand across INDEPENDENT engines (StatsPAI, pyfixest, linearmodels, DoubleML, R's fixest, Stata) and report whether they agree (AGREE / PARTIAL / DISAGREE / INSUFFICIENT). Use this to honour the cross-package reproduci"
        },
        {
          "name": "describe_data",
          "description": "Profile a dataset (data_id, data_path or inline data): shape, dtypes, missing counts, head, numeric summary and -- for a handle -- the lineage of transforms that produced it."
        },
        {
          "name": "describe_function",
          "description": "Full machine-readable metadata for one registered StatsPAI function: JSON-Schema parameters (types, defaults, enums), assumptions, pre-conditions, failure modes, alternatives, validation tier and evidence notes, plus the accepted keyword al"
        },
        {
          "name": "detect_design",
          "description": "Auto-detect the study design (panel / cross-section / RD / IV-style) from column shapes and types. Returns the guessed design plus the columns that drove the inference. Call this BEFORE recommend() when the user pastes a CSV with no context"
        },
        {
          "name": "did",
          "description": "Difference-in-differences dispatcher. 2x2 (two periods, 0/1 treat) when id is omitted; with id, a 0/1 indicator on a multi-period panel is converted to first-treatment cohorts and Callaway-Sant'Anna runs. Pass method= to force '2x2', 'cs', "
        },
        {
          "name": "dml",
          "description": "Double/debiased machine learning (Chernozhukov et al. 2018) with cross-fitting: partially linear (plr), interactive (irm, binary treatment), and the IV versions (pliv, iivm). Treatment effect under selection on observables with flexible nui"
        },
        {
          "name": "ebalance",
          "description": "Hainmueller (2012) entropy balancing. Targets the ATT by exactly balancing covariate means across treatment groups. No propensity-score model specification needed. Validation: certified parity evidence."
        },
        {
          "name": "feols",
          "description": "OLS with high-dimensional fixed effects (R fixest / Stata reghdfe syntax): 'y ~ x1 + x2 | unit + year'. IV as 'y ~ x | fe | d ~ z'. vcov: 'iid', 'hetero', or {'CRV1': 'cluster_col'} (two-way: 'a + b'). Validation: certified parity evidence."
        },
        {
          "name": "from_r",
          "description": "Translate a single R / fixest / felm / did expression to a verified StatsPAI tool-call payload. Returns the same shape as from_stata. Supported callables: feols / felm / lm / att_gt / did. Pass ONE expression -- no assignment, no piping. Va"
        },
        {
          "name": "from_stata",
          "description": "Translate a single Stata command to a verified StatsPAI tool-call payload. Returns ``python_code`` (string for chat replies) AND ``arguments`` (ready-to-dispatch JSON-RPC for tools/call). Tier-1 commands: regress / xtreg / reghdfe / ivreg2 "
        },
        {
          "name": "honest_did",
          "description": "Rambachan-Roth (2023) 'honest' DID sensitivity analysis. Operates on a fitted event-study / DID result: pass ``result_id`` from a prior ``sp.event_study`` / ``sp.callaway_santanna`` / ``sp.did_imputation`` / ``sp.sun_abraham`` fit run with "
        },
        {
          "name": "honest_did_from_result",
          "description": "Rambachan-Roth (2023) honest CIs on a fitted DID / event-study result; betas and sigma are read off the result. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact)."
        },
        {
          "name": "interpret_result",
          "description": "Natural-language interpretation of a fitted result (result_id): the estimate, its uncertainty and what the design does / does not identify, grounded in the result's own numbers. Uses the client's model via MCP sampling when advertised (no A"
        },
        {
          "name": "iv",
          "description": "Instrumental-variables dispatcher: 2SLS, LIML, Fuller or GMM via method=, with first-stage, weak-IV (effective F) and endogeneity diagnostics. Formula 'y ~ x + (d ~ z1 + z2)'. Validation: certified parity evidence."
        },
        {
          "name": "ivreg",
          "description": "2SLS instrumental-variables regression with first-stage F diagnostics; classical SEs unless robust=. Formula syntax: 'y ~ x_exog + (d_endog ~ z_instrument)'. Validation: certified parity evidence."
        },
        {
          "name": "load_data",
          "description": "Load a dataset into the server and get a data_id handle. Source: data_path (file or URL), data_records (JSON rows) or data_csv (CSV text). Returns the handle plus shape, dtypes, missing counts, the first rows and a numeric summary. Pass dat"
        },
        {
          "name": "match",
          "description": "Matching estimator dispatcher (ATT by default): nearest-neighbour on the propensity score or Mahalanobis distance, Abadie-Imbens nnmatch, CEM, optimal / full matching, kernel, radius, ... via method=. Returns balance diagnostics. Validation"
        },
        {
          "name": "pipeline_did",
          "description": "End-to-end DID workflow: preflight -> did/CS estimator -> audit -> honest-DID sensitivity -> bacon decomposition -> brief. Returns one markdown report + the primary result_id. Use this when the user pastes a DID dataset and asks 'is the eff"
        },
        {
          "name": "pipeline_iv",
          "description": "End-to-end IV workflow: ivreg -> first-stage F (effective + Olea-Pflueger) -> Anderson-Rubin CI -> e-value. Returns one markdown report + result_id."
        },
        {
          "name": "pipeline_rd",
          "description": "End-to-end RD workflow: rdrobust -> rdplot (PNG image) -> rddensity (McCrary) -> rdsensitivity (bandwidth). Returns one markdown report + result_id + an image content block."
        },
        {
          "name": "plot_from_result",
          "description": "Render a fitted result's diagnostic plot (event study, rdplot, synth gap, balance, ROC) as a PNG image block. Optional edits restyle it with the data locked."
        },
        {
          "name": "preflight",
          "description": "Run pre-fit identification checks for a chosen method on a DataFrame. Verdict in {PASS, WARN, FAIL}. ALWAYS call this before fitting on an unfamiliar dataset to surface design problems (overlap, cohort sizes, IV first-stage F, running-varia"
        },
        {
          "name": "rdrobust",
          "description": "Sharp or fuzzy regression-discontinuity with robust bias-corrected CIs (Calonico-Cattaneo-Titiunik 2014). Use fuzzy= for IV-style fuzzy RD. Validation: certified evidence with scoped limitations. Known limitations: the weighted rbc bootstra"
        },
        {
          "name": "recommend",
          "description": "Method advisor: given a dataset + research question, recommends a ranked list of estimators with reasoning, precondition checks, and a full suggested workflow. This is the first call an agent should make if it doesn't know which estimator t"
        },
        {
          "name": "regress",
          "description": "Fit an OLS regression; classical SEs unless robust= or cluster=. Input is a Wilkinson-style formula like 'y ~ x1 + x2'. Use this for baseline specifications or covariate-adjusted RCT analyses. Validation: certified parity evidence."
        },
        {
          "name": "route_estimator",
          "description": "Route a research question to estimator calls without data. Give the family (did / iv / rd / matching / ml_causal / qte / dynamic_panel) and answers to its decision questions; get the matching registered functions with example calls, why eac"
        },
        {
          "name": "sdid",
          "description": "Synthetic difference-in-differences (Arkhangelsky et al. 2021): unit and time weights, one treated unit or block. Long panel; placebo / bootstrap / jackknife SEs. Validation: certified parity evidence."
        },
        {
          "name": "search_functions",
          "description": "Search the StatsPAI function registry by task keywords or a short phrase (e.g. 'staggered adoption event study', 'weak instrument robust CI'). Returns ranked matches with one-line descriptions, category and validation tier. Use it when no l"
        },
        {
          "name": "sensitivity",
          "description": "Unified sensitivity analysis for observational causal estimates -- supports Oster (2019) delta/R-max, Cinelli-Hazlett (2020) omitted-variable bias bounds, and E-values (VanderWeele-Ding 2017). Tells the agent how strong an unobserved confou"
        },
        {
          "name": "sensitivity_from_result",
          "description": "Sensitivity of a cached fit (result_id). 'evalue' (default): E-value from the estimate. 'oster' (delta / R-max) and 'cinelli_hazlett' (OVB bounds) refit OLS of y on treat + controls on the fit's data: from a regress formula (name the term w"
        },
        {
          "name": "spec_curve",
          "description": "Specification-curve analysis (Simonsohn et al. 2020): enumerates every combination of model choices the user declares defensible, runs them all, and returns the sign/magnitude distribution. Use when an agent needs to report robustness acros"
        },
        {
          "name": "sun_abraham",
          "description": "Sun-Abraham (2021) interaction-weighted event study for staggered adoption (Stata eventstudyinteract, fixest sunab). Cohort column g = first-treatment period, 0 / NaN never treated. Validation: certified parity evidence."
        },
        {
          "name": "synth",
          "description": "Synthetic control (Abadie et al.) and its variants through one entry: classic SCM with placebo inference, synthetic DiD, augmented / penalized SCM, generalized SC (gsynth), staggered adoption and more via method=. Panel in long format, one "
        },
        {
          "name": "transform_data",
          "description": "Derive a new dataset from a data_id (or data_path / inline data) by applying `operations` in order, and return a new data_id with the lineage recorded. Operations (each an object with `op`): query {expr} (pandas DataFrame.query), select {co"
        },
        {
          "name": "vcov_from_result",
          "description": "Standard errors of a cached fit (result_id) under another vce: re-runs the fit's own call with only vce= changed, so the SEs equal a direct refit. One vce returns the new result; a list returns a side-by-side table with the ratio to the fit"
        }
      ],
      "toolCount": 45,
      "resourceCount": 6,
      "promptCount": 13,
      "stderrExcerpt": "",
      "network": "disabled",
      "networkAttemptedWhileOffline": false,
      "outboundHosts": [],
      "requiresCredentials": false
    }
  },
  "tier": "gold",
  "tierReason": "Sandbox handshake completed and the published checks passed.",
  "logExcerpt": ""
}