UseCalcPro
Home
MathFinanceHealthConstructionAutoPetsGardenCraftsFood & BrewingTools
Blog
  1. Home
  2. Math

Correlation Calculator

Compute Pearson r, R-squared, slope, intercept, and regression equations

Pearson r

0.7746

R²

0.6000

n

5

5 values entered

5 values entered

Correlation Results

Pearson r

0.7746

R² (Coefficient of Determination)

0.6000

There is a strong positive linear relationship (r = 0.7746). 60.0% of the variance in Y is explained by X.

Linear Regression

y = 0.6000x + 2.2000

Slope (m)

0.6000

Intercept (b)

2.2000

Summary Statistics

Data Points (n)5
X Mean (x̅)3.0000
Y Mean (y̅)4.0000

Interpretation Guide

0.9 – 1.0Very strong positive
0.7 – 0.9Strong positive
0.5 – 0.7Moderate positive
0.3 – 0.5Weak positive
0.0 – 0.3Negligible

Same ranges apply for negative values

Formulas Used

Pearson Correlation Coefficient

r = Σ((xᵢ - x̅)(yᵢ - y̅)) / √(Σ(xᵢ - x̅)² × Σ(yᵢ - y̅)²)

Measures the strength and direction of the linear relationship between paired data. Values close to ±1 indicate a strong linear relationship.

Where:

xᵢ, yᵢ= Individual data points in the paired data set
x̅, y̅= The means of the X and Y data sets
Σ= Sum over all paired data points

Coefficient of Determination

R² = r²

The proportion of variance in Y explained by X. Calculated by squaring the Pearson correlation coefficient.

Where:

r= Pearson correlation coefficient
R²= Proportion of explained variance (0 to 1)

Linear Regression

y = mx + b, where m = Σ((xᵢ-x̅)(yᵢ-y̅)) / Σ((xᵢ-x̅)²), b = y̅ - mx̅

The least-squares regression line that minimizes the sum of squared residuals between predicted and actual Y values.

Where:

m= Slope (change in Y per unit change in X)
b= Y-intercept (predicted Y when X = 0)
x̅, y̅= Means of the X and Y data sets

Example Calculations

1Strong Positive Correlation

Inputs

X Values1, 2, 3, 4, 5
Y Values2, 4, 5, 4, 5

Result

Pearson r0.7746
R²0.6000
Regressiony = 0.6000x + 2.2000

With r = 0.77, there is a strong positive linear relationship. R² = 0.60 means 60% of the variance in Y is explained by X. The regression line predicts Y increases by 0.6 for each unit increase in X.

2Perfect Negative Correlation

Inputs

X Values1, 2, 3, 4, 5
Y Values10, 8, 6, 4, 2

Result

Pearson r-1.0000
R²1.0000
Regressiony = -2.0000x + 12.0000

A perfect negative correlation (r = -1) means the data points fall exactly on a straight line with negative slope. Y decreases by exactly 2 for every unit increase in X.

3Weak Correlation

Inputs

X Values10, 20, 30, 40, 50
Y Values25, 22, 28, 24, 27

Result

Pearson r0.3974
R²0.1579
Regressiony = 0.0600x + 23.4000

With r = 0.40 and R² = 0.16, the linear relationship is weak. Only 15.8% of the variation in Y is explained by X, suggesting other factors dominate.

Frequently Asked Questions

Q

What is the Pearson correlation coefficient (r)?

The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two variables. It ranges from -1 to +1, where -1 indicates a perfect negative linear relationship, 0 indicates no linear relationship, and +1 indicates a perfect positive linear relationship.

  • r = +1.0: perfect positive correlation (as X increases, Y increases proportionally)
  • r = 0.0: no linear correlation (X and Y are not linearly related)
  • r = -1.0: perfect negative correlation (as X increases, Y decreases proportionally)
  • r only measures linear relationships, not curved or nonlinear patterns
  • r is dimensionless — it works the same regardless of units
|r| RangeStrengthExample
0.9 – 1.0Very strongHeight vs. arm span
0.7 – 0.9StrongStudy hours vs. grades
0.5 – 0.7ModerateIncome vs. happiness
0.3 – 0.5WeakAge vs. music preference
0.0 – 0.3NegligibleShoe size vs. IQ
Q

What does R-squared (R²) tell you?

R-squared (the coefficient of determination) is the square of the correlation coefficient. It represents the proportion of variance in the dependent variable (Y) that is explained by the independent variable (X). An R² of 0.81 means 81% of the variation in Y can be explained by X.

  • R² ranges from 0 to 1 (0% to 100% of variance explained)
  • R² = 0.81 means 81% of Y variance is explained by X
  • The remaining (1 - R²) is unexplained variance
  • R² always equals r², so r = 0.9 gives R² = 0.81
  • Higher R² means better predictive power of the regression
