Dear Stata Forum,
I have a variable for "race" which has 7 different ethnicity coded as 1 - 7, and some negative numbers for missing etc.. I need to transfer the labels (e.g 1 = white) to another variable which is essentially the same (same coding). However I haven't had much success. I tried using labmask but couldn't figure out why the syntax wasn't working. Apologies if this question has already been asked but I couldn't find it in the forum.
To give a bit more context, I have panel data in which ethnicity was obtained in one wave but not subsequent. So one person might have value 1 (white) in year 1998 but -8 (inapplicable) in 1999. I have created a variable which is the maximum value: "by pid: egen race1 = max(race) " and I need this new variable to have the same value labels.
Many thanks,
Euan
I have a variable for "race" which has 7 different ethnicity coded as 1 - 7, and some negative numbers for missing etc.. I need to transfer the labels (e.g 1 = white) to another variable which is essentially the same (same coding). However I haven't had much success. I tried using labmask but couldn't figure out why the syntax wasn't working. Apologies if this question has already been asked but I couldn't find it in the forum.
To give a bit more context, I have panel data in which ethnicity was obtained in one wave but not subsequent. So one person might have value 1 (white) in year 1998 but -8 (inapplicable) in 1999. I have created a variable which is the maximum value: "by pid: egen race1 = max(race) " and I need this new variable to have the same value labels.
Many thanks,
Euan
Comment