1
Stata Survey Statistics
[stata_survey_stats_commands]
See UCLA/ATS, Stat 130 Class Notes, “Survey Sampling” for an introduction with
,
which is the principal
source of the
following notes.
Commands changed in Stata8.
Stata surveystatistics format commands
. svydescribe
. svyset, clear
. svyset [pw=weightvar], stata(stratvar) psu(psuvar)
[last term is name of variable]
. svydes
§
See Stata instructions for the command
sampsi
.
§
svy commands with “if” give the wrong CI; use
subpop
or
by
instead of “if”
(the same applies to boostrapping)
§
do not use LRtest with svystats, or otherwise with pweight.
Instead use
either
svytest
(if # clusters <~100) or
test
(which in this instance gives a
Wald test)
§
Finite population correction (fpc)
: computes adjusted N for se estimates (N –
n/N); used only in simple random sampling without replacement.
That is, it
accounts for the reduction in variance that occurs when sampling
without
replacement from a finite population, as compared to sampling
with
replacement. Use fpc() option for cases of simple random sampling or
stratified random sampling without replacement of psu’s within each stratum
with no subsampling within psu’s.
Including fpc() reduces the variance
estimate, but minimally if Npsu’s is large relative to sampledn
psu’s
.
To use, set fpc() to Nh, the var representing the total number of
psu’s per stratum in the population (e.g., hid in datafile comprised of
individual household members).
Caution: you must know the total
populationparameter of the pertinent var (e.g., total popN in each
stratum or cluster) in order to use fpc, so thus we will rarely if ever
use fpc
§
Recall that that unequal nonresponse rates across strata &/or clusters must
be adjusted for
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document2
How to set surveystats in Stata for various samples
simple random sample
random sample of one hospital from a population (hospno) of 25 hospitals;
enumeration unit (i.e. population) is #births (N=773) in the sampled hospital during
the previous year; in sum, what Stata needs for a simple random sample is (1)
weighting var & (2) total enumeration units of population (N) from which sample is
drawn
. svyset [pw=weight1], fpc(birth)
momsag.dta; sampling weight=N/n
birth=total N
[psu <obs>is hospno (total #hospitals), which=25; in this case psu is the
enumeration unit, but this is not so in all cases]
. svymean momsag
compare with: su momsag
. svytotal momsag
compare with: sumsum momsag
egen rsum=sum(momsag)
random sample of 40 workers from total enumeration units (i.e. population, N:
popsize) of 1200 workers; includes (1) weighting var & (2) total enumeration units of
population (N) from which sample is drawn
. svyset [pw=wt1], fpc(popsize)
workers.dta; sampling weight=N/n
popsize=total N
. svymean fvc, by(exposure)
simple random sample with subdomains
summary:
what is required for simple random sampling is just two parameters, the
total #enumeration units(N) from which the sample is drawn & the weighting var
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Tardanico
 Simple random sample, ratio x1 x2, total x1 x2

Click to edit the document details