|
|
|
||||
|
|
|||||
The examples below use Stata 7 or 8. If you are using Stata version 9, please see this page. The svyset commands differ between Stata version 7 and Stata version 8. The Stata 8 commands are shown below, while the Stata 7 commands are shown in the comments in the code.Stratified simple random sampling
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.
input id str clu wt ue91 lab91 fpc 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 end * Stata 8 command svyset [pweight=wt], psu(clu) fpc(fpc) strata(str) * Stata 7 commands * svyset psu clu * svyset fpc fpc * svyset strata str * svyset pweight wt svytotal ue91 svyratio ue91 lab91
Survey total estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 2
PSU: clu Number of PSUs = 8
FPC: fpc Population size = 32
------------------------------------------------------------------------------
Total | Estimate Std. Err. [95% Conf. Interval] Deff
---------+--------------------------------------------------------------------
ue91 | 15210.5 4279.452 4739.059 25681.94 .20649
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
Weights must represent population totals for deff to be correct when
using an FPC. Note: deft is invariant to the scale of weights.
Survey ratio estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 2
PSU: clu Number of PSUs = 8
FPC: fpc Population size = 32
------------------------------------------------------------------------------
Ratio | Estimate Std. Err. [95% Conf. Interval] Deff
------------------+-----------------------------------------------------------
ue91/lab91 | .1277788 .0031736 .1200134 .1355442 .3803409
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
Weights must represent population totals for deff to be correct when
using an FPC. Note: deft is invariant to the scale of weights.
page 83 table 3.6 Estimates from a one-stage CLU sample (n = 8); the Province'91 population.
input id str clu wt ue91 lab91 1 1 2 4 666 6016 2 1 2 4 528 3818 3 1 2 4 760 5919 4 1 2 4 187 1448 5 1 8 4 129 927 6 1 8 4 128 819 7 1 8 4 331 2543 8 1 8 4 568 4011 end
gen fpc = 32 * Stata 8 command svyset [pweight=wt], strata(str) psu(clu) * Stata 7 commands * svyset psu clu * svyset strata str * svyset pweight wt svytotal ue91 svyratio ue91 lab91
Survey total estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 1
PSU: clu Number of PSUs = 2
Population size = 32
------------------------------------------------------------------------------
Total | Estimate Std. Err. [95% Conf. Interval] Deff
---------+--------------------------------------------------------------------
ue91 | 13188 3940 -36874.45 63250.45 1.923554
------------------------------------------------------------------------------
Survey ratio estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 1
PSU: clu Number of PSUs = 2
Population size = 32
------------------------------------------------------------------------------
Ratio | Estimate Std. Err. [95% Conf. Interval] Deff
------------------+-----------------------------------------------------------
ue91/lab91 | .129289 .0065018 .0466761 .211902 1.437834
------------------------------------------------------------------------------
Two-stage cluster sampling
page 88 table 3.8 Estimates from a two-stage CLU sample (n = 8); the Province'91 population.
input id str clu wt ue91 lab91 fpc1 fpc2 1 1 2 4 760 5919 8 4 2 1 2 4 187 1448 8 4 3 1 3 4 767 5823 8 4 4 1 3 4 142 675 8 4 5 1 4 4 94 831 8 4 6 1 4 4 98 545 8 4 7 1 7 4 262 1737 8 4 8 1 7 4 219 1330 8 4 end * Stata 8 command svyset [pweight=wt], psu(clu) fpc(fpc2) strata(str) * Stata 7 commands * svyset psu clu * svyset fpc fpc2 * svyset strata str * svyset pweight wt svytotal ue91 svyratio ue91 lab91
Survey total estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 1
PSU: clu Number of PSUs = 4
FPC: fpc2 Population size = 32
------------------------------------------------------------------------------
Total | Estimate Std. Err. [95% Conf. Interval] Deff
---------+--------------------------------------------------------------------
ue91 | 10116 0 10116 10116 .
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
Weights must represent population totals for deff to be correct when
using an FPC. Note: deft is invariant to the scale of weights.
Survey ratio estimation
pweight: wt Number of obs = 8
Strata: str Number of strata = 1
PSU: clu Number of PSUs = 4
FPC: fpc2 Population size = 32
------------------------------------------------------------------------------
Ratio | Estimate Std. Err. [95% Conf. Interval] Deff
------------------+-----------------------------------------------------------
ue91/lab91 | .1381363 0 .1381363 .1381363 .
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
Weights must represent population totals for deff to be correct when
using an FPC. Note: deft is invariant to the scale of weights.
Post-stratified weights
page 97 Table 3.10 A simple random sample drawn without replacement from the Province'91 population with poststratum weights.
NOTE: We were unable to reproduce this table.
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 * Stata 8 command svyset [pweight=wt], fpc(fpc) psu(clu) * Stata 7 commands * svyset fpc fpc * svyset pweight wt * svyset psu clu svyratio ue91 hou85
Survey ratio estimation
pweight: wt Number of obs = 8
Strata: <one> Number of strata = 1
PSU: clu Number of PSUs = 8
FPC: fpc Population size = 32
------------------------------------------------------------------------------
Ratio | Estimate Std. Err. [95% Conf. Interval] Deff
------------------+-----------------------------------------------------------
ue91/hou85 | .1602891 .0055256 .1472232 .173355 1
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
Weights must represent population totals for deff to be correct when
using an FPC. Note: deft is invariant to the scale of weights.
pages 106-107 Regression estimator
This example provides the numbers necessary to use the formula in the middle of page 106. The svyreg is run to get the coefficient of hou85 and the svytotal is run to get the estimated total of hou85. These numbers are used in the formula and the result (15312) is shown in the last line of Table 3.14 on page 107.
svyreg ue91 hou85
Survey linear regression
pweight: wt Number of obs = 8
Strata: <one> Number of strata = 1
PSU: clu Number of PSUs = 8
FPC: fpc Population size = 32
F( 1, 7) = 44949.18
Prob > F = 0.0000
R-squared = 0.9982
------------------------------------------------------------------------------
ue91 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
hou85 | .1520142 .000717 212.01 0.000 .1503188 .1537097
_cons | 42.65468 20.54033 2.08 0.076 -5.915492 91.22485
------------------------------------------------------------------------------
Finite population correction (FPC) assumes simple random sampling without
replacement of PSUs within each stratum with no subsampling within PSUs.
svytotal hou85 Survey total estimation pweight: wt Number of obs = 8 Strata: <one> Number of strata = 1 PSU: clu Number of PSUs = 8 FPC: fpc Population size = 32 ------------------------------------------------------------------------------ Total | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- hou85 | 164952 87298.57 -41476.32 371380.3 1 ------------------------------------------------------------------------------ Finite population correction (FPC) assumes simple random sampling without replacement of PSUs within each stratum with no subsampling within PSUs. Weights must represent population totals for deff to be correct when using an FPC. Note: deft is invariant to the scale of weights.
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