Frequently Asked Questions
Can I enter my raw data points here?
Not on this version of the page. Despite the summary mentioning paired coordinates, the inputs are only the two means, two standard deviations, the correlation and a target X. Compute those from your data first. A spreadsheet's AVERAGE, STDEV and CORREL functions will give all five numbers in a few seconds, then enter them here.
Should I use sample or population standard deviations?
Either, provided both standard deviations use the same one. The slope depends on the ratio s_y ÷ s_x, and the n or n − 1 divisor cancels out of that ratio. The intercept and prediction then follow. What you should avoid is mixing a sample SD for one variable with a population SD for the other.
Why is R² shown as a percentage?
Because the engine multiplies r squared by 100. With the default r of 0.85, R² is 0.7225, shown as 72.25 %. Many textbooks and software packages print it as a decimal instead, so 0.7225 and 72.25 % are the same value. Convert before comparing with a published R².
What happens if I enter a correlation greater than 1?
The engine refuses it and asks you to check the inputs. A Pearson correlation can never exceed 1 in magnitude, because it is a covariance scaled by both standard deviations. A value like 1.4 therefore means a typing or calculation error upstream. Recheck the source figure, or recompute r from the raw data, before running the regression.
Why does a negative correlation still give a positive R²?
R² is r squared, so the sign disappears. At r = −0.85 the line slopes downward, with slope −2.125 and intercept 46.25, but R² is the same 72.25 % as at +0.85. R² describes how tightly the points sit around the line, not which way it tilts. The slope's sign tells you the direction.
How do I get the regression line for predicting X from Y?
Swap the roles in the inputs. Enter the mean and standard deviation of Y in the X fields, those of X in the Y fields, keep the same r, and use your known Y as the target. For the defaults that gives a slope of 0.34. Do not just rearrange the original equation, because that minimises the wrong errors.
Is the predicted value a guarantee for one observation?
No. Ŷ is the expected average of Y among cases with that X. Individual values scatter around it, and with R² at 72.25 % more than a quarter of the variation is unexplained. To put a range around one prediction you need the sample size and residual spread, which this calculator does not ask for.
Why is the slope unchanged when I change the means?
The slope depends only on r and the two standard deviations. Changing x̄ or ȳ slides the line up, down or sideways without tilting it. That is why all three presets share the slope 2.125 while the intercepts are 12.25, 3.75 and −6.875. The prediction at a fixed X moves with the intercept.
Does a strong correlation prove that X causes Y?
No. A correlation of 0.85 only says the two variables move together in this data. Both could be driven by a third factor, the causation could run from Y to X, or the pattern could be a coincidence in a small sample. The regression line is a description and a prediction tool, not evidence of cause.
What does the line look like if X has no spread?
There is no regression line, because every X is the same and no slope can be estimated. The engine returns an input error for a standard deviation of X at zero. If your data genuinely has one X value, a regression is the wrong tool; the best prediction of Y is simply its mean.
Can I use Spearman's rank correlation instead of Pearson's r?
Not meaningfully. The formula m = r × s_y ÷ s_x holds only for Pearson's r, because it is built from the covariance of the actual values. A rank correlation measures a different thing, monotonic order, and plugging it in gives a line that is not the least squares fit. If you only have Spearman's coefficient, you need the raw data to fit an ordinary regression.
From five summary numbers to the line y = 2.125x + 3.75
This calculator does not take a list of data points. It takes the five numbers that summarise a paired data set: the mean of X, the mean of Y, the standard deviation of each, and the Pearson correlation r between them. From those it builds the least squares regression line and predicts Y at a sixth input, the target X.
With the defaults, x̄ = 10, ȳ = 25, s_x = 4, s_y = 10 and r = 0.85. The slope comes out at 2.125, the intercept at 3.75, and R² at 72.25 %. At X = 14 the predicted value is 33.5.
That is exactly the information printed in a typical statistics output table or a published paper's descriptive statistics. If you only have the summary and not the raw data, this is the tool. If you have the raw pairs, you first need to compute the means, standard deviations and r, either by hand or with the statistics calculator, and then enter them here.
The page summary mentions fitting from paired coordinates as an option, but the current form has no field for them. Only summary statistics can be entered.
Why m = r × s_y ÷ s_x gives the least squares slope
The textbook least squares slope is b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)². It is the slope that makes the sum of squared vertical errors as small as possible. The calculator uses a different looking formula, m = r × (s_y ÷ s_x), and the two are the same thing.
Pearson's r is the covariance divided by s_x × s_y. The covariance is Σ(x − x̄)(y − ȳ) ÷ (n − 1), and s_x squared is Σ(x − x̄)² ÷ (n − 1). Multiply r by s_y ÷ s_x and the s_y cancels, leaving the covariance divided by s_x squared. The n − 1 terms cancel too, which gives back the textbook formula.
One practical consequence: it does not matter whether your standard deviations used n or n − 1, as long as both used the same one. The ratio s_y ÷ s_x is unchanged either way. Mixing a sample SD for X with a population SD for Y would introduce a small error, larger for small samples.
The intercept follows from the fact that the least squares line always passes through the point of means. So b = ȳ − m × x̄. For the defaults that is 25 − 2.125 × 10, which is 3.75.
A five point check you can do by hand
To make sure the shortcut matches the long way, take five pairs: X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5. The mean of X is 3 and the mean of Y is 4.
The deviations of X are −2, −1, 0, 1 and 2. The deviations of Y are −2, 0, 1, 0 and 1. Multiplying pairwise and adding gives 4 + 0 + 0 + 0 + 2, which is 6. The squared X deviations add to 10. So the textbook slope is 6 ÷ 10, or 0.6, and the intercept is 4 − 0.6 × 3, which is 2.2.
Now the summary route. The squared Y deviations add to 6. Using n − 1 = 4, s_x is the square root of 2.5, about 1.5811, and s_y is the square root of 1.5, about 1.2247. Pearson's r is 6 divided by the square root of 10 × 6, about 0.7746, and R² is 0.6.
I entered x̄ = 3, ȳ = 4, s_x = 1.5811, s_y = 1.2247 and r = 0.7746 into the calculator with a target X of 6. It returned a slope of 0.6, an intercept of 2.2 and a prediction of 5.8. R² showed as 60.001 %, the extra thousandth coming only from rounding r to four decimals. The two routes agree.
What R² of 72.25 % does and does not say
R² is simply r squared. With r = 0.85, R² is 0.7225, which the page shows as 72.25 %. It is the share of the variance in Y that the straight line accounts for. The remaining 27.75 % is scatter around the line.
A high R² does not mean the line is the right model. Data that curve can still produce a fairly high R² with a straight line while the predictions are systematically wrong at both ends. Plotting the raw data is the only reliable check, and this calculator cannot do that from summaries.
It helps to translate R² back into standard deviations. The scatter left around the line has a standard deviation of s_y × √(1 − R²). For the defaults that is 10 × √0.2775, about 5.27. So although the line explains most of the variance, a typical point still sits roughly five units above or below it, against a total spread in Y of 10.
R² also falls fast as r drops. At r = 0.3, R² is just 9 %, the slope is 0.75 and the prediction at X = 14 is 28. A correlation that sounds moderate explains very little of the variation. And at r = 0 the slope is 0, the line is flat at ȳ, and every prediction is 25 whatever X you choose.
Correlation is not causation, and the calculator has no way to know which variable drives which. It fits Y from X because that is the direction you asked for.
How the presets move the line
Both alternative presets change only the mean of X, keeping everything else at the default. The slope stays at 2.125 in all three, because slope depends only on r, s_x and s_y. What moves is the intercept, and so the prediction at X = 14.
With x̄ = 6, the intercept rises to 12.25 and the predicted value is 42. With x̄ = 15, the intercept becomes −6.875 and the prediction falls to 22.875. The interpretation line prints that last case as y = 2.125x − 6.875, with the minus sign carried into the equation.
The pattern is easiest to see as distance from the mean. The prediction always equals ȳ plus the slope times how far the target X sits from x̄. At the default, 14 is 4 above the mean of 10, so Ŷ is 25 + 2.125 × 4, which is 33.5. Move x̄ to 15 and the target is now 1 below the mean, so Ŷ is 25 − 2.125, which is 22.875.
Setting the target X equal to x̄ always gives back ȳ. I tried X = 10 with the defaults and got exactly 25.
Spread, sign and the input checks
The standard deviations set how steep the line is for a given r. Doubling s_x from 4 to 8 halves the slope to about 1.063 and moves the intercept to 14.375, so Ŷ at 14 drops to 29.25. A wider spread in X means each unit of X carries less information about Y.
The sign of r sets the direction. At r = −0.85 the slope is −2.125, the intercept is 46.25 and the prediction at 14 is 16.5. R² is still 72.25 %, because squaring removes the sign.
The engine rejects impossible inputs rather than guessing. A correlation outside −1 to +1, such as 1.4, returns a Check inputs message. So does a standard deviation of X at or below zero, or a negative standard deviation of Y. The message names all three rules at once, so read it in full to see which value is the problem.
If you hit that message, the data summary itself is usually wrong. A correlation of 1.4 or a zero spread in X means a typing slip or a mistake upstream, and no regression can be fitted until it is fixed.
Predicting Y, not X, and staying in range
This is the regression of Y on X. It minimises vertical errors and should be used to predict Y from a known X. Rearranging the equation to predict X from Y gives the wrong answer. The regression of X on Y has slope r × s_x ÷ s_y, which for the defaults is 0.85 × 0.4, or 0.34. Inverting the Y on X slope of 2.125 would instead give about 0.47. The two lines only coincide when r is exactly 1 or −1.
Predictions are most trustworthy near the middle of the data. The default target, 14, is one standard deviation above the mean of X, which is comfortably inside a typical data range. A target of 40 would be more than seven standard deviations out, and the line's straightness that far away is pure assumption.
The predicted value is also an average. For an individual case at X = 14 the actual Y will scatter around 33.5, and with R² at 72.25 % that scatter is still substantial. Summary statistics alone do not give the prediction interval you would need to say how wide that scatter is.