The examples below use Stata 8. If you are using Stata version 9, please see this page.
This example is taken from Levy and Lemeshow’s Sampling of Populations.
page 247 simple one-stage cluster sampling
use https://stats.idre.ucla.edu/stat/books/sop/tab9_1a.dta, clear svyset [pweight=wt1], fpc(M) psu(devlpmnt) svytotal NVSTNRS NGE65 Survey total estimation pweight: wt1 Number of obs = 40 Strata: <one> Number of strata = 1 PSU: devlpmnt Number of PSUs = 2 FPC: M Population size = 100 ------------------------------------------------------------------------------ Total | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- NVSTNRS | 57.5 1.936492 32.89454 82.10546 .0707804 NGE65 | 167.5 1.936492 142.8945 192.1055 .0393542 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.
svymean NVSTNRS hhneedvn Survey mean estimation pweight: wt1 Number of obs = 40 Strata: <one> Number of strata = 1 PSU: devlpmnt Number of PSUs = 2 FPC: M Population size = 100 ------------------------------------------------------------------------------ Mean | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- NVSTNRS | .575 .0193649 .3289454 .8210546 .0707804 hhneedvn | .525 .0193649 .2789454 .7710546 .0977444 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.
svyratio NVSTNRS NGE65 Survey ratio estimation pweight: wt1 Number of obs = 40 Strata: <one> Number of strata = 1 PSU: devlpmnt Number of PSUs = 2 FPC: M Population size = 100 ------------------------------------------------------------------------------ Ratio | Estimate Std. Err. [95% Conf. Interval] Deff ------------------+----------------------------------------------------------- NVSTNRS/NGE65 | .3432836 .0075924 .2468131 .4397541 .0325067 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.
svymean nge65dv Survey mean estimation pweight: wt1 Number of obs = 40 Strata: <one> Number of strata = 1 PSU: devlpmnt Number of PSUs = 2 FPC: M Population size = 100 ------------------------------------------------------------------------------ Mean | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- nge65dv | 33.5 .3872983 28.57891 38.42109 .0393542 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.
This example is taken from Lehtonen and Pahkinen’s Practical Methods for Design and Analysis of Complex Surveys.
page 83 Table 3.6 Estimates from a one-stage CLU sample (n = 8); the Province’91 population.
input id str clu wt ue91 lab91 1 1 2 4 666 6016 2 1 2 4 528 3818 3 1 2 4 760 5919 4 1 2 4 187 1448 5 1 8 4 129 927 6 1 8 4 128 819 7 1 8 4 331 2543 8 1 8 4 568 4011 end gen fpc = 32 svyset [pweight=wt], fpc(fpc) psu(clu) strata(str) svytotal ue91 svyratio ue91 lab91
svytotal ue91 Survey total estimation pweight: wt Number of obs = 8 Strata: str Number of strata = 1 PSU: clu Number of PSUs = 2 FPC: fpc Population size = 32 ------------------------------------------------------------------------------ Total | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- ue91 | 13188 3814.889 -35284.76 61660.76 2.404443 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights. svyratio ue91 lab91 Survey ratio estimation pweight: wt Number of obs = 8 Strata: str Number of strata = 1 PSU: clu Number of PSUs = 2 FPC: fpc Population size = 32 ------------------------------------------------------------------------------ Ratio | Estimate Std. Err. [95% Conf. Interval] Deff ------------------+----------------------------------------------------------- ue91/lab91 | .129289 .0062953 .0492994 .2092787 1.797293 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.