Pearson rR²% Variance Explained
±0.30.099%
±0.50.2525%
±0.70.4949%
±0.90.8181%
±1.01.00100%
Q

How is the Pearson correlation coefficient calculated?

The formula is r = Σ((xi - x̅)(yi - y̅)) / √(Σ(xi - x̅)² × Σ(yi - y̅)²). You subtract each value from its mean, multiply the paired deviations, sum them, and divide by the square root of the product of the squared deviation sums.

  • Step 1: Calculate the means x̅ and y̅
  • Step 2: Compute deviations: (xi - x̅) and (yi - y̅) for each pair
  • Step 3: Multiply paired deviations and sum: Σ(xi - x̅)(yi - y̅)
  • Step 4: Sum squared deviations: Σ(xi - x̅)² and Σ(yi - y̅)²
  • Step 5: Divide: r = Step3 / √(Step4x × Step4y)
ComponentFormulaPurpose
NumeratorΣ(xi-x̅)(yi-y̅)Covariance direction
Denominator√(Σ(xi-x̅)²×Σ(yi-y̅)²)Normalizes to [-1,1]
ResultNumerator / DenominatorCorrelation strength
Q

What is linear regression and how does it relate to correlation?

Linear regression finds the best-fit line y = mx + b through the data points. The slope m indicates how much Y changes per unit change in X, and the intercept b is where the line crosses the Y-axis. The correlation coefficient r measures how closely the data follows this line.

  • Slope: m = Σ((xi-x̅)(yi-y̅)) / Σ((xi-x̅)²)
  • Intercept: b = y̅ - m×x̅
  • The regression line always passes through the point (x̅, y̅)
  • R² tells you how well the line fits the data
  • Slope sign always matches the sign of r
ConceptWhat It MeasuresRange
r (correlation)Strength of linear relationship-1 to +1
R² (determination)Variance explained0 to 1
m (slope)Rate of change in Y per XAny real number
b (intercept)Y-value when X = 0Any real number
Q

Does correlation prove causation?

No, correlation does not imply causation. A strong correlation between two variables means they move together, but it does not prove one causes the other. The relationship could be coincidental, reversed, or driven by a hidden third variable (confounding factor).

  • Ice cream sales and drownings correlate — both increase in summer (confound: heat)
  • Spurious correlations exist between many unrelated variables
  • Proving causation requires controlled experiments or strong theoretical frameworks
  • Correlation is necessary but not sufficient for causation
  • Always consider alternative explanations before claiming a causal link
ScenarioCorrelation?Causation?
Smoking & lung cancerYes (r ≈ 0.7)Yes (proven via studies)
Ice cream & drowningsYes (r ≈ 0.5)No (confound: temperature)
Height & shoe sizeYes (r ≈ 0.8)Common cause: genetics

Understanding Correlation and Linear Regression

Correlation analysis is a fundamental statistical technique used to measure the strength and direction of the linear relationship between two variables. The Pearson correlation coefficient (r) quantifies this relationship on a scale from -1 to +1, making it easy to interpret and compare across different datasets.

While correlation tells you how strongly two variables are related, linear regression takes it a step further by finding the equation of the best-fit line. The regression equation y = mx + b allows you to predict Y values for given X values, with R-squared telling you how reliable those predictions are.

Our correlation calculator computes the Pearson r, R-squared, regression equation (slope and intercept), and provides a complete step-by-step calculation table. Enter your X and Y data sets separated by commas to instantly analyze the relationship between your variables.

Related Calculators

Statistics Calculator

Find mean, median, mode, range, and standard deviation

Z-Score Calculator

Calculate z-scores, percentiles, and normal distribution probabilities

Confidence Interval

Compute confidence intervals for means and proportions

Probability Calculator

Calculate event probabilities and combinations

Standard Deviation Calculator

Calculate population and sample standard deviation, variance, mean, and coefficient of variation. Shows step-by-step deviations table for any data set.

Combination Calculator \u2014 nCr with Steps

Calculate combinations (nCr) with step-by-step solutions. Find selections with or without repetition, compare with permutations and Pascal's triangle.

Related Resources

Statistics Calculator

Calculate mean, median, mode, and standard deviation

Z-Score Calculator

Find z-scores and percentiles

Probability Calculator

Calculate event probabilities

Percentage Change Calculator

Calculate percentage increase or decrease

Last Updated: Mar 9, 2026

This calculator is provided for informational and educational purposes only. Results are estimates and should not be considered professional financial, medical, legal, or other advice. Always consult a qualified professional before making important decisions. UseCalcPro is not responsible for any actions taken based on calculator results.

UseCalcPro
FinanceHealthMath

© 2026 UseCalcPro