Statistics How To

Within Mean Square: Definition and Formula

Statistics Definitions > Within Mean Square

What is Within Mean Square?

Within Mean Square (WMS) is an estimate of the population variance. It is based on the average of all variances within the samples. Within Mean is a weighted measure of how much a (squared) individual score varies from the sample mean score. The notation for within mean square error is MSwithin or you may sometimes see it written as: within mean square error

Instead of σ the symbol for the population mean, you might also see “s” for the sample mean in the notation.

The most common formula is:
within mean square 2

The formula has several variations, depending on the text. For example, some texts use this (slightly more complicated) formula than the one I’ve outlined in this article:
SSwithin = sum ( (ni-1)si2 ).
All of the formulas get the same result, so it doesn’t matter which one you choose.

What is Within Mean Square used for?

Within Mean Square is used to calculate an F ratio in a one way ANOVA. The total sum of squares (SS) is the sum of both the within mean square and the between mean square (BMS). In a hypothesis test, the ratio BMS/WMS follows the shape of an F Distribution. If the ratio exceeds an F value for the test, it shows that there is a significant difference in your results.

Between vs. Within

The two terms sound similar, but there is a notable difference between the two terms.

Between group variation (sometimes called among group variation) is how much variation there is due to interaction between samples. The mean square between is therefore the mean square among sample means.

Within group variation is how much variation there is due to differences within individual samples, so the mean square within is defined as the mean square within samples.


If you prefer an online interactive environment to learn R and statistics, this free R Tutorial by Datacamp is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try this Statistics with R track.

Comments are now closed for this post. Need help or want to post a correction? Please post a comment on our Facebook page and I'll do my best to help!
Within Mean Square: Definition and Formula was last modified: December 26th, 2017 by Stephanie