*! version 1.1.0 10Aug2013

*! version 1.0.0 30Jul2013
help svysampsi

Title

svysampsi -- Sample size for surveys with a dichotomous outcome variable

Syntax

svysampsi #population
[, proportion(#)
moe(#)
level(#)
response(#) ]

#population is the size of the target population.

Options

Main

proportion(#) specifies the proportion of the sample
with the expected outcome. The default is prop(0.50), and values must be
between 0 and 1.0.

moe(#) specifies the margin of error, as a percent. The default is moe(5.0), and values must be
between 0 and 100.

response(#) specifies the expected response rate. When response is
specified, svysampi provides an adjusted sample size estimate. Values must be
between 0 and 1.0.

level(#) specifies the confidence level, as a percentage, for
confidence intervals. The default is level(95) or as set by
set level.

Description

svysampsi estimates the finite population corrected sample size
for a simple random survey in which the primary variable under study is
dichotomous. svysampsi is an immediate command; see immed
for more on immediate commands.

Remarks

There are many situations in which the primary variable being measured
in a survey is dichotomous or binary, and thus aggregates to a
proportion (e.g., the proportion of smokers in a population, the
proportion of voters that view a candidate favorably, etc.). In
estimating the sample size needed for the survey, the researcher must
consider three criteria:

1. The proportion of the population expected to respond
positively to the question. Higher (or lower) proportions indicate
greater homogeneity in the population on this attribute, whereas a
proportion of 0.50 indicates the greatest amount of variability (50/50
split). When an a priori assumption cannot be made about a population's
expected level of the attribute, researchers typically set the
proportion at 0.50 to derive a conservative sample size estimate.

2. The margin of error (or sampling error) represents the
range in which the true value of the population is expected to lie.
Thus, with 50% of a hypothetical survey sample indicating that they
smoke, and a 5% margin of error, we would estimate that between 45%
and 55% of the overall population are smokers. Other things being equal,
larger margins of error produce smaller sample size estimates.

3. The confidence level is used in conjunction with the
margin of error. For example, assuming a normally distributed
variable and a 95% confidence level, we would expect that 95 out of 100
randomly drawn samples will elicit a true population proportion that is
within the range of the proportion +/- the margin of error.
Other things being equal, lower confidence levels produce lower sample
size estimates.

In addition, the researcher may want to oversample from the population
to account for non-response. In svysampsi, when the expected
response rate is specified, an additional "over-sample" size estimate is
provided.

Lastly, svysampsi estimates the sample size assuming a simple
random sample design is being utilized. If a more complex design is
planned, such as stratified random sampling, sample sizes at the level
of strata should be estimated. An example is provided below for how
svysampsi can be modified for this purpose.

Examples

Example 1: Assumes default settings; prop=0.50, level=95.0, moe=5.0

. svysampsi 10000

Example 2: Specifies all options, including an expected response rate of 65%

. svysampsi 10000, prop(0.80) moe(3.0) lev(99) resp(0.65)

Example 3: A routine for estimating sample sizes by strata, and then
summing them to provide an overall value. Here we specify 3 strata with
population sizes of 390, 121 and 42, with respective proportions of 0.5,
0.2, and 0.3. We set the moe=3.0, and level=95

scalar ss_all = 0
forval k = 1/3 {
local i : word `k' of 390 121 42
local j : word `k' of 0.5 0.2 0.3
svysampsi `i', p(`j') lev(95) moe(3.0)
scalar ss_all = ss_all + r(adjss)
}
di scalar(ss_all)
di as text "Estimated total required sample size:"
di as text " n = " as result scalar(ss_all)

Or for a somewhat different look...

tempname resmat
forvalues k = 1/3 {
local i : word `k' of 390 121 42
local j : word `k' of 0.5 0.2 0.3
svysampsi `i', p(`j') lev(95) moe(3.0)
matrix `resmat' = nullmat(`resmat') \ r(adjss)
local names `"`names' `"`i'"'"'
}
mat colnames `resmat' = "Sample Size"
mat rownames `resmat' = `names'
matlist `resmat' , row("Strata Size")

Stored results

svysampsi stores the following in r():

Scalars

r(pop) user-entered population size

r(prop) user-entered proportion

r(moe) user-entered margin of error

r(resp) user-entered response rate

r(ss) unadjusted sample size

r(adjss) finite population corrected sample size

r(resp_adjss) response-rate adjusted sample size

References

Lohr, Sharon L. 2010. Sampling: Design and Analysis, 2nd Ed. Boston: Cengage Learning.

Cochran, William G. 1977. Sampling Techniques, 3nd Ed. New York: John Wiley and Sons, Inc.

Sudman, Seymour. 1976. Applied Sampling. New York: Academic Press.

Kish, Leslie. 1965. Survey Sampling. New York: John Wiley and Sons, Inc.

Citation of svysampsi

svysampsi is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, Ariel (2013). svysampsi: Stata module for estimating sample size for surveys with a dichotomous outcome variable.
http://www.lindenconsulting.org

Author

Ariel Linden

President, Linden Consulting Group, LLC

Ann Arbor, MI, USA

alinden@lindenconsulting.org

http://www.lindenconsulting.org

Acknowledgments

I would like to thank Nicholas J. Cox for providing helpful guidance in writing the code used in Example 3, as
well as providing a review of the overall program code and help file.

Also see

Manual: [R] sampsi, [D] sample

Online: sampsi, sample