Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Multilevel modelling: convergence, value of the log odds ratio, and dummy variable issues.


From   liliana <[email protected]>
To   [email protected]
Subject   Re: st: Multilevel modelling: convergence, value of the log odds ratio, and dummy variable issues.
Date   Sat, 9 Nov 2013 03:05:32 -0800 (PST)

Dear Maarten/all users,
Thank you for your fast response. I really appreciate it.
I tried to do what you suggested me and after doing the cross tabulations I
realized that there are some problems with the interactions. There are
really few observations for some interactions. So, what I did is to generate
other variables and interact them with the # instead of creating the
interactions and the dummy variables by myself. 
I have got another problem.
As you might know, the wealth index was generated for the fifth and the
sixth DHS. For the previous DHS, I can find the Wealth Index.dta in the
measure DHS website, but they are not complete. When I merge the WI.dta with
the IndividualRecode.dta I have some missing values. Here attached you can
find the do.file I used for merging the dta files by Tom Pullum from DHS.
I would like to know if you, or you all, can guide me in creating the wealth
index variable for the second, third, and fourth DHS.
It would be great for me if you could do it.
Thank you all. 
Best, 
Liliana

* How to merge wealth data on ETWI41DT onto ETIR41DT
* Tom Pullum, [email protected], March 21, 2013

* First open the WI file and construct id codes for cluster and household 
*  that are compatible with those in the IR file, where they are integers.

use e:\DHS\DHS_data\WI_files\ETWI41FL.dta
describe 
list if _n<=20, table clean

* whhid has 12 characters but we need to figure out how to use them
* which part is cluster id and which part is household id?
 
gen str1 c1=substr(whhid,1,1)
gen str1 c2=substr(whhid,2,1)
gen str1 c3=substr(whhid,3,1)
gen str1 c4=substr(whhid,4,1)
gen str1 c5=substr(whhid,5,1)
gen str1 c6=substr(whhid,6,1)
gen str1 c7=substr(whhid,7,1)
gen str1 c8=substr(whhid,8,1)
gen str1 c9=substr(whhid,9,1)
gen str1 c10=substr(whhid,10,1)
gen str1 c11=substr(whhid,11,1)
gen str1 c12=substr(whhid,12,1)

list c1-c12 if _n==4, table clean

* It appears that cols 1-9 are cluster id and 10-12 are household id.
* Separate the one string into two strings.

drop c1-c12

gen str9 wv001=substr(whhid,1,9)
gen str9 wv002=substr(whhid,10,3)
list whhid wv001 wv002 if _n<=20, table clean

* Now convert those two strings into integers with the same names
*  as in the IR file.
destring wv001, gen(v001)
destring wv002, gen(v002)
drop wwhid wv001 wv002

* This is the "using" file; sort it on the merge fields.
sort v001 v002
save e:\DHS\DHS_data\WI_files\ETWI41FL_temp.dta, replace

* Now open the IR file, sort, merge, confirm, and save.
use e:\DHS\DHS_data\IR_files\ETIR41FL.dta, clear
list v000 v001 v002 v003 if _n<=20, table clean
sort v001 v002
merge using e:\DHS\DHS_data\WI_files\ETWI41FL_temp.dta
tab _merge
drop _merge
list v000 v001 v002 v003 wlthind* if _n<=20, table clean
list v000 v001 v002 v003 wlthind* if _n<=20, table clean nolabel
save e:\DHS\DHS_data\IR_files\ETIR41FL_WI.dta, replace




--
View this message in context: http://statalist.1588530.n2.nabble.com/Re-st-Multilevel-modelling-convergence-value-of-the-log-odds-ratio-and-dummy-variable-issues-tp7580451.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index