This is an Observable notebook I created to explain what standard error of the mean is.
The standard deviation helps us understand how much variation there is amongst individual observations. For example, Nancy wants to understand how well her students did in the exams. She would summarize the results of her students as a mean and standard deviation.
However, the standard deviation doesn't tell us how 'good' our estimate of the mean is. This is something we need to know when we're comparing the means between samples from two or more populations. For example, if we want to compare the mileage between two different types of cars: A and B, we could measure it on a sample of cars from both populations. We can then calculate a mean and standard deviation for both samples. However, we can't make a meaningful comparison between A and B's populations based on just the mean from two small samples. This is where the standard error of the mean comes in.
In this explorable, we will develop an intuitive understanding of the standard error of the mean. We first cover the basics: normal distribution, standard deviation before delving into standard error. There are more than a few formulas, but feel free to skip past them if you are not a fan. I've included them here as they are really useful for conveying mathematical ideas concisely. Anyhow, there'll be plenty of interactive plots to keep you informed and entertained.
It'll be fun. I promise!
- Normal distributions can be characterised using the mean and the standard deviation.
- Sampling allows us to estimate characteristics of a population.
- Increasing sample size (n) increases the accuracy of the sample mean (x̅).
- The std error (σx̅) tells us how accurate our estimate of the pop mean (μ) is likely to be.
- Increasing sample size (n) reduces std error (sx̅).
- The standard error allows us to compare the means between two populations.
- Conclusion
- References
- Appendix
Normal distributions can be characterised using the mean and the standard deviation.
Good things may come in twos, but most things in life come in normal distributions. A normal distribution, sometimes called the bell curve, is a distribution that occurs naturally in many situations, e.g., heights and IQ scores. We can describe such a population using parameters such as the mean and the standard deviation.
The population mean, , is an average of a group characteristic.
where:
- is the total number of individuals or cases in the population,
- is a single observation, where i can vary from 1 to .
The population standard deviation, , is a measure of the spread (variability) of the scores.
The mean and standard deviation are pretty easy to understand visually. In the plot below, we can see a 'standard' normal distribution, i.e., a normal distribution with a mean of 0 and a standard deviation of 1. Use the slider below to see how the standard deviation helps us describe the spread of the data. It'll be useful while going through the rest of this article if you can remember that approximately 68% of the population lies within 1 standard deviation of the mean.
Sampling allows us to estimate characteristics of a population.
Unfortunately, population parameters such as and are usually unknown because it’s generally impossible to measure an entire population. However, you can use random samples to calculate estimates of these parameters.
The sample mean, , is the average score of a sample on a given variable,
where is the samples size.
The sample standard deviation, , is a measure of the spread (variability) of the scores in the sample on a given variable.
Don't worry too much about the 'n - 1' term in the denominator. If you are puzzled by why it's not just 'n', read up on the Bessel's correction.
The visualisation below shows us what a random sample from a population with a set mean and standard deviation looks like. Did you notice that the sample mean isn't always very accurate?
Increasing sample size (n) increases the accuracy of the sample mean (x̅).
The sample mean won't be exactly equal to the population mean that we're trying to estimate. If our sample size is small, our estimate of the mean won't be as good as an estimate based on a larger sample size.
Below we have a sample size of 3 compared with a sample size of 10. Both samples are from the same population.
The std error (σx̅) tells us how accurate our estimate of the pop mean (μ) is likely to be.
The standard error of the mean (also called just 'standard error') is the standard deviation of the different sample means if you took mutliple samples from the same population. Thus, we know that approximately 68% of the sample means would be within one standard error of the population mean.
However, in reality, we won't have multiple samples to use to estimate the standard error. Luckily, we can calculate the standard error of the mean from just one sample using the following formula.
Since we seldom know the pop std dev (σ), we use an approximation using the sample std dev (s).
In practice, the standard error of the mean tends to be simply defined as such.
In the following visualisation, we can see the standard error calculated for each sample. Approximately 68% of the samples will include the population mean within ±1 standard error of the sample mean.
Increasing sample size (n) reduces std error (sx̅).
With increasing sample size, the sample mean becomes a more accurate estimate of the population mean. Therefore, the standard error of the mean becomes smaller. Below we have a sample size of 3 compared with a sample size of 20. Both samples are from the same population.
In the visualisation below, we can see how the standard error reduces with sample size. Since it is inversely proportional to the square root of , it reduces drastically at first but, beyond a sample size of 20, the reduction is less pronounced. By contrast, the sample std dev (s) will not tend to change as we increase the size of our sample; it tends to pop std dev (σ).
The standard error allows us to compare the means between two populations.
Let's take a sample from two different populations. You can define the two populations using the sliders below. Use the button to resample.
Knowing the standard errors allows us to make a meaningful comparison of the populations means, not just the sample means.
Visually comparing standard error bars still isn't a very good way of testing the significance of the difference of means between two samples. There is a statistical tool called the t-test which we can use for this. Perhaps a topic for another explorable :)
Conclusion
I hope you enjoyed that :) Here's what we learnt so far.
- Normal distributions can be characterised using the pop std dev (σ) and the pop mean (μ).
- Sampling allows us to estimate characteristics of a population.
- Increasing sample size (n) increases the accuracy of the sample mean (x̅).
- The std error (sx̅) tells us how accurate our estimate of the pop mean (μ) is likely to be.
- Increasing sample size (n) reduces std error (sx̅).
- The standard error allows us to compare the means between two populations.
References
- McDonald, J.H. Standard error of the mean, 2014. Handbook of Biological Statistics (3rd ed.). Sparky House Publishing, Baltimore, Maryland.
- Altman DG, Bland JM. Standard deviations and standard errors, 2005. BMJ. doi:10.1136/bmj.331.7521.903
Appendix
I've captured all of the setup and calculations in this section. To see the code, head over to my Observable notebook here. You can also make a copy and play with it!