What's New in Stata 9: Survey Statistics

* svy commands are set up differently in Stata 9 than in Stata 7 or 8

use http://www.ats.ucla.edu/stat/stata/seminars/svy_stata_intro/oscs1, clear

* Stata 8 svyset
* svyset [pweight=pw], psu(dnum) fpc(fpc)
* svyregress api00 awards meals

* Stata 9 svyset - note that the psu is now listed before the pweigh
svyset dnum [pweight = pw], fpc(fpc) 

svy: regress api00 awards meals

* can use tabulate with only one variable (one-way tables)
svy:  tab yr_rnd

svy: tab yr_rnd both

clear

* Stata 9 handles BRR and jackknife replicate weights.

* use of jackknife replicate weights

set mem 10m
use http://www.ats.ucla.edu/stat/stata/seminars/stata9/nhanes2clean, clear
svyset [pweight = finalwgt], jkrweight(jkw_1 - jkw_62, multiplier(.5)) vce(jackknife)

svy: regress weight height

* deff and meff are now part of the postestimation commands and not given with the standard output

estat effects
estat effects, meff meft

* Stata 9 handles poststratification
* need to supply the poststratification variable and the poststatification weight

* subpop

svy, subpop(rural): mean weight

svy: mean weight, over(sex)

svy: mean weight, over(race sex)

How to cite this page

Report an error on this page or leave a comment

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.