Editverse Free Calculator
Correlation Calculator (Pearson & Spearman)
Measure how strongly two variables move together — with Pearson’s r or Spearman’s rho, the p-value, and a scatter plot. See the formula and the reproducible R command, and read a full interpretation guide below. Validated against R 4.3.3.
In Simple Words
A correlation measures whether two numbers tend to rise and fall together. You enter paired values for two variables (say, dose and response), and the calculator returns a correlation coefficient between −1 and +1: near +1 means they rise together, near −1 means one rises as the other falls, and near 0 means little linear relationship.
Use Pearson’s r for straight-line relationships between two continuous, roughly normal variables, and Spearman’s rho when the relationship is monotonic but not straight, or the data are ranked or skewed. One golden rule: correlation is not causation — a strong r tells you two things move together, not that one causes the other.
When to Use Correlation
Correlation quantifies the strength and direction of the association between two variables. Pearson’s correlation measures a linear relationship between two continuous variables; Spearman’s measures a monotonic relationship and works on ranked or non-normal data.
Use Pearson when both variables are continuous, the relationship looks roughly linear on a scatter plot, the data are approximately normal, and there are no extreme outliers (which can distort r badly). Use Spearman when the relationship is monotonic but curved, when variables are ordinal, or when outliers or skew make Pearson unreliable. Always plot the data first: very different patterns can share the same r. And remember that correlation alone cannot establish that one variable causes the other. To model how one variable predicts another, use regression. Not sure which measure fits? Our interactive Test Selector walks you through it.
Expected: 2 columns — Variable X | Variable Y
Drop a CSV here or click to choose. Parsed in your browser — nothing is uploaded.
Expected: 2 columns — Variable X | Variable Y
x <- c({x})
y <- c({y})
cor.test(x, y, method = "{method}")User guide
When to use. Measure the strength and direction of a linear (Pearson) or monotonic (Spearman) relationship between two variables.
Assumptions. Pearson: linearity, normality, no major outliers. Spearman: monotonic relationship only. The p-value uses the t approximation for both; for Spearman with small samples, R’s cor.test() reports an exact p-value instead (add exact = FALSE to match this calculator).
Common mistakes. Correlation does not imply causation. Inspect the scatter plot for non-linearity.
Worked example
Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.
References
- Pearson K. Note on regression and inheritance. Proc R Soc Lond. 1895;58:240-242.
- Spearman C. The proof and measurement of association. Am J Psychol. 1904;15:72-101.
Worked Examples
Example 1 — Dose vs response (positive)
Paired values X (2, 4, 6, 8, 10, 12) and Y (3, 5, 7, 6, 11, 13) climb together. Pearson’s r comes out high and positive with a small p-value, indicating a strong positive linear association. Report r and the p-value (cor.test() in R also gives the 95% confidence interval) — and show the scatter plot so readers can see the pattern.
Example 2 — When to switch to Spearman
If the scatter plot curves upward (a monotonic but non-linear pattern) or contains an extreme outlier, Pearson’s r can understate or distort the relationship. Re-running with Spearman’s rho, which works on ranks, gives a more faithful summary of the monotonic trend.
Assumptions to Check
Pearson — linearity. The relationship must be approximately straight-line. Always inspect the scatter plot; a near-zero r can hide a strong curved relationship.
Pearson — normality and outliers. Both variables should be roughly normal, and a single outlier can dominate r. Spearman is more robust to both.
Spearman — monotonicity. Spearman assumes only that the relationship is monotonic (consistently increasing or decreasing), making it suitable for ordinal or skewed data.
Common Mistakes
Reading causation into correlation
A strong correlation does not prove one variable causes the other — a third factor may drive both. State associations as associations.
Not plotting the data
Datasets with very different shapes can share an identical r. Always inspect the scatter plot before interpreting.
Using Pearson on skewed or ordinal data
For ranked, ordinal, or clearly non-normal data, Spearman’s rho is the appropriate choice.
Ignoring outliers
A single extreme point can inflate or mask a Pearson correlation. Check influence before trusting r.
Frequently Asked Questions
Pearson or Spearman — which should I use?
Use Pearson for linear relationships between continuous, roughly normal variables; use Spearman for monotonic, ranked, or skewed data, or when outliers are a concern.
How do I interpret the size of r?
As a rough guide, |r| around 0.1 is weak, 0.3 moderate, and 0.5 or above strong — but interpretation depends on the field, so report the value and its confidence interval rather than a label alone.
What is the difference between correlation and regression?
Correlation summarizes the strength of association with a single coefficient; regression models how one variable predicts another and gives an equation.
Does the result match SPSS, R, and Stata?
Yes. The calculator uses the same correlation formulas and significance tests as standard software and shows the exact R command so you can reproduce it.
Related Calculators
References
- Schober P, Boer C, Schwarte LA. Correlation coefficients: appropriate use and interpretation. Anesth Analg. 2018;126(5):1763–1768. PMID 29481436.
- Akoglu H. User’s guide to correlation coefficients. Turk J Emerg Med. 2018;18(3):91–93. PMID 30191186.
- Spearman C. The proof and measurement of association between two things. Am J Psychol. 1904;15(1):72–101.
Need This Analysis Done for Your Manuscript?
Our PhD biostatisticians run your correlation and regression, check the assumptions, and deliver publication-ready figures with reproducible R output.
Get Expert Statistical Help