Academy › Topic library › Going Deeper: One-Way ANOVA, Worked Step by Step
Q-BOT ACADEMY · FREE VIDEO LESSON · 13 MIN
Going Deeper: One-Way ANOVA, Worked Step by Step
Each test at alpha point oh five has a five percent chance of a false alarm. Run three of them, and the chance of at least one false alarm grows to about fourteen percent. With four groups, you'd need six tests, and that chance climbs to about twenty six percent. One-way a nova tests every group at once, so the false alarm risk stays at the alpha you picked.
In short
One-way a nova tests whether at least one of several means differs, in one test. The total sum of squares splits into between and within. Each mean square is a sum of squares over its degrees of freedom: k minus one, and N minus k. F is the mean square between over the mean square within, tested on the right tail. After a reject, use Tukey to find which group, and always check the assumptions and the size of the difference!
Check yourself
Ellen tests welding wire from four spools, six welds each. The sum of squares between is twelve hundred, and the sum of squares within is four thousand. Alpha is point oh five, and the critical F for three and twenty degrees of freedom is three point one oh. What's F, and what do you conclude? A: F is two point oh, fail to reject. B: F is point three, fail to reject. C: F is two point oh, reject. Or D: F is two point three, fail to reject.
Show the answer
The answer is A. Between: four spools minus one is three degrees of freedom, so the mean square is twelve hundred over three, four hundred. Within: twenty four welds minus four is twenty, so the mean square is four thousand over twenty, two hundred. F equals four hundred over two hundred: two point oh. That's below three point one oh, so fail to reject. B divided the sums of squares. C compared F to one, not the critical value. And D used N minus one, twenty three, for the within degrees of freedom. That's one-way a nova, worked step by step. Questions? Ask Q-Bot right here in the Academy. And one for the road: why was the a nova table always so calm? It had already worked out all its differences!
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
Brindlewood, a Monday morning. The coating line has three powder guns, and since Lou's adjustment, Marcus wants to know one thing: do all three guns lay down the same average thickness? Dwayne has an idea. Just run t tests! Gun one against gun two, one against three, two against three. Marcus shakes his head. Three tests, three chances for a false alarm. There's one test that asks the whole question at once!
Hey there, I'm Q-Bot. Welcome to the Q-Bot Academy. Today we're going deeper: one-way analysis of variance, worked step by step! We'll cover why several t tests are a trap, the sums of squares, the a nova table, the assumptions, and how to find which group is different. If hypothesis testing is new to you, start with the hypothesis testing video.
Why not several t tests?
Why not just run t tests? Each test at alpha point oh five has a five percent chance of a false alarm. Run three of them, and the chance of at least one false alarm grows to about fourteen percent. With four groups, you'd need six tests, and that chance climbs to about twenty six percent. One-way a nova tests every group at once, so the false alarm risk stays at the alpha you picked.
The hypotheses
Here's the setup. One factor, like the powder gun, with k levels, or groups. The null hypothesis says all the group means are equal. The alternative says at least one mean is different. Not all of them, just at least one. Bad: read a reject as every group is different. Good: read it as at least one group stands apart, then go find which one.
The big idea
The big idea is in the name. A nova compares two kinds of variation. Between the groups: how far apart are the group averages? And within the groups: how much do the readings scatter inside each group? If the averages are far apart compared to the scatter inside, the groups really differ. Bad: compare only the averages. Good: compare the gap between averages to the spread inside each group.
Sums of squares
Now the formulas, one at a time. The total sum of squares adds up every reading's squared distance from the grand mean, the mean of all the data. It splits in two. The sum of squares between: for each group, its size times the squared distance from its mean to the grand mean, added up. The sum of squares within: every reading's squared distance from its own group mean, added up. Total equals between plus within, every time.
Degrees of freedom, mean squares and F
Next, degrees of freedom. Between groups: k minus one. Within groups: N minus k, where N is the total number of readings. Total: N minus one. Divide each sum of squares by its degrees of freedom to get a mean square. The mean square within is the pooled variance, the noise level. Then F equals the mean square between divided by the mean square within. If the null is true, F sits near one. A big F means the averages are farther apart than noise alone would explain.
The F test
To decide, compare F to the F distribution, with k minus one and N minus k degrees of freedom. The critical value comes from an F table, or from the spreadsheet's right-tail F inverse. If F is bigger than the critical value, reject the null. The p-value comes from the right-tail F distribution. A nova's F test is always one-tailed, on the right, because only a big F is evidence of a difference.
The assumptions
Before you trust the answer, check three assumptions. One: independent readings, collected in random order. Two: the residuals, each reading minus its group mean, are roughly normal. Three: the groups have roughly equal variances. Check the spread with Levene's test. With equal group sizes, a nova handles mild departures well. If the spreads are very different, use Welch's a nova instead.
Worked example 1: three powder guns
Worked example one. Priya measures five frames from each of the three powder guns, in mils, all fifteen in random order. The readings are on the screen. Gun two's readings all sit a little higher. The group means are three point oh oh, three point oh eight, and three point oh oh. The grand mean is three point oh two seven.
First, the sum of squares between. Gun one sits point oh two seven below the grand mean. Gun two sits point oh five three above it. Gun three, point oh two seven below. Square each distance and multiply by five frames: point oh oh three six, plus point oh one four two, plus point oh oh three six. The sum of squares between is point oh two one three.
Next, the sum of squares within. Inside gun one, the squared distances from its own mean add up to point oh oh five eight. Gun two: point oh oh four oh. Gun three: point oh oh two oh. The sum of squares within is point oh one one eight. As a check, the total sum of squares is point oh three three one, and that's exactly point oh two one three plus point oh one one eight.
Now build the a nova table. Between: two degrees of freedom, so the mean square is point oh two one three over two, point oh one oh seven. Within: fifteen frames minus three groups, twelve degrees of freedom, so the mean square is point oh one one eight over twelve, point oh oh oh nine eight three. F equals point oh one oh seven over point oh oh oh nine eight three: ten point eight five! The critical value for two and twelve degrees of freedom is three point eight nine. The p-value is about point oh oh two. Reject the null: at least one gun is different.
Which gun? Tukey's method
But which one? A nova doesn't say, so follow up with Tukey's method. Tukey's honest significant difference is q, from a studentized range table, times the square root of the mean square within over n. For three groups and twelve degrees of freedom, q is three point seven seven. The square root of point oh oh oh nine eight three over five is point oh one four. So any two means more than point oh five three apart are different. Gun two is point oh eight above both others. Guns one and three match exactly. Gun two is the odd one out!
Before acting, check the assumptions. The standard deviations are point oh three eight, point oh three two, and point oh two two, all close, and Levene's test agrees, with a p-value of about point five six. Then ask how big. Eta squared is the sum of squares between over the total: point oh two one three over point oh three three one, about sixty four percent. That much of the variation lines up with which gun sprayed the frame. Lou checked gun two and found its powder flow set high. Every frame was still in spec, but extra powder is money on the floor!
Worked example 2: unequal group sizes
Worked example two, with unequal group sizes. Dwayne times Harbor chair assembly at three benches. Bench one: six chairs, averaging fourteen point six seven minutes. Bench two: five chairs, averaging fourteen point nine eight. Bench three: seven chairs, averaging fourteen point eight six. The grand mean of all eighteen chairs is fourteen point eight three minutes.
With unequal sizes, each group's squared distance is weighted by its own size. Six times point one six one squared, plus five times point one five two squared, plus seven times point oh two nine squared: the sum of squares between is point two seven eight. The sum of squares within is five point five four. Degrees of freedom: two between, and eighteen minus three, fifteen, within. The mean squares are point one three nine and point three six nine. F is point three eight, far below the critical value of three point six eight. The p-value is about point six nine. Fail to reject.
How should Dwayne read that? Not as proof the benches are identical. The averages differ by about a third of a minute, while chairs inside each bench scatter by about six tenths of a minute. With so few chairs, a modest real difference could hide in that noise. If a half-minute difference matters, plan the sample size first. And since there's no evidence of a difference, there's no reason to run Tukey and go hunting for one.
Reading the result
So how do you read the result and decide? A big F and a small p-value mean at least one group differs. Find which with a comparison method, check the assumptions, and ask whether the size matters, against the spec and the cost. A small F means no evidence of a difference, and how much that tells you depends on the power of the study. A nova on data you just observed shows a difference, not its cause; finding the cause takes a look at the process, like Lou did.
In a spreadsheet and in software
In a spreadsheet, the Data Analysis tool pack has a nova single factor. Give it the columns, and it builds the whole table, with the p-value and the critical value. The right-tail F distribution and F inverse do the pieces by hand. Statistical software adds Tukey's comparisons, residual plots and Welch's a nova.
Common mistakes
Common mistakes. One: a string of t tests instead of one a nova. Two: reading a reject as all groups are different. Three: stopping at the F test and never finding which group. Four: dividing the sums of squares instead of the mean squares. Five: using N minus one for the within degrees of freedom instead of N minus k. Six: skipping the checks for equal spread and normal residuals. And seven: reading fail to reject as proof the groups are the same.
Recap
Let's recap. One-way a nova tests whether at least one of several means differs, in one test. The total sum of squares splits into between and within. Each mean square is a sum of squares over its degrees of freedom: k minus one, and N minus k. F is the mean square between over the mean square within, tested on the right tail. After a reject, use Tukey to find which group, and always check the assumptions and the size of the difference!
Check yourself
Now, check yourself. Ellen tests welding wire from four spools, six welds each. The sum of squares between is twelve hundred, and the sum of squares within is four thousand. Alpha is point oh five, and the critical F for three and twenty degrees of freedom is three point one oh. What's F, and what do you conclude? A: F is two point oh, fail to reject. B: F is point three, fail to reject. C: F is two point oh, reject. Or D: F is two point three, fail to reject. Pause the video if you want to think about it.
The answer is A. Between: four spools minus one is three degrees of freedom, so the mean square is twelve hundred over three, four hundred. Within: twenty four welds minus four is twenty, so the mean square is four thousand over twenty, two hundred. F equals four hundred over two hundred: two point oh. That's below three point one oh, so fail to reject. B divided the sums of squares. C compared F to one, not the critical value. And D used N minus one, twenty three, for the within degrees of freedom.
That's one-way a nova, worked step by step. Questions? Ask Q-Bot right here in the Academy. And one for the road: why was the a nova table always so calm? It had already worked out all its differences!
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.