Measure the strength and direction of a linear relationship.
Definition
Correlation analysis quantifies the relationship between two continuous variables. Pearson's correlation measures a linear relationship, while Spearman's is suitable for ordinal or non-normal data.
When to use it
Explore the relationship between two continuous variables
Test whether one variable increases with another
Non-normal or ordinal data: use Spearman
Requirements
Two continuous (Pearson) or ordinal (Spearman) variables
Monotonic relationship (not necessarily linear for Spearman)
No extreme outliers for Pearson
What StatsLab computes
Coefficient r (Pearson) or ρ (Spearman)
95% CI via Fisher transformation
p-value
Scatter plot with regression line
Correlation matrix (multi-variable)
Worked example
Context : Relationship between hours of sleep and attention score in 60 students.
Result : r = 0.54, 95% CI [0.33; 0.70], p < 0.001
Interpretation : Moderate to strong positive correlation. The more students sleep, the better their attention score. The relationship is statistically significant.