The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Merging HR variables with KR file
Merging HR variables with KR file [message #10951] Wed, 12 October 2016 04:46 Go to next message
shayankhan is currently offline  shayankhan
Messages: 16
Registered: September 2016
Location: Karachi, Pakistan
Member
Hi,

I want to get some HR variables in the KR file and I am using the following code for this. Can you please verify if this code is right. Also, am I right to use the women's sample weights on these HR variables after they have been merged into the KR file as my analysis is on children.?

use "PKHR61FL.dta", clear
rename hv001 v001
rename hv002 v002
keep v001 v002 hv009 hv216 hv242
save "merging.dta", replace

use "testing.dta", clear
mmerge v001 v002 using merging, type(n:1)
keep if _merge==3
drop _merge
erase merging.dta


Thanks.
Re: Merging HR variables with KR file [message #10956 is a reply to message #10951] Wed, 12 October 2016 08:15 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3017
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

Quote:
This looks ok to me, except that in one place "mmerge" should of course be "merge". Sometimes, when I want household variables, I will use the PR file, rather than the HR file, with "keep if hvidx==1" to get just one record per household. But what you have is fine.

[Updated on: Wed, 12 October 2016 08:15]

Report message to a moderator

Re: Merging HR variables with KR file [message #10958 is a reply to message #10956] Wed, 12 October 2016 13:56 Go to previous messageGo to next message
shayankhan is currently offline  shayankhan
Messages: 16
Registered: September 2016
Location: Karachi, Pakistan
Member
Thanks again for the swift response. You are truly a gem.
Re: Merging HR variables with KR file [message #10964 is a reply to message #10958] Thu, 13 October 2016 07:33 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3017
Registered: February 2013
Senior Member
You are welcome, and I will let Tom know.

Best - Bridgette

[Updated on: Thu, 13 October 2016 07:33]

Report message to a moderator

Re: Merging HR variables with KR file [message #10969 is a reply to message #10964] Thu, 13 October 2016 12:12 Go to previous messageGo to next message
shayankhan is currently offline  shayankhan
Messages: 16
Registered: September 2016
Location: Karachi, Pakistan
Member
Can you please help me out in this matter as well?

I am using a standard DHS-VI survey dataset for Pakistan 2012-13. It is a survey cross-section data with sample weights. My response variable is a binary variable indicating whether a child has ARI or not. On the right hand side I have some covariates. I want to control for heterogeneity across districts but employing the fixed effects model by using districts as my group variable. Now, there are two ways that I am familiar with that I can use to this.

1- svy:logistic y x1 x2 x3 i.dist
2- xtlogit y x1 x2 x3, fe or (when I use weights here it gives error 'weights should be same across all groups)

I want to know which approach would be the right way to do this as I know fixed effects are usually done on panel data. I was told that if I use the 1st approach then I might face 'incremental parameter problem'. Please help.
Re: Merging HR variables with KR file [message #10976 is a reply to message #10969] Fri, 14 October 2016 07:57 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3017
Registered: February 2013
Senior Member
Following is a response from Senior DHS Specialist, Tom Pullum:

Quote:
This is outside the range of questions that DHS staff will respond to. I hope other forum users will offer suggestions.

Previous Topic: Survival Status in Stata
Next Topic: Education level in single years in CR
Goto Forum:
  


Current Time: Thu Mar 28 22:36:53 Coordinated Universal Time 2024