Home › Tools and templates › Correlation and regression

Correlation and regression

SCQUALITYGUILD.COM/TOOLS/CORRELATION-REGRESSION.HTML

Paste pairs of x and y values for a scatter diagram, the correlation coefficient and its confidence interval, the fitted line, confidence and prediction intervals for y, and residual plots to check the model.

ON THE EXAM · CSSYB IV.F.1, IV.F.2, CQE VI.E.1, VI.E.2, CSSBB VI.A.1, VI.A.2, CQPA III.F.1 · FREE · NOTHING YOU TYPE LEAVES YOUR BROWSER

Q-BotClick for an explanation of this tool.

For educational use. This page is a study aid. The method behind it has far more depth and detail than one page and one tool can cover, and what you see here is not everything the method offers or everything this site offers. For full understanding and application, use the governing standards and texts, and seek further education, training or qualified advice. Results depend on the data you enter, so check them before relying on them.

Correlation: do they move together?

The correlation coefficient, r, measures how closely two variables follow a straight line. It runs from −1 (a perfect line sloping down) through 0 (no straight-line relationship) to +1 (a perfect line sloping up). It has no units, so it does not change if you measure in millimeters or inches.

Rough descriptions: above about 0.8 is strong, 0.5 to 0.8 moderate, 0.3 to 0.5 weak. These are conventions, not rules. The tool also tests whether r is statistically significant, because with few points a large r can appear by chance.

Regression: the line itself

Simple linear regression fits the straight line y = b₀ + b₁x that minimizes the squared vertical distances from the points. The slope b₁ says how much y changes, on average, for each unit of x. r² is the share of the variation in y that the line accounts for: r = 0.9 gives r² = 0.81, so 81% is explained and 19% is not.

Three cautions

How sure is r? The Fisher z interval

The sampling distribution of r is skewed, especially near ±1, so r ± a margin does not work. Fisher's transformation z = ½ ln((1 + r)/(1 − r)) is close to normal with standard error 1/√(n − 3). The tool builds the interval z ± zα/2/√(n − 3) and turns both ends back into r. If the interval for ρ includes 0, the data are consistent with no linear relationship. With 14 pairs, even r = 0.98 leaves an interval about 0.05 wide.

Confidence interval or prediction interval?

At a given x, the confidence interval is for the average y of all items at that x: ŷ ± t·s·√(1/n + (x − x̄)²/Sxx). The prediction interval is for one new item: ŷ ± t·s·√(1 + 1/n + (x − x̄)²/Sxx). The extra 1 under the root is the item's own scatter around the line, so the prediction interval is always wider and does not shrink to zero as n grows. Both are narrowest at x̄ and flare toward the ends, as the bands on the scatter diagram show. The tool also gives the interval and the t test for the slope, with t on n − 2 degrees of freedom.

Residual analysis

The intervals and tests assume a straight-line relationship with independent, normal errors of constant variance. The residuals (y − ŷ) check that. On residuals versus fitted values, a curve means the straight line is the wrong model and a funnel means the variance is not constant. On the normal probability plot, points near the line support the normal assumption. The table gives each point's standardized residual (beyond ±2 is worth a look, beyond ±3 is a likely outlier) and its leverage (how far its x is from the rest, so how hard it pulls the line).

On the exam

Correlation (IV.F.1) and regression (IV.F.2) are in the 2022 CSSYB Body of Knowledge: read r from a description, interpret r², and spot a causation claim the data cannot support. The CQE adds hypothesis tests and prediction with regression (VI.E.1) and the confidence interval for the correlation coefficient (VI.E.2). The CSSBB asks for the correlation coefficient and its confidence interval (VI.A.1), and for estimation, the uncertainty in the estimate and a residuals analysis to validate the model (VI.A.2). CQPA III.F.1 covers how regression and correlation models are used for estimation and prediction.

Other tools and templates

Your work is kept in this browser only, until you clear it. Use Save to a file to keep a copy or move it to another computer.