Calculates the sample size to achieve the required confidence interval.
What sample size should you use for a survey in a city with a population of 120,000 people?
You want to have a confidence level of 95%.
The confidence interval should be ± 0.05 (± 5%).
Survey question: "what party will you vote?"
Confidence level = 0.95 .
If you don't know what proportions to expect you should assume the worth case meaning the largest standard deviation.
The largest standard deviation for a proportion is for Proportion = 0.5, which means that one party will gain 50% of the votes.
Population standard deviation (σ) - leave empty as it will be calculated from the proportion.
Margin of error (MOE) = 120,000 .
Population (N) = 120,000 .
The following R code should produce the same results.