Sample Size Calculation - Means

This Demonstration calculates the minimum sample size, n, required to be randomly drawn from a population, to be able to detect a difference in the population mean of at least δ units from the true population mean with confidence of 1-α. You can vary α (the Type I risk), β (the Type II risk), or δ/σ, the ratio of the detected difference to the population standard deviation. In most practical cases, the standard deviation may not actually be known, but is estimated from prior knowledge or experience.

THINGS TO TRY

MouseOver ▪ MouseOver

DETAILS

Suppose an experiment is to be conducted where a treatment of some sort is to be applied to a population. The investigator is interested in knowing the minimum sample size that should be randomly selected from the population to detect a change in the mean of the population as a result of the treatment. The statistical factors that influence the sample size are:
	- the value selected for α, the Type I risk (the risk of rejecting a true null hypothesis, (Subscript[H, 0]))
	- the value selected for β, the Type II risk (the risk of accepting the null hypothesis, (Subscript[H, 0]), as true when, in reality, it is false)
	- the value of the population standard deviation, σ (this is often an estimate, based on judgement and experience)
	- the size (relative to σ) of the effect to be detected by the sample

The Type I risk is that of getting a false positive from the sample. In other words, there is a probability of α that the sample will indicate that there is a difference of at least δ when, in fact, there is not.
The Type II risk is that of getting a false negative from the sample. In other words, there is a probability of β that the sample will indicate there is not a difference of at least δ when, in fact, there is such a difference. The ability to detect a difference when there actually is one is called the power of the test and is equal to 1-β.

Additionally, whether the test of the hypothesis is a one-sided or two-sided test has an effect on the sample size. A one-sided test would, for example, look at whether there is an increase OR a decrease in the mean (not both), whereas a two-sided test would consider whether the mean is EITHER more than or less than the value in the null hypothesis.

When using this Demonstration, you should mentally formulate a null hypothesis and an alternative hypothesis (either one- or two-sided). Then the appropriate control selections can be made and the resulting sample sizes can be examined.
Typical values for α and β are 0.05 and 0.20, respectively, resulting in a confidence of 95% and a test power of 80%.
Note that looking for a small difference, δ, drives a large sample size, as would be expected.

RELATED LINKS

Contributed by: Joe O'Hara

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use