UCLA Academic Technology Services HomeServicesClassesContactJobs

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

The examples below use Stata 9.  If you are using Stata versions 7 or 8, please see this page.

NOTE:  If you want to see the design effect or the misspecification effect, use estat effects after the command.

This example is taken from Levy and Lemeshow's Sampling of Populations.
page 168 stratified random sampling
use http://www.ats.ucla.edu/stat/books/sop/jacktwn2.dta, clear
svyset [pweight=sampwt], strata(stratum) fpc(npop)

      pweight: sampwt
          VCE: linearized
     Strata 1: stratum
         SU 1: <observations>
        FPC 1: npop

svy: total twin
(running total on estimation sample)

Survey: Total estimation

Number of strata =      18          Number of obs    =     831
Number of PSUs   =     831          Population size  =  256998
                                    Design df        =     813

--------------------------------------------------------------
             |             Linearized
             |      Total   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
        twin |    26055.4   3791.044      18614.01    33496.78
--------------------------------------------------------------
svy: total twin, over(quart1)
(running total on estimation sample)

Survey: Total estimation

Number of strata =      18          Number of obs    =     831
Number of PSUs   =     831          Population size  =  256998
                                    Design df        =     813

            1: quart1 = 1
            2: quart1 = 2
            3: quart1 = 3

--------------------------------------------------------------
             |             Linearized
        Over |      Total   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
twin         |
           1 |    19183.8   2661.629      13959.33    24408.28
           2 |   6737.907   2696.605      1444.778    12031.04
           3 |    133.687   126.7443     -115.0976    382.4715
--------------------------------------------------------------

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.