This is a summary note on calculating sample size for different purposes. The detailed derivation of the sample size for an AB testing with two-independent groups can be found here.
AB Testing
Let the test statistic be significant at
where
Two Independent Groups
Suppose the proportion rate
in the treatment group is not much different from the proportion rate in the control group. Then, we have , and . The total sample size including the treatment and the control is . One-tailed
is the critical value
Here is a link to an Online Calculator at DataSciencEgenie.
Two-tailed
is used rather than
Here are links to Online Calculator at ClinCalc and Evan's Awesome A/B Tools.
Two equal-size groups
Population v.s. One Study Group
Suppose the population proportion is known at
. We have and . The sample size of the study group is . Here is a link to an Online Calculator at ClinCalc.
Survey
In a survey, we care about the result representativeness, that is, if the sample mean from the survey can represent the population mean.
Ideally, we would like our survey proportion
The sampling distribution of the difference,
Therefore,
The confidence level suggests
where
The minimal survey size is given by
Here is a link to an Online Calculator at Calculator.
Z Critical Values
The following table presents a list of commonly used Z scores (also known as critical values) in practice.
0.01 | 2.326 | +/-2.576 |
0.05 | 1.645 | +/-1.960 |
0.10 | 1.282 | +/-1.645 |
0.20 | 0.842 | +/-1.282 |
View / Make Comments