The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Child Discipline - Myanmar DHS 2015-2016 (Unit of analysis and files to be used )
Re: Child Discipline - Myanmar DHS 2015-2016 [message #22641 is a reply to message #22594] Thu, 15 April 2021 03:55 Go to previous messageGo to previous message
Nyan Linn is currently offline  Nyan Linn
Messages: 8
Registered: December 2020
Member
Dear Sir,
I would like to add the variables "caregiver's age", "caregiver's sex" and "education level of caregiver" for the child asked for child disciplined module. But, i have difficulties to drop and keep the observations after adding those variables. I am not clear about sh11a, hv102 and sh148==hvidx.

*****create a file of children including caregiver's information
****1st step - construct KHRtemp.dta file
keep hhid hv009 hvidx hv024 hv000 hv025 idxh4 hv102 hv001 hv201 hv002 hv204 sh11a hv235 hv003 hv205 hv225 hv238 hv004 hv206 hv005 hv213 hv010 hv214 hv011 hv215 hv012 hv217 sh149 hv013 hv218 hv020 hv219 hv021 hv220 hv101 hv022 hv226 hv023 hv241 hv027 hv242 hv028 hv270 hv044 sh148 hv104 hv105 sh148f sh150 sh151 sh154 sh153 sh157 sh152 sh155 sh156 sh159 sh158 sh160 sh161 hv106 hv109 hv111 hv112 hv113 hv114
save KHRtemp.dta, replace

****2nd step - Construct a file of children with sh149 - rename child's information and create caregiver variable (kchildtemp.dta)
keep if sh11a==1
keep if hv102==1
keep if sh148==hvidx
tab sh148
rename sh149 line_caregiver
rename hv104 hv104_child
rename hv105 hv105_child
rename hv106 hv106_child
gen caregiver=.
replace caregiver=0 if line_caregiver==0
replace caregiver=1 if line_caregiver==hv112
replace caregiver=2 if line_caregiver==hv114
replace caregiver=3 if caregiver==. & line_caregiver>0
label define cg 0 "Not in hh" 1 "Mother" 2 "Father" 3 "Other hh member"
label values caregiver cg
sort hv001 hv002 line_caregiver
save Kchildtemp.dta, replace

**** 3rd step - rename caregiver's information on KHRtemp.dta file and merge with Kchildtemp.dta file
use KHRtemp.dta, clear
rename hvidx line_caregiver
rename hv104 hv104_caregiver
rename hv105 hv105_caregiver
rename hv106 hv106_caregiver
sort hv001 hv002 line_caregiver
merge hv001 hv002 line_caregiver using Kchildtemp.dta
tab _merge
* _merge is 2 for children whose caregiver is not in the household
* _merge is 3 for children who are matched with caregiver

**** 4th step - drop unnecessary observations.
**** here, I have difficulties to drop unnecessary observations. I couldn't get the observations correctly. Could you please check it for me? After adding the above variables, how to make the dataset to be appropriate for data analysis? I would like to find the factors affecting commitment of child discipline. Which people should be for my outcome variables?

keep if _merge==2 | _merge==3

tab sh11a
keep if sh11a==1
keep if hv102==1
keep if sh148==hvidx
tab sh11a

drop _merge
tab hv105_caregiver
tab sh148
save KHRtemp.dta, replace
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ANC
Next Topic: Mothers Education on children's health
Goto Forum:
  


Current Time: Fri Jan 3 04:52:34 Coordinated Universal Time 2025