statcompute

Category

Regression and Correlation Calculators

These tools quantify how two or more variables move together: how strongly, in which direction, and how much of one is explained by the others.

Correlation measures, regression predicts

Correlation is a single number between −1 and 1 describing how tightly two variables move together. It is symmetric — the correlation of x with y is the correlation of y with x — and it has no units.

Regression is asymmetric and predictive. It fits a line that turns x into a prediction of y, and gives you a slope with an interpretation: a one-unit rise in x is associated with this much change in y. For a single predictor the two are tightly linked — R² is exactly the square of r — but only regression gives you an equation to use.

The three things people get wrong

Correlation is not causation, and regression is not either. A significant slope is compatible with x causing y, y causing x, and something else causing both. Only the design of the study can separate those, never the arithmetic.

r measures straight-line association only. A perfect parabola has a correlation near zero. Always look at the scatter plot before quoting a coefficient — Anscombe's quartet is four data sets with identical means, variances, correlations and regression lines that look nothing alike.

A high R² does not mean the model is right. It means the line accounts for a large share of the variance in this sample. A curved relationship can produce an impressive R² from a straight line, and the residual plot — which every regression here draws — is where that shows up.

Beyond one predictor

Multiple regression fits several predictors at once, and its coefficients mean something subtly different: the effect of each predictor holding the others fixed. When predictors are correlated with each other, that can differ sharply from the simple relationship — and standard errors inflate, so the coefficients wobble between similar samples.

Logistic regression handles a yes/no outcome, modelling the log-odds rather than the value, and reporting odds ratios rather than slopes.

01

The 7 calculators in this category

02

Questions people ask

What is a good R-squared?

Entirely field-dependent. In physics an R² of 0.99 is unremarkable; in social science 0.20 can be a real result. R² measures how much variance the model explains, not whether the model is right or useful, and it never falls when you add a predictor — which is why adjusted R² exists.

Should I use Pearson or Spearman correlation?

Pearson for linear relationships between numeric variables with no wild outliers. Spearman when the relationship is monotone but curved, when the data are ordinal, or when outliers are dominating. The correlation calculator reports both plus Kendall's tau, and a large gap between them is a signal worth chasing.

How many observations do I need for a regression?

For a single predictor, enough to see the pattern — a dozen is workable, thirty is comfortable. For multiple regression the common rules of thumb are 10 to 20 observations per predictor; below that the coefficients are unstable and the model tends to fit noise.