Propensity score matching (PSM) / 倾向性评分匹配 PSM
propensity_score_matchingPropensity score matching (PSM) / 倾向性评分匹配 PSM | USE WHEN: match treated and control subjects on baseline covariates (1:1 nearest neighbour within caliper), then report SMD balance | ALIASES: PSM, 倾向性评分, 倾向评分匹配, propensity score, 1:1匹配, 基线可比, 混杂控制, 匹配后均衡 | RETURNS: 匹配后样本与均衡性
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"data": [
{
"age": 62,
"sex": 0,
"treat": 1
},
{
"age": 58,
"sex": 1,
"treat": 0
},
{
"age": 65,
"sex": 0,
"treat": 1
},
{
"age": 61,
"sex": 1,
"treat": 0
},
{
"age": 70,
"sex": 0,
"treat": 1
},
{
"age": 55,
"sex": 0,
"treat": 0
}
],
"caliper": 0.2,
"treatment": "treat",
"covariates": [
"age",
"sex"
]
},
"name": "propensity_score_matching"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | 样本表:每行一个受试者的字典,如 [{"treat":1,"age":62,"sex":0}, …](也可改用 treatment/covariates 直接传数组) | |
| ratio | No | 匹配比例,默认 1 | |
| treatment | Yes | 处理变量(1=处理组,0=对照组)。传 data 时填列名 "treat";也可直接传 0/1 数组 | |
| covariates | Yes | 协变量列名数组,如 ["age","sex"](传 data 时)或二维数值矩阵 |