Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[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)" <>
To   "" <>
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:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index