hypothesis_testing
Run statistical hypothesis tests (t-test, ANOVA, chi-square, correlation) and get p-value with reject/fail-to-reject decision at your chosen alpha level.
Instructions
Run a statistical hypothesis test and report the p-value with a reject / fail-to-reject decision at the chosen alpha. Supports independent (Welch) and paired t-tests, Pearson-correlation significance, chi-square independence, and one-way ANOVA. Returns a markdown report with the test statistic, p-value, and conclusion. Use this when you need significance; for descriptive correlation without inference use advanced_statistical_analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Shape depends on testType: t-tests and ANOVA take an array of numeric groups (number[][]); correlation takes two numeric arrays or an array of {x,y} records (see variables); chi_square takes a contingency table (rows x columns of counts). | |
| alpha | No | Significance level for the reject/fail decision, 0.01-0.1 (default 0.05). | |
| testType | Yes | Which test to run: 't_test_independent' (Welch, two independent groups), 't_test_paired' (two paired groups), 'correlation' (Pearson r + significance), 'chi_square' (independence on a contingency table), or 'anova' (one-way, 2+ groups). | |
| variables | No | For 'correlation' only: the two record keys to correlate when data is an array of objects. Ignored otherwise. | |
| alternativeHypothesis | No | Direction: 'less' or 'greater' for a one-sided test; anything else (or omit) is two-sided. |