UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS FAQ 
How do I analyze survey data with a stratified random sampling with allocation to strata design?

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
------------------------------------------------------------------------

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California