Stat Mediation
stat_mediationTests whether x affects y through mediator m by estimating the indirect effect and reporting its bootstrap confidence interval.
Instructions
Mediation analysis — does x affect y through m?
WHEN TO USE: a plausible causal chain x → m → y, with m measured after x and before y, and a theoretical reason to expect transmission.
WHEN NOT TO USE
Cross-sectional data where the temporal order is only assumed. A significant indirect effect from cross-sectional data does not establish a mechanism; the output states this.
As a fishing expedition across many candidate mediators — with enough mediators, one will show a significant indirect effect by chance.
The indirect effect's bootstrap CI excluding zero is the evidence for mediation. Report that CI, not the Sobel test.
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": {
"name": "<name>",
"x": "<x>",
"m": "<m>",
"y": "<y>"
},
"name": "stat_mediation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| m | Yes | ||
| x | Yes | ||
| y | Yes | ||
| name | Yes | ||
| seed | No | ||
| covar | No | ||
| n_boot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |