When designing a study, the sample size is an important consideration because the larger the sample size, the more data you have, and the more precise your results will be (assuming high-quality data). If you know the level of precision you want (that is, your desired margin of error), you can calculate the sample size needed to achieve it.
To find the sample size needed to estimate a population mean (µ), use the following formula:
In this formula, MOE represents the desired margin of error (which you set ahead of time), and σ represents the population standard deviation. If σ is unknown, you can estimate it with the sample standard deviation, s, from a pilot study; z* is the critical value for the confidence level you need.