ARBIMETRA LAB
Correlation Analysis
Measures linear and rank association between pairs of variables, with p-values, intervals, a matrix and a heatmap.
What it does
Measures linear and rank association between pairs of variables, with p-values, intervals, a matrix and a heatmap.
Use it to explore relationships. Choose Spearman or Kendall for ranks or when outliers and curvature are a concern.
Data you need
- Two or more numeric variables
Supported data: Numeric. Level: Beginner.
Formula and method
r = Σ(x−x̄)(y−ȳ) / √[Σ(x−x̄)² Σ(y−ȳ)²]
Pearson correlates the raw values. Spearman correlates their ranks. Kendall counts concordant and discordant pairs with a tie correction. Each pair of variables uses every row complete on both, and confidence intervals use the Fisher z transformation.
Assumptions
- Pearson: a linear relationship
- Observations are independent
Input checks
- Pairs use rows complete on both variables
- At least 4 pairs
- Constant variables are rejected
How to read the result
The sign gives direction and the size gives strength. Always look at the scatterplot.
Worked example
Illustrative run on Simulated study data (teaching data). These figures are the actual output of this model on that example, and they say nothing about your own data.
- The strongest pearson association is between pre_score and post_score: r = 0.6063, p = <0.0001, n = 240.
- That association is moderate and positive: statistically significant at the 5% level.
Limitations
- Correlation does not establish causation
- Pearson misses non-linear relationships
Numerical validation
Validated 17 of 17 automated checks passed, including numerical results, invalid input, missing values, small samples, constant variables, charts and the interpretation text.
| Check | Reference | Result | Abs. error | Tolerance | Source |
|---|---|---|---|---|---|
| Anscombe I Pearson r | 0.81642052 | 0.81642052 | 4.4e-16 | 1e-9 | Anscombe (1973); independent NumPy |
| Spearman equals Pearson on ranks | 0.81818182 | 0.81818182 | 0.0e+0 | 1e-11 | Independent NumPy calculation |
| Kendall by pair enumeration | 0.63636364 | 0.63636364 | 0.0e+0 | 1e-11 | Independent NumPy calculation |
| Pearson p-value from t | 0.00216963 | 0.00216963 | 1.6e-17 | 1e-7 | Independent NumPy calculation |
Computed with python 3.13.2, numpy 2.2.5, scipy 1.14.1, pandas 2.3.3, statsmodels 0.14.4, scikit-learn 1.7.0, in your browser. A passing check confirms the listed comparison only. It does not make any result suitable for your data, and it is not a claim of equivalence with other statistical software.
Questions
Pearson or Spearman?
Pearson measures linear association between numeric values. Spearman works on ranks, so it suits monotonic relationships and is less affected by outliers.
ARBIMETRA LAB is an educational and research tool. Results should be checked by the researcher and are not professional advice.
