UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Stata FAQ
How can I do ratio estimation with survey data?

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 200 ratio estimation under simple random sampling
use http://www.ats.ucla.edu/stat/books/sop/tab7pt1.dta, clear
svyset [pweight=wt1], fpc(totcnt)

      pweight: wt1
          VCE: linearized
     Strata 1: <one>
         SU 1: <observations>
        FPC 1: totcnt

svy: ratio pharmexp/totmedex
(running ratio on estimation sample)

Survey: Ratio estimation

Number of strata =       1          Number of obs    =       7
Number of PSUs   =       7          Population size  =       8
                                    Design df        =       6

     _ratio_1: pharmexp/totmedex

--------------------------------------------------------------
             |             Linearized
             |      Ratio   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
    _ratio_1 |   .3191489   .0040067       .309345    .3289529
--------------------------------------------------------------
This example is taken from Lehtonen and Pahkinen's Practical Methods for Design and Analysis of Complex Surveys.

page 102 Table 3.12  A simple random sample drawn without replacement from the Province'91 population prepared for ratio estimation.

input id str clu wt ue91 hou85 gwt adjwt smplrat
1 1 1 4 4123 26881 .5562 2.2248 .25
2 1 4 4 760 4896 .5562 2.2248 .25
3 1 5 4 721 3730 .5562 2.2248 .25
4 1 15 4 142 556 .5562 2.2248 .25
5 1 18 4 187 1463 .5562 2.2248 .25
6 1 26 4 331 1946 .5562 2.2248 .25
7 1 30 4 127 834 .5562 2.2248 .25
8 1 31 4 219 932 .5562 2.2248 .25
end
gen fpc = 32
svyset clu [pweight=wt], fpc(fpc)

      pweight: wt
          VCE: linearized
     Strata 1: <one>
         SU 1: clu
        FPC 1: fpc

svy: ratio ue91 hou85
(running ratio on estimation sample)

Survey: Ratio estimation

Number of strata =       1          Number of obs    =       8
Number of PSUs   =       8          Population size  =      32
                                    Design df        =       7

     _ratio_1: ue91/hou85

--------------------------------------------------------------
             |             Linearized
             |      Ratio   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
    _ratio_1 |   .1602891   .0055256      .1472232     .173355
--------------------------------------------------------------

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.