Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 26

Constructing a One-Way ANOVA Table

Recommended resources

In our last session, we took the crucial first step into experimental analysis by designing single-factor experiments for both the bra-fitting business and the relationship management scenario. We established how to manipulate a single factor across different groups to isolate its effect on a response variable. Now that we have the design, the next logical step is to analyze the data we would collect from such an experiment.

This lesson focuses on the core computational engine for comparing means across multiple groups: the one-way Analysis of Variance (ANOVA). You will learn how to take a small dataset from a single-factor experiment and manually compute all the components of an ANOVA table. This includes the various Sums of Squares (SSB, SSW), degrees of freedom (df), Mean Squares (MSB, MSW), and finally, the F-statistic. This process partitions the total variability in your data, allowing you to determine if the differences observed between your groups are statistically meaningful or likely due to random chance.

The Logic of Decomposing Variance

Before we dive into the calculations, let's solidify the intuition. The central idea of ANOVA is to compare the variation between the different treatment groups to the variation within each of those groups.

  • Variation Between Groups (SSB): This measures how much the mean of each group differs from the overall grand mean. If your experimental treatment (e.g., different discount coupons) has a strong effect, you would expect the group means to be far apart, resulting in a large "between-group" variation.
  • Variation Within Groups (SSW): This measures the random, unexplained variation of individual data points around their own group's mean. This is considered the inherent noise or error in the measurement process.

The test statistic in ANOVA, the F-statistic, is fundamentally a ratio of these two types of variation:

If the F-statistic is large, it suggests that the variation caused by your treatment is significantly greater than the random noise, and you can be more confident that the factor you manipulated has a real effect. Our goal is to calculate all the pieces that lead to this ratio and organize them into a standard ANOVA table.

To see how these calculations are structured in practice, the following resource provides an excellent, detailed walkthrough.

One-Way ANOVA | Introduction to Statistics - JMP

This article from JMP provides a clear, step-by-step guide to the manual calculation of a one-way ANOVA table, mirroring the process we will follow. It introduces the core concepts before breaking down the formulas.

Start by reading the section 'One-way ANOVA calculation' to familiarise yourself with the notation. Then, carefully study the three subsequent subsections: 'Sum of Squares': Focus on the main formula that partitions the Total Sum of Squares, SS(\text{Total}) = SS(\text{Factor}) + SS(\text{Error}). This is the foundational identity of ANOVA. 'Degrees of Freedom (DF)': Note the simple formulas for calculating the degrees of freedom for the factor, the error, and the total. 'Mean Squares (MS) and F Ratio': Understand how Mean Squares are derived from the Sums of Squares and degrees of freedom, and how they combine to form the final F-ratio.

Now, let's apply this framework to our own scenarios.



Application 1: Bra-Fitting Business ANOVA

From our previous lesson, we designed an experiment to test if a discount coupon affects a client's initial purchase amount.

  • Factor: Discount Offer
  • Levels (k=3): Group 1 (Control), Group 2 (10% Off), Group 3 (25% Off)
  • Response: Initial purchase amount ($)

Let's assume we ran the experiment and collected data from 4 clients in each group (N=12).

Group 1 (Control) Group 2 (10% Off) Group 3 (25% Off)
$80 $90 $110
$95 $105 $120
$88 $100 $108
$77 $93 $114

Step 1: Calculate Means

First, we calculate the mean for each group () and the overall grand mean ().

  • Group 1 Mean:
  • Group 2 Mean:
  • Group 3 Mean:
  • Grand Mean:

Step 2: Calculate Sums of Squares (SS)

  • Sum of Squares Between Groups (SSB): This measures the variation of group means around the grand mean, weighted by group size.




  • Sum of Squares Within Groups (SSW): This measures the variation of individual data points around their own group mean.

    Group 1:
    Group 2:
    Group 3:

Step 3: Calculate Degrees of Freedom (df)

  • df Between (df_B):
  • df Within (df_W):
  • df Total (df_T): (Check: )

Step 4: Calculate Mean Squares (MS)

  • Mean Square Between (MSB):
  • Mean Square Within (MSW):

Step 5: Calculate the F-statistic

  • F-statistic:

