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

label values from a "dictionnary"

$
0
0
Hi Statalist

I use Stata 14 on Mac (and more frequently Stata in batch mode from shell)

I have two datasets (examples below)


THE FIRST ONE:
ID CODE1 CODE2
1 10 11
2 12 12
3 13 14
and the SECOND ONE:
CODE EXAM
10 x-ray
11 ct-scan
12 mri
13 surgery
Is there any mean to replace CODE* in the first dataset using the "dictionary" provided by the second one.
I tried merge, update, but it does not work (a posteriori, it was obvious).

Of course, the real number of codes (10,000), the number of observations (30,000) and the number of repeated code (60) preclude me to do that by hand.
Thank you for your welcome help!
Best

Viewing all articles
Browse latest Browse all 72772

Trending Articles



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