Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: create new variable from weighted counts?
From
"Rossen, Lauren M. (CDC/OSELS/NCHS)" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: create new variable from weighted counts?
Date
Tue, 16 Apr 2013 17:57:04 +0000
Hello Stata-listers,
I have a data set on all infant deaths in the US, and I am
trying to create county-level summaries of several variables.
For example, counts of deaths by county for white infants,
black infants, etc. Normally, this would be straightforward
to do with something like:
bysort county: egen dths_white=total(race==1)
bysort county: egen dths_black=total(race==2)
However, the data are weighted because a small # of
deaths are not included in the file, so there are something
like importance weights to make sure that the totals sum
up to the actual total # of reported deaths in the US.
I say importance weights because there is no sampling,
and the weights are not integers, they range from 1 to 1.2.
My question is: is there a way to generate new variables
representing county-level totals incorporating the
weights? I apologize for the rudimentary question,
but I have tried searching through the archives and
documentation and had no luck finding a solution.
Thanks so much,
Lauren Rossen, PhD, MS
Postdoctoral Research Fellow
Centers for Disease Control and Prevention
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/