Statalist


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

Re: st: How to calculate mortality ratios


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: How to calculate mortality ratios
Date   Tue, 4 Dec 2007 10:22:26 -0500

Gaby, you didn't answer some of my questions, so I cannot be sure this is what you need. But here are the steps as I see them. Substitute your own variable names. I assume that there is a unique person_id, as well as hhid on which to merge the data.

-merge- the two data sets by hhid and person id (look up -merge- and make sure you understand why -joinby- will not work)
The command will look like:
// first do file--create the new data set
use data person
sort hhid person_id
save, replace

use data deaths
sort hhid person_id

merge hhid person_id, using person
tab _merge // look up -merge- to see how to interpret this
// there should be no observations with _merge=1, as these are deaths not matched to the person data set
// Assuming 'cause' is a variable which codes cause of death: cause = 1, 2, 3..
// it is missing for those who have not die
replace cause=0 if _merge==2 // everybody who did not match a death

svyset psu [pweight=yourweight], stratum(yourstrata)

save new, replace //Save the data


// second do file Once you have the new data set up, run your survey commands in a separate do file
use new, clear
svy: prop cause, over(region) //will also give the proportion alive
svy: prop cause, over(region gender)

Good luck!

-Steve

On Dec 3, 2007, at 6:02 AM, Ana Gabriela Guerrero Serdan wrote:


Dear Steve,

I have two datasets.

1) One  dataset has individual information for each
individual in the household (individual
characteristics) and also hh id, regions,pweights,
psu, etc..

2) However, deaths are in a separate dataset which
includes only those individuals that died, it
specifies: household id, region, gender, pweights,
psu,  and the causes of death.

I want to calculate mortality ratios for each of the
causes of death (e.g. disease, traffic accident) per
region.

So basically the hh id is the variable to know which
individuals died in each household.

So I think I need to first joinby both datasets, then
calculate the population estimates per region and then
mortality ratios?

thanks,
Gaby
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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