Correlation & Regression Calculator

statistical-calculators.site

How to Use This Calculator

  1. Set axis labels (optional): Enter a name for your X variable and Y variable in the fields at the top, so the chart and results display with meaningful names.
  2. Enter your data: In the text box, type or paste one X,Y pair per line, separated by a space, comma, or tab. At least 3 valid pairs are required.
  3. Click "Calculate & Plot": The calculator computes Pearson's correlation coefficient, the regression equation, and a significance test, and displays a scatter plot with a trendline.
  4. Read the results: Check the r value, R-squared, and p-value to assess the strength and statistical significance of the relationship.
  5. Export or share: Copy the results, export them as a TXT or PDF file, or contact a tutor for help interpreting them.
Pearson correlation calculator infographic showing the formula, a scatter plot example, interpretation guidelines including significance, linearity, and correlation vs. causation and export options
A visual summary of how Pearson's correlation coefficient (r) is calculated and interpreted, including the formula, an example scatter plot, and key assumptions.

The infographic above summarizes the full workflow this calculator performs: entering paired X and Y values, computing Pearson's r using the standard formula, and interpreting the result alongside its statistical significance. A strong positive correlation, as shown in the example (r = 0.98), indicates that as X increases, Y tends to increase as well — but as the infographic notes, correlation alone does not imply causation, and the result should always be considered alongside linearity, normality, and the presence of outliers.

Background: Pearson Correlation and Linear Regression

What Is Pearson's Correlation Coefficient (r)?

Pearson's correlation coefficient measures the strength and direction of the linear relationship between two continuous variables. The value ranges from -1 to 1: values close to 1 indicate a strong positive relationship (as X increases, Y increases), values close to -1 indicate a strong negative relationship, and values near 0 indicate little to no linear relationship.

Formula: r = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / √[Σ(xᵢ - x̄)² · Σ(yᵢ - ȳ)²]

Linear Regression: Y = a + bX

Linear regression describes the relationship between the variables with a straight line. b (the slope) represents how much Y changes on average for each one-unit increase in X, and a (the intercept) is the estimated value of Y when X equals zero.

R-squared and Adjusted R-squared

R-squared (r²) expresses the percentage of variance in Y explained by X. Adjusted R² corrects this value for the number of predictors and observations, and is most useful in multiple regression.

Significance Test (t-test) and p-value

The t-test checks whether the observed correlation differs from 0 in a way unlikely to be due to chance. A p-value below 0.05 is generally used as the threshold for statistical significance.

Full Worked Example

Using the built-in sample data: X = 1,2,3,4,5,6,7,8 and Y = 2,3,5,6,8,9,11,12 (n=8).

Interpretation: There is a very strong positive linear relationship between X and Y. For each one-unit increase in X, Y increases by 1.476 units on average. About 99.5% of the variance in Y is explained by X, and the result is significant at a high confidence level.

How to Do This in R Studio

x <- c(1,2,3,4,5,6,7,8)
y <- c(2,3,5,6,8,9,11,12)

# Pearson correlation and significance test
cor.test(x, y, method = "pearson")

# Linear regression
model <- lm(y ~ x)
summary(model)

How to Do This in SPSS

For correlation: Analyze → Correlate → Bivariate. Move both variables into the Variables box, check Pearson and Two-tailed, then click OK.
For regression: Analyze → Regression → Linear. Enter Y as the Dependent variable and X as the Independent variable, check Estimates and Model fit under Statistics, then click OK.

How to Do This in JASP

For correlation: Regression → Correlation Matrix, drag both variables into the box, and check Pearson's r.
For regression: Regression → Linear Regression, enter Y as the Dependent Variable and X as a Covariate, and check R² and Estimates to display the slope and intercept.

Related Statistical Calculators