Check · Test yourselfPractice tests

Academy › Topic library › Correlation and Regression

Q-BOT ACADEMY · FREE VIDEO LESSON · 10 MIN

Correlation and Regression

Correlation tells you how strongly two things move together in a straight line. Regression goes one step further: it gives you the equation of that line, so you can predict one thing from the other. We call the thing you set or change the input, or X. That's the independent variable. The thing that responds is the output, or Y, the dependent variable. At Brindlewood, X is the distance from the spray gun, and Y is the coating thickness.

9:38 · Q-Bot · narrated, with worked example and a check-yourself question

In short

Start with a scatter diagram: X across, Y up. R runs from minus one to plus one: the sign is direction, and the size is strength. Correlation is not causation, so watch for lurking variables. The least squares line, Y equals B zero plus B one X, gives the slope and the intercept. R squared is the share of variation explained. And predict only inside your data.

Check yourself

Brindlewood's line is: thickness equals five point five, minus zero point two five times the gun distance in inches. What thickness does it predict at nine inches? A, two point two five mils. B, three point two five mils. C, three point five mils. Or D, five point two five mils.

Show the answer

The answer is B, three point two five mils. Zero point two five times nine is two point two five, and five point five minus two point two five is three point two five. A forgot to subtract from five point five. C is the prediction at eight inches, not nine. And D subtracted only one quarter of a mil, as if the distance were one inch!

Where this topic is taught

This lesson is part of every free Academy course whose Body of Knowledge covers it. Each course puts it in context, with exercises and checks.

Full lesson transcript

The narration from the video, by chapter. Brindlewood Outdoor Furniture and its people are a fictional company used in every Q-Bot Academy lesson.

Intro

It's Monday morning at Brindlewood Outdoor Furniture, and Rosa, the plant manager, has a question on her whiteboard. Last month, chairs hung too close to the spray gun, and we burned extra powder. Lou says gun distance matters. But how much? If we move a frame one inch, what happens to the coating? Marcus, the quality engineer, smiles. Let's not guess, Rosa. Let's let the data draw us a line!

Hey there, I'm Q-Bot. Welcome to the Q-Bot Academy. Today: correlation and regression. We'll cover scatter diagrams, the correlation coefficient, why correlation is not causation, the regression line, R squared, and how to use a line safely. Then we'll answer Rosa.

What it is

So, what are they? Correlation tells you how strongly two things move together in a straight line. Regression goes one step further: it gives you the equation of that line, so you can predict one thing from the other. We call the thing you set or change the input, or X. That's the independent variable. The thing that responds is the output, or Y, the dependent variable. At Brindlewood, X is the distance from the spray gun, and Y is the coating thickness.

Why it matters

Why does it matter? Because improvement is all about finding which inputs drive the output. Once you know how Y moves with X, you can set the knob with a number instead of a hunch. Get it wrong, and you chase a cause that isn't real, or keep turning the wrong knob while the real problem keeps costing you powder and scrap!

How it works: from scatter diagram to regression line

Step one is always the picture: a scatter diagram. Each pair of measurements becomes one dot, with X across the bottom and Y up the side. Then you read the direction. Positive means Y rises as X rises, like the minutes the roll up door stood open and the weld porosity on station four. Negative means Y falls as X rises, like gun distance and coating thickness. And no pattern means no relationship. Bad: staring at two lists of numbers. Good: plot every pair as a dot first.

Step two puts a number on it: the correlation coefficient, R. It always runs from minus one to plus one. The sign tells you the direction, and the size tells you the strength. Plus one or minus one means every dot sits exactly on a straight line. Zero means no straight line relationship at all. A common rule of thumb: above zero point eight, either way, is strong, and below zero point five is weak. Bad: saying R equals minus zero point nine is weak because it's negative. Good: minus zero point nine is strong. The minus sign only means the line slopes down!

But R has blind spots. It only measures straight lines. A curved pattern, where Y rises and then falls, can give an R near zero even though the relationship is strong. And one wild point, like a mistyped reading, can make a weak R look strong, or a strong one look weak. Bad: computing R without ever looking at the plot. Good: plot first, then calculate, and check any point that sits far from the rest.

