Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65573

Stitching DHS datasets together by label rather than value

$
0
0
I'm trying to use DHS data for research, and I've run into a bit of a sticking point - the "religion" variable (v130) has different labels for many of the values - for example, for country A, v130==1 has label "Christian", but for country B the label is equal to "Muslim" and for country C the label is "christian". I'd like to stitch together these datasets based on the labels of v130 rather than the values, but I'm not sure how to do this.

Normally, I'd proceed by saying something like the following:

use "folder/country_A"
keep v000 v001 v130
append using "folder/country_B"
keep v000 v001 v130
append using "folder/country_C"
keep v000 v001 v130

Is there any way to do this automatically, or even manually?

Viewing all articles
Browse latest Browse all 65573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>