1001Ferramentas
šŸ“ŠCalculators

Pearson Correlation Coefficient

Compute Pearson correlation coefficient r between X and Y lists.

r = —

Pearson correlation coefficient (r)

Pearson's r tells you how strong a linear relationship between two variables is, and which way it points: r = Ī£((xįµ¢āˆ’xĢ„)(yįµ¢āˆ’Č³)) / √(Ī£(xįµ¢āˆ’xĢ„)²·Σ(yįµ¢āˆ’Č³)²). It always falls in [āˆ’1, 1]. A value of +1 is a perfect positive linear correlation, āˆ’1 a perfect negative one, and 0 says there's no linear relationship at all. As a rough guide, |r| < 0.3 is weak, 0.3–0.7 moderate, anything above 0.7 strong. Square it and r² gives you the share of variance in Y that X accounts for. One warning worth repeating: correlation does not imply causation. Ice cream sales and drownings move together only because both climb when it gets hot. And there's Anscombe's quartet (1973), four datasets that all share r ā‰ˆ 0.82 yet look nothing alike when plotted. Plot your data before you trust the number.

Applications

You'll see it in regression analysis, in finance for measuring how assets move together when diversifying a portfolio, in medicine when hunting for confounding variables, in social research, and in feature selection for machine learning. When the data has outliers or the relationship is monotonic but not straight, reach for Spearman's rank correlation instead, the non-parametric cousin that handles both gracefully.

FAQ

r = 0 means independent variables? Not quite. It only rules out a linear relationship. A perfect parabola y = x² can land at r ā‰ˆ 0 even though X and Y are tied together exactly.

How many points do I need? Three is enough to compute r mechanically, but for inference that means anything you usually want n ≄ 30. With just a handful of points, r jumps around wildly.

Pearson or Spearman? Go with Pearson when the data is continuous, roughly normal, and the link looks linear. Switch to Spearman for ordinal data, monotonic relations that bend, or whenever outliers are in play.

Related Tools

The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.