Correlation
stats_correlationCompute Pearson or Spearman correlation between two paired variables to quantify their linear or monotonic relationship.
Instructions
Compute Pearson or Spearman correlation between two paired variables.
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": {
"x": "<x>",
"y": "<y>"
},
"name": "stats_correlation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | First variable (numeric observations; same length as y). | |
| y | Yes | Second variable (numeric observations; same length as x). | |
| method | No | Correlation method: 'pearson' or 'spearman'. | pearson |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | Number of paired observations. | |
| method | Yes | Correlation method used. | |
| p_value | Yes | p-value for the correlation. | |
| statistic | Yes | Correlation coefficient (r for Pearson, rho for Spearman). |