This example is taken from Lehtonen and Pahkinen’s Practical Methods for Design and Analysis of Complex Surveys.
page 60 Table 2.8 Estimates under a PPSSYS design (n = 8); the Province’91 population. NOTE: The certainty PSU (the first line of the data) was entered twice and the weight was changed from 1 to .5 for each observation. This is necessary because you need to have two observations in each strata.
data page60; input id str clu wt hou85 ue91 lab91; fpc = 32; datalines; 1 2 1 0.5 26881 4123 33786 2 2 1 0.5 26881 4123 33786 3 1 10 1.004 9230 1623 13727 4 1 4 1.893 4896 760 5919 5 1 7 2.173 4264 767 5823 6 1 32 2.971 3119 568 4011 7 1 26 4.762 1946 331 2543 8 1 18 6.335 1463 187 1448 9 1 13 13.730 675 129 927 ; run; proc sort data = page60; by str; run;proc surveymeans data = page60 sum std; weight wt; strata str; cluster clu; var ue91; run;The SURVEYMEANS Procedure Data Summary Number of Strata 2 Number of Clusters 8 Number of Observations 9 Sum of Weights 33.868 Statistics Variable Sum Std Dev ---------------------------------------- ue91 15077 521.121241 ----------------------------------------