Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: how to set marginals for raking in survwgt


From   "Long, Sharon" <SLong@ui.urban.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: how to set marginals for raking in survwgt
Date   Wed, 14 Feb 2007 10:43:01 -0500

Thank you, Steve! 

 

You set up a "tot" variable for each characteristic
For example:


gen race_tot=2408 if race==1
repl race_tot=159 if race==2
etc.

gender 1 2
gen gender_tot=1463 if gender==1
replace gender_tot=1547 if gender==2


gen age_tot =485 if age==1
replace age_tot=518 if age==2
etc.

THEN
in the -survwgt- statement, use totvars(race_tot gender_tot age_tot)


survwgt rake preweigh, by(race gender age) totvars(race_tot 
gender_tot age_tot) generate(newwt)



Steve


<<winmail.dat>>




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index