Enter Paired Values
Provide X and Y datasets with matching lengths. Separate values using commas, spaces, new lines, or semicolons.
Example Data Table
This sample shows a positive relationship. Use these values with the example button for a quick test.
| Observation | X Value | Y Value | Context |
|---|---|---|---|
| 1 | 12 | 22 | Low paired starting point |
| 2 | 15 | 25 | Early positive movement |
| 3 | 18 | 29 | Steady growth continues |
| 4 | 20 | 31 | Moderate increase visible |
| 5 | 24 | 36 | Relationship remains positive |
| 6 | 28 | 40 | Upper range confirms trend |
Formula Used
Pearson correlation
r = cov(X,Y) / (σX × σY)
Pearson measures linear association. It ranges from -1 to +1 and shows both direction and strength of the linear relationship.
Spearman correlation
ρ = Pearson correlation of ranked X and ranked Y
Spearman measures monotonic association. It is useful when data contain ranks, outliers, or curved but ordered patterns.
Covariance
cov(X,Y) = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / (n-1 or n)
Covariance shows whether two variables move together. Positive values move together, while negative values move in opposite directions.
Simple linear regression
ŷ = a + bx
The slope is b = Σ[(xᵢ-x̄)(yᵢ-ȳ)] / Σ[(xᵢ-x̄)²]. The intercept is a = ȳ - bx̄.
How to Use This Calculator
- Enter the first variable in the X values box.
- Enter the paired second variable in the Y values box.
- Keep both lists the same length and in matching order.
- Select Pearson, Spearman, or both methods.
- Choose sample or population covariance.
- Set alpha level and confidence level if needed.
- Press Calculate Correlation to view results above the form.
- Download a CSV report or create a PDF copy from the export buttons.
Frequently Asked Questions
1) What does a positive correlation mean?
A positive correlation means both variables tend to increase together. When one variable rises, the other often rises too. Larger positive values indicate a stronger association.
2) What is the difference between Pearson and Spearman correlation?
Pearson measures linear association using original values. Spearman measures monotonic association using ranks. Spearman is often more robust when data contain outliers or nonlinear ordered trends.
3) When should I use Spearman instead of Pearson?
Use Spearman when your variables are ordinal, heavily skewed, contain strong outliers, or follow a monotonic curve rather than a clean straight-line relationship.
4) Why is my correlation undefined?
Correlation becomes undefined when one variable has no variation. If all X values or all Y values are identical, the standard deviation is zero and the coefficient cannot be computed.
5) What does the p-value tell me?
The p-value estimates whether the observed association could happen by chance under a no-correlation assumption. Smaller values suggest stronger statistical evidence for a real relationship.
6) What is R-squared in this calculator?
R-squared is the square of Pearson’s coefficient in simple linear analysis. It shows the proportion of variation in Y explained by X through a linear relationship.
7) Does correlation prove causation?
No. Correlation only describes association. A high value does not prove that one variable causes the other, because confounding or coincidence may explain the pattern.
8) What separators can I use for the input values?
You can separate numbers with commas, spaces, semicolons, or new lines. Just make sure each X value has one matching Y value in the same position.