Merging HR variables with KR file [message #10951] |
Wed, 12 October 2016 04:46 |
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 |
Bridgette-DHS
Messages: 3230 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
|
|
|
|
|
|
|