Forum Discussion

Sojourner21's avatar
Sojourner21
Copper Contributor
Mar 17, 2024

Calculating the sum of squares between

Hey there, I'm conducting a one way ANOVA to test a null hypothesis.  First step, calculate the sum of squares between and the mean of squares between.  Any idea how to program this?
  • NikolinoDE's avatar
    Mar 17, 2024

    Sojourner21 

    To calculate the sum of squares between (SSB) for a one-way ANOVA in Excel, you can follow these steps:

    1. Calculate the overall mean (Grand Mean):

      • Add up all the data points from all groups.
      • Divide the total by the total number of data points.

    2. Calculate the group means:

      • Calculate the mean for each group separately.

    3. Calculate the sum of squares between (SSB):

      • Subtract the overall mean from each group mean.
      • Square each of these differences.
      • Multiply each squared difference by the number of observations in the corresponding group.
      • Add up all the squared differences calculated above to get the sum of squares between.

     

    Here's how you can do this programmatically in Excel:

    Assuming your data is organized in columns with each column representing a different group, and the rows represent individual observations, you can use Excel formulas to perform these calculations.

    1. Calculate the overall mean:

    =AVERAGE(A1:B10)  ' Replace A1:B10 with the range of your data

    2. Calculate the group means:

    • You can use the AVERAGE function similarly to calculate the mean for each group.

    3. Calculate the sum of squares between (SSB):

    • Subtract the overall mean from each group mean:

    =(Group Mean 1 - Grand Mean)^2

    =(Group Mean 2 - Grand Mean)^2

    ...

    • Multiply each squared difference by the number of observations in the corresponding group.
    • Add up all the squared differences calculated above to get the sum of squares between.

    4. Sum the squared differences to get the SSB:

    =SUM(SSB1:SSBn)  ' Replace SSB1:SSBn with the range of the squared differences

    By following these steps, you can calculate the sum of squares between for your one-way ANOVA in Excel. Remember to adjust the cell references and formulas based on the layout and size of your data.

    My knowledge of this topic is limited, but since no one has answered it, I entered your question in various AI. The text and the steps are the result of various AI's put together.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

     

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

Resources