The examples below use Stata 9. If you are using Stata versions 7 or 8, please see this page.
NOTE: If you want to see the design effect or the misspecification effect, use estat effects after the command.
This example is taken from Levy and Lemeshow’s Sampling of Populations.
page 351 cluster sampling with unequal probabilities (probability proportional to size sampling)
use https://stats.idre.ucla.edu/stat/books/sop/hospslct.dta, clear
svyset drawing [pweight=wstar] pweight: wstar VCE: linearized Strata 1: <one> SU 1: drawing FPC 1: <zero> svy: total lifethrt dxdead (running total on estimation sample) Survey: Total estimation Number of strata = 1 Number of obs = 50 Number of PSUs = 5 Population size = 50056 Design df = 4 -------------------------------------------------------------- | Linearized | Total Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ lifethrt | 6006.72 1001.12 3227.165 8786.275 dxdead | 2002.24 1226.117 -1402.005 5406.485 -------------------------------------------------------------- svy: ratio dxdead lifethrt (running ratio on estimation sample) Survey: Ratio estimation Number of strata = 1 Number of obs = 50 Number of PSUs = 5 Population size = 50056 Design df = 4 _ratio_1: dxdead/lifethrt -------------------------------------------------------------- | Linearized | Ratio Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ _ratio_1 | .3333333 .2324056 -.311928 .9785946 --------------------------------------------------------------