Two-Sample t-Test
stats_t_testCompare two groups of numeric data using Student's or Welch's t-test, and include Cohen's d effect size.
Instructions
Run a two-sample Student or Welch t-test with Cohen's d effect size.
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": {
"group_a": "<group_a>",
"group_b": "<group_b>"
},
"name": "stats_t_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_a | Yes | First group of numeric observations (at least 2 values). | |
| group_b | Yes | Second group of numeric observations (at least 2 values). | |
| equal_var | No | If True use Student's t-test (pooled variance, df = n1+n2-2); if False use Welch's t-test (unequal variances, fractional df). | |
| alternative | No | Alternative hypothesis: 'two-sided', 'less', or 'greater'. | two-sided |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | Yes | Degrees of freedom (Welch: fractional; Student: n1+n2-2). | |
| method | Yes | Student (equal variances) or Welch (unequal variances). | |
| p_value | Yes | p-value for the requested alternative hypothesis. | |
| cohens_d | Yes | Effect size: Cohen's d = (mean_a - mean_b) / pooled_sd (positive when group_a mean is larger). | |
| statistic | Yes | The t statistic. | |
| alternative | Yes | Alternative hypothesis tested. |