Re: Birth order and Antenatal Care NFHS-5 India [message #27914 is a reply to message #27905] |
Sat, 21 October 2023 11:39 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to previous message](/theme/default/images/down.png) |
Rupon
Messages: 16 Registered: October 2023
|
Member |
|
|
Thank you so much. I tried to run these codes.However, as I had never done 'loops' before, I could not understand the same. Nonetheless, I got some clues from the command and I checked the data. I ran the following codes thereafter. Kindly let me know if these are correct. Results did match with the report (number of live births, for each category of adjusted birth order from KR file)
[code][/*birth order generation, adjusting for twins/triplets*/
/*use KR Children Recode file */
/*variables:
birth_order_bord "birth order number"
b0= "child is twin", 0= single, 1 = 1st of multiple, 2 = 2nd of multiple, 3 = 3rd of multiple
weight = v005/1000000*/
/*generating twin/triplet adjusted birth order variable */
gen birth_order_bord=bord
gen border= birth_order_bord if b0==0
replace border= birth_order_bord if b0==1
replace border= birth_order_bord-1 if b0==2
replace border= birth_order_bord-2 if b0==3
replace border= birth_order_bord-3 if b0==4
/*categorising adjusted birth order */
gen bord_cat =1 if border==1
replace bord_cat=2 if border>1
replace bord_cat = 3 if border>3
replace bord_cat = 4 if border>=6
/*Tabulation */
tab bord_cat[iw=weight] if midx==1 /*most recent birth */
tab bord_cat[iw=weight]]
Thank you
|
|
|