UCLA Academic Technology Services HomeServicesClassesContactJobs

SUDAAN FAQ 
How do I analyze survey data with a stratified random sampling design?

This example is taken from Levy and Lemeshow's Sampling of Populations.
page 138 stratification and stratified random sampling
This example uses the hospsamp data set.
proc descript data = hospsamp filetype = sas design = wor totals;
  nest oblevel;
  weight weighta;
  totcnt tothosp;
  var births;
  subgroup oblevel;
  levels 3;
  setenv colwidth = 20;
  setenv decwidth = 3;
run;
Number of observations read    :     15    Weighted count :      158
Denominator degrees of freedom :     12

Variance Estimation Method: Taylor Series (WOR)
by: Variable, OBLEVEL.

------------------------------------------------------------------------------------
|                 |                  |
| Variable        |                  | OBLEVEL
|                 |                  | Total                | 1                    |
------------------------------------------------------------------------------------
|                 |                  |                      |                      |
| BIRTHS          | Sample Size      |               15.000 |                4.000 |
|                 | Weighted Size    |              158.000 |               42.000 |
|                 | Total            |           183982.904 |            14931.000 |
|                 | SE Total         |            34014.329 |             2669.857 |
|                 | Mean             |             1164.449 |              355.500 |
|                 | SE Mean          |              215.281 |               63.568 |
------------------------------------------------------------------------------------

Variance Estimation Method: Taylor Series (WOR)
by: Variable, OBLEVEL.

------------------------------------------------------------------------------------
|                 |                  |
| Variable        |                  | OBLEVEL
|                 |                  | 2                    | 3                    |
------------------------------------------------------------------------------------
|                 |                  |                      |                      |
| BIRTHS          | Sample Size      |                5.000 |                6.000 |
|                 | Weighted Size    |               99.000 |               17.000 |
|                 | Total            |           117116.928 |            51934.977 |
|                 | SE Total         |            33067.664 |             7508.399 |
|                 | Mean             |             1183.000 |             3055.000 |
|                 | SE Mean          |              334.017 |              441.671 |
------------------------------------------------------------------------------------
This example is taken from Lehtonen and Pahkinen's Practical Methods for Design and Analysis of Complex Surveys.
page 74 Table 3.3  Estimates from an optimally allocated stratified simple random sample (n = 8); the Province'91 population. 
NOTE:  In this data set, the fpc changes with the strata.  This is different from all of the previous examples.
data page74;
  input id str clu wt ue91 lab91 fpc;
  cards;
  1 1 1 1.75 4123 33786 7
  2 1 2 1.75 666 6016 7
  3 1 4 1.75 760 5919 7
  4 1 6 1.75 457 3022 7
  5 2 21 6.25 61 573 25
  6 2 25 6.25 262 1737 25
  7 2 26 6.25 331 2543 25
  8 2 27 6.25 98 545 25
  ;
run;

proc descript data = page74 filetype = sas design = wor deft4 totals;
  weight wt;
  nest str;
  var ue91;
  totcnt fpc;
run;
Number of observations read    :      8    Weighted count :       32
Denominator degrees of freedom :      6
Variance Estimation Method: Taylor Series (WOR)
by: Variable, One.

-----------------------------------------------------
|                 |                  |
| Variable        |                  | One
|                 |                  | 1            |
-----------------------------------------------------
|                 |                  |              |
| UE91            | Sample Size      |            8 |
|                 | Weighted Size    |        32.00 |
|                 | Total            |     15210.50 |
|                 | SE Total         |      4279.45 |
|                 | Mean             |       475.33 |
|                 | SE Mean          |       133.73 |
|                 | DEFF Mean #4     |         0.15 |
|                 | DEFF Total #4    |         0.15 |
-----------------------------------------------------
proc ratio data = page74 filetype = sas design = strwor;
  weight wt;
  nest str;
  totcnt fpc;
  numer ue91;
  denom lab91;
run;
Number of observations read    :      8    Weighted count :       32
Denominator degrees of freedom :      6
Variance Estimation Method: Taylor Series (STRWOR)
by: Variable, One.

---------------------------------------------------
|                 |                  |
| Variable        |                  | One
|                 |                  | 1          |
---------------------------------------------------
|                 |                  |            |
| UE91/LAB91      | Sample Size      |          8 |
|                 | Weighted Size    |      32.00 |
|                 | Weighted X-Sum   |  119037.75 |
|                 | Weighted Y-Sum   |   15210.50 |
|                 | Ratio Est.       |       0.13 |
|                 | SE Ratio         |       0.00 |
---------------------------------------------------
proc descript data = page74 filetype = sas design = strwor;
  weight wt;
  nest str;
  var ue91;
  totcnt fpc;
  percentile / median;
run;
Cannot extrapolate to compute confidence limit for 50.00th percentile.
Generating a missing value.

Number of observations read    :      8    Weighted count :       32
Denominator degrees of freedom :      6
Variance Estimation Method: Taylor Series (WOR)
by: Variable, One, Percentiles.

for: Variable = UE91.

-----------------------------------------------------------------------------------
One                    Sample     Weighted                  Lower 95%    Upper 95%
   Percentiles         Size       Size           Quantile   Limit        Limit
-----------------------------------------------------------------------------------
1
    50.00                     8        32.00       189.84          .         300.36
-----------------------------------------------------------------------------------
---------------------------------
One                    SE
   Percentiles         Quantile
---------------------------------
1
    50.00                     .
---------------------------------

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.