Here's the big one: correlation is not causation. Hannah, the customer service lead, sees wobbly chair complaints climb in the hot summer months. Does heat make chairs wobble? No! Summer is when Brindlewood ships the most chairs, so more chairs means more complaints. Sales volume is the lurking variable, a third thing that drives both. Bad: blaming the weather. Good: look for a lurking variable, and prove a cause with a planned experiment before you act.

Now, regression. Simple linear regression fits one straight line through the dots: Y equals B zero, plus B one times X. B one is the slope: how much Y changes when X goes up by one unit. B zero is the intercept: where the line would cross when X is zero. Which line? The least squares line. For every dot, the residual is the actual value minus the value the line predicts. The least squares line makes the sum of those squared residuals as small as it can be.

How good is the line? That's R squared, the coefficient of determination. Just square R. It tells you what share of the variation in Y is explained by X. If R is minus zero point nine, R squared is zero point eight one: eighty one percent of the variation in Y moves with X, and the other nineteen percent comes from everything else.

And use the line safely. Predict only inside the range of X you actually tested. Outside it, the pattern may bend or break. Then look at the residuals. If they bounce randomly above and below zero, the straight line fits. If they make a curve or a funnel, it doesn't. Bad: using a line built from six to fourteen inches to predict two inches. Good: stay inside your data, or go collect more!

Worked example: gun distance and coating thickness

Now, let's answer Rosa. Marcus and Priya, the quality technician, run a small study. They hang five Harbor chair frames at five gun distances: six, eight, ten, twelve and fourteen inches. Priya measures the coating thickness on each one: four point one, three point four, three point oh, two point four and two point one mils. The dots slope down, nice and tight. The average distance is ten inches, and the average thickness is three point oh mils.

First, R. For each frame, take how far X sits from its average, and how far Y sits from its average. Multiply the two for each frame, and add them up: that's minus ten. Square the X distances and add them: forty. Square the Y distances and add them: two point five four. R equals minus ten, divided by the square root of forty times two point five four. That's minus ten divided by about ten point oh eight, so R is about minus zero point nine nine. A very strong, negative, straight line relationship!

Next, the line. The slope is that minus ten divided by the forty: minus zero point two five mils per inch. The intercept is the average thickness minus the slope times the average distance: three point oh, plus two point five, equals five point five. So, thickness equals five point five, minus zero point two five times the distance. R squared is about zero point nine eight: distance explains about ninety eight percent of the variation here. At the chair notch, ten inches, the line predicts three point oh mils, right on target! At the table notch, eight inches, it predicts three point five, just what second shift saw. Rosa has her answer: every inch closer adds a quarter of a mil!

Common mistakes

A few common mistakes. One: treating correlation as proof of cause. Two: calculating R without plotting. Three: predicting outside the range you tested. Four: letting one outlier or a tiny sample fool you. And five: mixing up R and R squared. An R of zero point seven explains only forty nine percent of the variation.

Recap

Let's recap. Start with a scatter diagram: X across, Y up. R runs from minus one to plus one: the sign is direction, and the size is strength. Correlation is not causation, so watch for lurking variables. The least squares line, Y equals B zero plus B one X, gives the slope and the intercept. R squared is the share of variation explained. And predict only inside your data.

Check yourself

Now, check yourself. Brindlewood's line is: thickness equals five point five, minus zero point two five times the gun distance in inches. What thickness does it predict at nine inches? A, two point two five mils. B, three point two five mils. C, three point five mils. Or D, five point two five mils. Pause the video if you want to think about it.

The answer is B, three point two five mils. Zero point two five times nine is two point two five, and five point five minus two point two five is three point two five. A forgot to subtract from five point five. C is the prediction at eight inches, not nine. And D subtracted only one quarter of a mil, as if the distance were one inch!

Wrap-up

That's correlation and regression. Questions? Ask Q-Bot right here in the Academy. And here's one for the road: why does the regression line get invited to every party? Because it always finds the best fit!

Independent study material; not affiliated with or endorsed by ASQ. Body of Knowledge codes identify where the topic appears in each certification's published outline.