Step 6: Assemble the ANOVA Table

Finally, we organize all our calculations into the standard table format.

Source of Variation Sum of Squares (SS) Degrees of Freedom (df) Mean Square (MS) F-statistic
Between Groups 1578.68 2 789.34 16.91
Within Groups 420.00 9 46.67
Total 1998.68 11

Note: Total SS can also be calculated directly as . The sum SSB + SSW = 1578.68 + 420 = 1998.68 confirms our calculations.

The image below shows another example of this entire calculation flow, from raw data to the final F-Value. Notice the similarities in the structure of the computation, even with different data and notation (QS for Sum of Squares).

This image visualizes the complete process for a one-way ANOVA. It starts with raw data for three groups, calculates group and grand means, computes the three types of Sums of Squares (Total, Between, Within), determines the Mean Squares, and culminates in the F-value.


Application 2: Relationship Management ANOVA

Now, let's repeat the process for our second scenario: testing if a structured weekly check-in improves relationship satisfaction.

  • Factor: Communication Protocol
  • Levels (k=2): Group 1 (Control/Normal Week), Group 2 (Treatment/Check-in Week)
  • Response: Average weekly satisfaction score (1-10)

Let's assume we ran this experiment over 10 weeks, with 5 weeks of each type (N=10).

Group 1 (Control) Group 2 (Treatment)
6.5 8.0
7.0 8.5
6.0 9.0
7.5 7.5
6.0 8.0

Step 1: Calculate Means

  • Group 1 Mean:
  • Group 2 Mean:
  • Grand Mean:

Step 2: Calculate Sums of Squares (SS)

  • Sum of Squares Between Groups (SSB):


  • Sum of Squares Within Groups (SSW):
    Group 1:
    Group 2:

Step 3: Calculate Degrees of Freedom (df)

  • df Between (df_B):
  • df Within (df_W):
  • df Total (df_T):

Step 4: Calculate Mean Squares (MS)

  • Mean Square Between (MSB):
  • Mean Square Within (MSW):

Step 5: Calculate the F-statistic

  • F-statistic:

Step 6: Assemble the ANOVA Table

Source of Variation Sum of Squares (SS) Degrees of Freedom (df) Mean Square (MS) F-statistic
Between Groups 6.4 1 6.4 17.07
Within Groups 3.0 8 0.375
Total 9.4 9

As you can see, the procedure is identical regardless of the number of groups. To review the entire sequence of calculations one more time, the following resource provides another complete, manually-computed example.

One-Way ANOVA: Example - Statistics and Probability

This Stat Trek page methodically computes an ANOVA for a pharmaceutical experiment. It serves as a great reference to confirm your understanding of the entire computational process.

Follow the calculations starting from the section Mean Scores through to the Test Statistic section. Notice how the author computes the group and grand means, the three Sums of Squares (SSB, SSW, SST), the degrees of freedom, the two Mean Squares (MSB, MSW), and finally the F-statistic, before summarizing it all in the ANOVA Summary Table.


Conclusion

In this lesson, you have mastered the manual computation of a one-way ANOVA table. By breaking down the total variation in the data, you can now quantify the effect of your experimental factor and compare it against the inherent variability or "noise" in the system.

Key Takeaways:

  • The core of ANOVA is partitioning the Total Sum of Squares (SST) into variance Between groups (SSB) and variance Within groups (SSW).
  • The calculation follows a clear sequence:
    1. Calculate group means and the grand mean.
    2. Compute Sums of Squares (SSB and SSW).
    3. Determine Degrees of Freedom (df_B and df_W).
    4. Calculate Mean Squares (MSB and MSW) by dividing SS by df.
    5. Compute the F-statistic as the ratio of MSB to MSW.
  • The final ANOVA table neatly summarizes these quantities, providing a standardized report of your analysis.

We now have an F-statistic for both of our experiments. A large F-value suggests a significant effect. But what does this mean in practice? For the bra-fitting example with three groups, the F-statistic tells us that at least one group is different from the others, but it doesn't tell us which ones. Is the 25% coupon better than the 10%? Is the 10% coupon better than no coupon? To answer these more specific questions, we need to perform post-hoc tests, which will be the topic of our next lesson.