pearson_correlation
Assess linear correlation between two paired variables with a hypothesis test, returning r, df, p-value, confidence interval, and citation.
Instructions
Test for a linear association between two paired variables -- e.g. "does hours studied predict test score?" statistic is r itself (in [-1, 1]), not a t-statistic. Returns r, df (n-2), a two-tailed p-value (H0: r=0), a confidence interval for r via the Fisher z-transform, a citation, and warnings. Use spearman_correlation instead if the relationship may be monotonic but not linear, or if outliers shouldn't dominate the result. Use simple_linear_regression instead for the actual slope (units of y per unit of x), not just the strength of association.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | first variable, one value per observation | |
| y | Yes | second variable, same length and pairing order as x | |
| alpha | No | significance level for the test (and any confidence interval); default 0.05 |