This example is taken from Levy and Lemeshow’s Sampling of Populations.
page 167 stratified random sampling: allocation of sample to strata
This example uses the
jacktwn
data set.
proc surveymeans data = jacktwn n = secondjt sum mean; strata stratum; weight sampwt; var twin; run;The SURVEYMEANS Procedure Data Summary Number of Strata 18 Number of Observations 831 Sum of Weights 256998 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ TWIN 0.101384 0.014757 26055 3792.630892 ------------------------------------------------------------------------proc surveymeans data = jacktwn n = secondjt mean sum; strata stratum; weight sampwt; by quart1; var twin; run;QUART1=1 The SURVEYMEANS Procedure Data Summary Number of Strata 6 Number of Observations 329 Sum of Weights 63937 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ TWIN 0.300042 0.041655 19184 2663.269969 ------------------------------------------------------------------------ QUART1=2 The SURVEYMEANS Procedure Data Summary Number of Strata 6 Number of Observations 369 Sum of Weights 127874 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ TWIN 0.052692 0.021093 6737.906748 2697.198135 ------------------------------------------------------------------------ QUART1=3 The SURVEYMEANS Procedure Data Summary Number of Strata 6 Number of Observations 133 Sum of Weights 65187 Statistics Std Error Variable Mean of Mean Sum Std Dev ------------------------------------------------------------------------ TWIN 0.002051 0.001950 133.686957 127.139200 ------------------------------------------------------------------------