Pearson & Spearman Correlation

Quantify the strength and direction of the relationship between two variables — parametric or nonparametric.

Correlation analysis measures the strength and direction of the linear (Pearson) or monotonic (Spearman) relationship between two variables. The correlation coefficient r (or ρ for Spearman) ranges from −1 (perfect negative association) through 0 (no association) to +1 (perfect positive association). Correlation is descriptive — it tells you how strongly two variables move together — but it does not imply that changes in one variable cause changes in the other.

Pearson's r is appropriate when both variables are continuous and approximately normally distributed, and when you expect the relationship to be linear. Spearman's ρ is the nonparametric alternative, used when variables are ordinal, when normality is violated, or when the relationship may be monotonic but not strictly linear. Both methods are used across virtually every empirical discipline: psychology, economics, epidemiology, neuroscience, and marketing research all routinely report correlation coefficients.

StatRyx selects between Pearson and Spearman automatically based on your data types and normality checks. It reports the correlation coefficient, its 95% confidence interval, the p-value, and Cohen's r² (shared variance) as a practical effect size. Scatter plots with a fitted regression line are generated automatically to help you assess the nature of the relationship visually.

When to use the Pearson & Spearman Correlation

When not to use it

Worked example

Variable Pairr95% CIpr²n
Study hours & Exam score.67[.55, .77]< .001.45100
Anxiety & GPA−.43[−.58, −.26]< .001.18100
Sleep hours & Exam score.29[.10, .46].004.08100

How to report it (APA 7)

There was a strong, positive correlation between weekly study hours and final exam score, r(98) = .67, p < .001, 95% CI [.55, .77]. Study hours accounted for approximately 45% of the variance in exam scores (r² = .45).

Frequently asked questions

Is correlation analysis free on StatRyx?

Yes. You can run it without an account (3 free analyses), and a free account adds 10 more — a one-time allowance, no payment needed. Every result includes the APA 7 write-up. Paid plans (Student from $9/month) add more analyses and Word, PDF and Excel export.

Do I need to code to run a correlation?

No coding needed. Just name the two variables you want to examine in plain language and StatRyx selects the appropriate correlation method and runs the full analysis.

What sample size do I need for a reliable correlation?

To detect a medium correlation (r = .30) with 80% power at α = .05, you need approximately 84 participants. Small samples produce very wide confidence intervals, making the estimate imprecise. StatRyx reports the 95% CI so you can judge the precision of your estimate.

What is the difference between Pearson and Spearman correlation?

Pearson's r measures linear correlation between two continuous, normally distributed variables. Spearman's ρ measures monotonic correlation (whether rank order is preserved) and is appropriate for ordinal data or non-normal continuous data. StatRyx selects the right one based on your data and can compute both for comparison.

Does a significant correlation mean one variable causes the other?

No. Correlation measures association, not causation. Two variables can be strongly correlated because of a third confounding variable, a common cause, or even coincidence. Establishing causation requires experimental manipulation with random assignment or careful quasi-experimental designs.

Run a Pearson & Spearman Correlation on your data →

Related analyses