wengxyu1030 / DHS-Recode-IV

0 stars 1 forks source link

Egypt2005 : hc70 hc71 #18

Closed robin-wang closed 2 years ago

robin-wang commented 2 years ago

"variables hv001 hv002 hvidx do not uniquely identify observations in the master data"

robin-wang commented 2 years ago

2 variables already exist For instance, you requested that variable hm_hc70 be renamed hc70. hc70 is already an existing variable in the data. The variables you specified that already exist are hc70 and hc71.

robin-wang commented 2 years ago

@wengxyu1030 Pending discussion and resolution For Egypt and Madagascar in Recode - IV, the bugs are different from the merge / uniquely identifying ones in other surveys.

In DHS-Recode-IV.do, around lines 370.

We see two sections of code:

capture confirm variable c_hc70 c_hc71 if _rc == 0 { rename (c_hc70 c_hc71 ) (hc70 hc71 ) }

capture confirm variable hm_hc70 hm_hc71 if _rc == 0 { rename (hm_hc70 hm_hc71 ) (hc70 hc71 ) }

These will rename two sets of variables into hc70 and hc71. However, at least for Egypt and Madagascar, up to this point in programme, both c_hc70/71 and hm_hc70/71 are present; This coexistence therefore creates the following error message.

"2 variables already exist For instance, you requested that variable hm_hc70 be renamed hc70. hc70 is already an existing variable in the data. The variables you specified that already exist are hc70 and hc71."

wengxyu1030 commented 2 years ago

Hi Robin,

Thanks for your question, I can't replicate this warning on my end. The rename should not be conflicting with each other as these are conditional on the data source (signified by the hwlevel in the zsc.dta).

Basically, the existence of c_hc70 c_hc71 and hm_hc70 hm_hc71 is mutually exclusive.

Regards, Aline