This example is taken from Levy and Lemeshow’s Sampling of Populations.
page 350 cluster sampling with unequal probabilities: probability proportional to size
sampling
This example uses the hospslect
data set.
proc surveymeans data = hospslct n = 4672 sum mean; weight wstar; cluster drawing; var lifethrt dxdead; run;The SURVEYMEANS Procedure Data Summary Number of Clusters 5 Number of Observations 50 Sum of Weights 50056 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ LIFETHRT 0.120000 0.019989 6006.720000 1000.584155 DXDEAD 0.040000 0.024482 2002.240000 1225.460312 ------------------------------------------------------------------------
Page 353 cluster sampling with unequal probabilities: probability proportional to size sampling
data hspslct2; set hospslct; /*n is 50*/ /*N_i is admiss*/ /* X is 7087, the total number of life-threating conditions across all the hospitals*/ /*X_i is tl, the total number of life-threating conditions for each hospital*/ if hospno = 2 then tl = 785; if hospno = 5 then tl = 3404; if hospno = 9 then tl = 778; w2star = (admiss/50)*(7087/tl); run;proc surveymeans data = hspslct2 n = 4672 mean sum; weight w2star; cluster drawing; var lifethrt dxdead; run;The SURVEYMEANS Procedure Data Summary Number of Clusters 5 Number of Observations 50 Sum of Weights 51344.9973 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ LIFETHRT 0.121904 0.021404 6259.175814 1276.638273 DXDEAD 0.034287 0.022991 1760.471466 1078.465840 ------------------------------------------------------------------------