Check · Test yourselfPractice tests

Academy › Topic library › Hypothesis Testing

Q-BOT ACADEMY · FREE VIDEO LESSON · 9 MIN

Hypothesis Testing

A hypothesis test is a way to decide, with data, whether a difference is real or just random variation. Every sample wobbles a little: two frames from the same wire never pull at exactly the same force. A hypothesis test asks one question: is the difference we see bigger than the wobble we'd expect by chance alone? If it is, we call it statistically significant.

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

In short

The null hypothesis says no difference; the alternative is what you need evidence for. A Type one error is a false alarm, with risk alpha. A Type two error is a miss, with risk beta, and power is one minus beta. If the P value is below alpha, reject the null. Pick the test by what you compare: means, variances or proportions. And always ask: does the difference matter?

Check yourself

Lou tries a new spray nozzle to cut powder use. Marcus sets alpha at zero point oh five, runs the test, and gets a P value of zero point two oh. What should he conclude? A, the new nozzle makes no difference, proven. B, fail to reject the null: not enough evidence of a difference. C, reject the null: the nozzle works. Or D, there's a twenty percent chance the nozzle works.

Show the answer

The answer is B. Zero point two oh is bigger than zero point oh five, so Marcus fails to reject the null. There isn't enough evidence of a difference yet, maybe because the sample was small. A is the courtroom trap: not guilty is not the same as proven innocent. C has the rule backwards. And D misreads the P value: it isn't the chance that anything is true.

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 Tuesday at Brindlewood Outdoor Furniture, and a welding wire salesman has left a shiny brochure on Rosa's desk. It says: stronger welds! Dwayne wants to try it, so Lou welds two Harbor chair frames with the new wire, and Priya pull tests them: fourteen seventy and fourteen sixty pounds. That's higher than last week! Rosa looks at Marcus. Is it really stronger, or did we just get lucky with two frames?

Hey there, I'm Q-Bot. Welcome to the Q-Bot Academy. Today: hypothesis testing. We'll cover the null and alternative hypotheses, the two kinds of wrong decisions, power, the P value, which test to use, and the five steps. Then we'll answer Rosa, with real numbers.

What it is

So, what is it? A hypothesis test is a way to decide, with data, whether a difference is real or just random variation. Every sample wobbles a little: two frames from the same wire never pull at exactly the same force. A hypothesis test asks one question: is the difference we see bigger than the wobble we'd expect by chance alone? If it is, we call it statistically significant.

Why it matters

Why does it matter? Because a hunch can be wrong in two expensive ways. Brindlewood could pay more for a wire that does nothing, or it could walk away from a real improvement. Two frames can't tell those apart. A hypothesis test puts the decision on evidence, not on the loudest voice in the room!

How it works

Step one is to write two hypotheses. The null hypothesis, H zero, is the boring one: no difference, no change, no effect. The new wire's average pull strength equals the old wire's. The alternative hypothesis, H A, is what you'd need evidence to believe: the averages are different. Bad: starting with, let's prove the new wire is better. Good: assume no difference, and let the data argue you out of it.

Think of a courtroom. The null hypothesis is innocent until proven guilty. The data is the evidence. If the evidence is strong, we reject the null hypothesis. If it isn't, we fail to reject it. Notice we never say we accept it or prove it! A not guilty verdict doesn't prove innocence; it means the evidence wasn't strong enough. Bad: the test proved there's no difference. Good: we didn't find enough evidence of a difference.

Any decision from a sample can be wrong in two ways. A Type one error is rejecting a null that was actually true: a false alarm. Brindlewood pays more for a wire that isn't really stronger. A Type two error is failing to reject a null that was false: a miss. A real improvement slips by. Before you collect data, you pick alpha, the risk of a Type one error you'll accept. Most teams use zero point oh five: a five percent chance of a false alarm.

Beta is the chance of a Type two error, a miss. And one minus beta is called power: the chance your test catches a difference that's really there. Many teams aim for at least eighty percent. Power goes up with a bigger sample, a bigger difference, and less variation in the process. Bad: testing two frames and calling it a study. Good: choose a sample big enough to find the difference that matters to you!

