HONDURAS 2011-2 [message #10210] |
Fri, 08 July 2016 15:58 ![Go to next message Go to next message](/theme/default/images/down.png) |
m.lopez
Messages: 1 Registered: July 2016 Location: London
|
Member |
|
|
Hi!
I am using the last DHS in honduras, I am trying to create the outcome variable for my analysis (stillbirth) in STATA. The only way to obtain this is by merging v228 (ever had a pregnancy loss or stillbirth)and months of gestation at pregnancy loss (v233). Among those who said yes to this question (v228), I need to select only the ones with a pregnancy loss of over 4 months of gestation (I can take this info from the variable v233). Therefore I need to get a new variable that includes those "yes" pregnancy loss from v228 but restricted to those with > 4 months (from v233), compared to those who said "no" to v228 or pregnancy loss. What is the right way to merge these two variables?
Many thanks
|
|
|
Re: HONDURAS 2011-2 [message #10236 is a reply to message #10210] |
Tue, 12 July 2016 11:04 ![Go to previous message Go to previous message](/theme/default/images/up.png) |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Stata Specialist, Tom Pullum:
The term "merge" refers to matching two files, case by case. What you want to do is a construction of a new variable, within a single file, often called a "recode".
You start with a command such as "tab v233 v228, m". You then decide how do classify the cases in this table. Here is one possibility:
gen sb=0
replace sb=1 if v228==1 & v233>4 & v233<.
label variable sb "likely stillbirth"
tab sb
Here the "0" value includes all the women who (you believe) did not have a stillbirth, including women who never had any pregnancies at all. You may want to modify this construction.
There are many variations on the recode procedure. You can find out more with "help gen" and "help recode".
|
|
|