Estimating means and totals with simple expansion estimators
To estimate a mean and total from a survey, we use the svymean
and svytotal commands, respectively. The syntax of these commands
is identical, so let's focus on the syntax of svytotal. To estimate
the total of some variable, var1, from n units whose weights
are given in the n by 1 vector wtname, you use the
command:
svytotal var1 [weight=wtname], [options you choose]
It's that simple! Some of the really useful options that you can choose
include the following:
-
Use a finite population correction factor by adding the option fpc(varname1),
where varname1 is an n by 1 vector containing the finite
population correction factor for each unit. Note that fpc's are relevant
only for simple random samples and stratified simple random samples.
-
Use strata, as when analyzing a stratified sample, by adding the option
strata(varname2), where varname2 is an n by 1
vector that contains each unit's stratum identifier.
-
Use primary sampling units, as when analyzing a two-stage sample, by adding
the option psu(varname3), where varname3 is an n
by 1 vector that contains each secondary unit's psu identifier.
-
Compute estimates of totals of var1 for different subpopulations
in the data (e.g., different states) by adding the option by(varname4),
where varname4 is an n by 1 vector that contains each unit's
subpopulation identifier.
There are many other options that you can choose in the survey commands,
for example to get confidence intervals (ci) or design effects (deff).
Check Stata's help system under svytotal for a description of these
options.
Sun Sep 19 12:42:31 EDT 1999