standarddeviationcalculator.net

Updated

Correlation and regression calculators

Calculators for paired data: how strongly two variables move together, and the line or curve that predicts one from the other. Use them for lab results, survey scores, sales against spend, or any homework question that hands you an x column and a y column.

Which calculator do I need?

You have or wantUse
Two numeric columns and you want one number for how linear the relationship isPearson correlation coefficient
Ranked data, ordinal scales, or a relationship that rises steadily but not in a straight lineSpearman's rank correlation
A small sample with many tied ranks, or you want the share of pairs that agree in orderKendall's tau
An equation to predict y from x, with slope, intercept and their significanceLinear regression
Two to four predictors for one outcomeMultiple regression
A yes/no outcome and you want the probability of “yes” at each xLogistic regression
Points that curve, bend or grow by a percentage each stepPolynomial regression
A picture of the data first, to see which kind of fit makes senseScatter plot maker

Measure the relationship

One number for how closely two variables move together, from raw pairs or ranks.

Fit a line

Least-squares models that predict an outcome from one or more predictors.

Fit a curve

When the scatter plot bends, fit a polynomial or exponential model instead of a straight line.

Check the fit

How much of the variation the model explains and how far its predictions miss.

Correlation or regression?

Correlation answers “how closely do these two move together?” with a single unitless number between −1 and 1. It treats x and y the same way: swap the columns and r does not change. Regression answers “what y should I expect at this x?” and gives an equation in the units of your data. Swap the columns and you get a different line. If you only need to report the strength of a relationship, use a correlation coefficient; if you need predictions, use linear regression. For a straight-line fit the two meet at R² = r².

Which correlation coefficient?

Pearson's r measures straight-line association and is pulled around by extreme values. Spearman's rho is Pearson's r computed on ranks, so it measures any relationship that only ever goes up (or only ever goes down). Kendall's tau counts concordant and discordant pairs; its values run smaller than Spearman's on the same data, and it copes better with small samples and ties. Here is what one outlier does to each, for x = 1, 2, 3, 4, 5:

y valuesPearson rSpearman rhoKendall tau
1, 2, 3, 4, 51.0001.0001.000
1, 2, 3, 4, 500.7431.0001.000

The order of the points has not changed, so both rank measures stay at 1. Pearson drops to 0.743 because the last point sits far above the straight line through the others; the least-squares line becomes y = 10x − 18 with R² = 0.552. A scatter plot shows this at a glance, which is why it is worth drawing one before you pick a method.

Common mix-ups

  • Covariance is not correlation. Covariance keeps the units of x times y, so its size depends on the scale. Divide by both standard deviations to get r.
  • A high R² does not mean the model is right. A straight line through curved data can still score well. Look at the residuals: a pattern in them means a curve fits better.
  • Adding polynomial terms always raises R². Compare adjusted R² instead, which the polynomial regression calculator tabulates for each degree.
  • The Matthews coefficient is for classifiers. MCC is a correlation between predicted and actual yes/no labels from a confusion matrix, not between two measured variables.

Guides to read alongside

Common questions

What counts as a strong correlation?

A common rule of thumb reads |r| below 0.3 as weak, 0.3 to 0.7 as moderate and above 0.7 as strong, but the right threshold depends on the field. In physics r = 0.9 can be poor; in psychology r = 0.3 is often worth reporting. Always check the p-value or confidence interval as well, since a large r from five points can still be chance.

Does correlation prove that x causes y?

No. A correlation says two variables move together, not why. A third variable can drive both, or the causation can run the other way. Only a controlled experiment, or a careful design that rules out the alternatives, supports a causal claim.

When should I use logistic rather than linear regression?

Use logistic regression when the outcome is binary: passed or failed, bought or did not buy. A straight line fitted to 0/1 data predicts values below 0 and above 1, while the logistic curve keeps every prediction between 0 and 1 and gives odds ratios for each predictor.