DM 'LOG;CLEAR;OUT;CLEAR'; OPTIONS NODATE NONUMBER NOCENTER PS=54 LS=70; ********************************************************; *** Cluster sample analysis for equal-sized clusters ***; ********************************************************; DATA cluster2; M0 = 400; * number of secondary sampling units (SSUs) in population; n = 10; * number of primary sampling units (PSUs) sampled; m = 4; * number of SSUs in a PSU; wgt = M0/(n*m); DO psu = 1 to n; DO ssu = 1 to m; INPUT y @@; OUTPUT; END; END; DATALINES; 20 15 25 21 31 31 37 37 19 24 17 24 33 25 31 34 32 32 37 38 29 38 40 38 41 44 49 41 34 39 33 34 50 45 48 50 49 44 52 52 ; *** TOTAL = number of PSUs in the population ***; PROC SURVEYMEANS DATA=cluster2 TOTAL=100 MEAN CLM SUM CLSUM; VAR y; CLUSTER psu; WEIGHT wgt; TITLE 'One-Stage Cluster Sample from Figure 8b'; RUN;