Now, the P value. Suppose the null hypothesis were true and there were no real difference. The P value is the chance you'd still see a difference at least as big as yours, just from random wobble. A small P value means your result would be very surprising if nothing had changed. The rule is simple: if the P value is less than alpha, reject the null. Remember it this way: if P is low, the null must go! Bad: reading P equals zero point oh three as a three percent chance the null is true. Good: it's a three percent chance of data this extreme if the null were true.

Which test do you use? It depends on what you're comparing. For averages: a z test when the process standard deviation is known, a one sample t test against a target, a two sample t test for two separate groups, and a paired t test when you measure the same items twice, before and after. For spread: an F test to compare two variances, or a chi square test for one. For percentages, like the share of defective chairs, use a test for proportions. And for three or more averages, use ANOVA. Each one's deeper math has its own video.

Every test follows five steps. One: state the null and the alternative. Two: choose alpha, and a sample size with enough power. Three: collect the data and pick the test. Four: calculate the test statistic and the P value. Five: decide, and then say what it means in plain words. That last step includes one more question: is the difference big enough to matter?

Worked example: the wire test

Now, let's answer Rosa. Marcus sets alpha at zero point oh five, and Lou welds sixteen frames, eight with each wire, in random order on the same station. Priya pull tests all sixteen. The old wire averages fourteen hundred pounds, with a standard deviation of about twenty four. The new wire averages fourteen fifty, with a standard deviation of twenty. That's fifty pounds stronger on average. But is fifty pounds bigger than the wobble?

First, Marcus checks the spread with an F test: six hundred divided by four hundred, the two variances, gives one point five, with a P value around zero point six. No evidence the spreads differ, so he can pool them. The pooled variance is five hundred, so the pooled standard deviation is about twenty two point four. The standard error of the difference is the square root of five hundred times one eighth plus one eighth: about eleven point two. So t equals fifty divided by eleven point two: about four point four seven. With fourteen degrees of freedom, the cutoff is about two point one four, and the P value is about zero point oh oh oh five.

The P value is far below zero point oh five, so Marcus rejects the null. The new wire really is stronger, about fifty pounds on average. But then Rosa asks the practical question: does fifty pounds matter? The minimum is twelve hundred pounds, and the old wire already averages fourteen hundred. The weak welds Brindlewood has seen came from worn contact tips, not from the wire. The new wire costs more, for strength nobody needs. Statistically significant, practically small. Rosa keeps the old wire, and she's glad it took data to decide!

Common mistakes

A few common mistakes. One: saying the test proved the null is true. Two: reading the P value as the chance the null is true. Three: choosing alpha after you see the data. Four: testing a tiny sample with no power, then saying there's no difference. And five: stopping at statistically significant, without asking if the difference is big enough to matter.

Recap

Let's recap. The null hypothesis says no difference; the alternative is what you need evidence for. A Type one error is a false alarm, with risk alpha. A Type two error is a miss, with risk beta, and power is one minus beta. If the P value is below alpha, reject the null. Pick the test by what you compare: means, variances or proportions. And always ask: does the difference matter?

Check yourself

Now, check yourself. Lou tries a new spray nozzle to cut powder use. Marcus sets alpha at zero point oh five, runs the test, and gets a P value of zero point two oh. What should he conclude? A, the new nozzle makes no difference, proven. B, fail to reject the null: not enough evidence of a difference. C, reject the null: the nozzle works. Or D, there's a twenty percent chance the nozzle works. Pause the video if you want to think about it.

The answer is B. Zero point two oh is bigger than zero point oh five, so Marcus fails to reject the null. There isn't enough evidence of a difference yet, maybe because the sample was small. A is the courtroom trap: not guilty is not the same as proven innocent. C has the rule backwards. And D misreads the P value: it isn't the chance that anything is true.

Wrap-up

That's hypothesis testing. Questions? Ask Q-Bot right here in the Academy. And here's one for the road: why did the null hypothesis bring a lawyer to the plant? Because it's innocent until proven guilty!

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.