Hi all,
I am working on a large dataset A (10,000 observations). I want to match the Gender (variable Sex) and the Occupation code (variable SOC2010B) from dataset A with a small dataset B (39 observations), which contains Gender, Occupation Code and Estimated Weekly Earnings. My ideal outcome is that Dataset A will have one more variable of Estimated Weekly Earnings, which is retrieved from dataset B. It would be very easy if I can do Vlookup on Excel.
Below is the sample dataex of Dataset A. Dataset B is similar, with an addition of Estimated Weekly Earnings.
Could anyone share me the code for this kind of Vlookup function? I would very much appreciate!!
Thank you so much!!
I am working on a large dataset A (10,000 observations). I want to match the Gender (variable Sex) and the Occupation code (variable SOC2010B) from dataset A with a small dataset B (39 observations), which contains Gender, Occupation Code and Estimated Weekly Earnings. My ideal outcome is that Dataset A will have one more variable of Estimated Weekly Earnings, which is retrieved from dataset B. It would be very easy if I can do Vlookup on Excel.
Below is the sample dataex of Dataset A. Dataset B is similar, with an addition of Estimated Weekly Earnings.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(Sex SOC2010B) 2 61 1 82 2 22 1 92 1 82 1 35 1 53 1 52 2 71 1 11 1 53
Thank you so much!!
Comment