match
Estimate treatment effects by pairing treated and control units on covariates with propensity-score, Mahalanobis, CEM, optimal/full, kernel, or radius methods; returns balance diagnostics.
Instructions
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: certified evidence with scoped limitations. Known limitations: greedy nearest-neighbour matching without replacement is order-dependent: the m_order convention can differ across packages and materially moves the estimate (>5x spread on MatchIt::lalonde with Mahalanobis distance). m_order='data' and 'closest' reproduce MatchIt exactly; m_order='farthest' is StatsPAI's own dynamic rule and is not MatchIt-equivalent; bias_correction=True follows a different convention from Matching::Match's BiasAdjust: StatsPAI regresses on the full covariate vector with unweighted OLS over all controls, the reference regresses on the matching variables weighted by match counts, so bias-corrected estimates can differ from it by about 0.1%. The uncorrected estimate and its Abadie-Imbens standard error are exact.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"covariates": "<covariates>",
"treat": "<treat>",
"y": "<y>"
},
"name": "match"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | ||
| treat | Yes | 0/1 treatment. | |
| detail | No | Payload depth; agent is the fullest. | agent |
| method | No | nearest | |
| data_id | No | Data handle (d_...) from load_data; replaces data_path. | |
| data_csv | No | Small inline table as CSV text. | |
| estimand | No | ATT | |
| as_handle | No | Cache the fit and return its result_id. | |
| data_path | No | Absolute path of a data file on the server. | |
| result_id | No | Handle of an earlier fit made with as_handle=true. | |
| covariates | Yes | ||
| data_records | No | Small inline table as row objects. | |
| max_output_bytes | No | Result byte budget (default 262144; 0 = none). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||