I currently am working to merge two data sets. They both have unique variable names except FamilyID which I'm using to match the data on. My two data sets are a parents data set and child data set that I wish to merge. I have successfully merged them but the value labels are wrong for the merged data set because the value label names are the same between the two data sets, but they indicate different values between them. For example, in parents data set the value label "labels8" hold information for race 1 "Black" 2 "Hispanic" etc and "labels8" in the child data is gender identity 1 "Male" 2 "Female" etc. when I merge the two data sets the value label for the child takes on the value label for the parents "labels8" since it holds the same name.
I would like to rename all my value labels in one of my data sets to add a prefix or suffix so that I do not have this problem when I merge. Incidentally all my value labels begins with "labels" followed by a number. I also have 516 value labels so I can't just go change them all easily.
Any help would be appreciated. This is my first post and I'm a newbie to STATA.
Thank you!
Related Posts with renaming all value labels in a dataset
Question about cyclesBest users, For my thesis I'm partly using a paper by Shue and Townsend, that is on how stock optio…
Case Control Design: weightingHey guys, I'm conducting a study that analyses the antecedents of corporate divestitures based on a…
Panel data (Trade topics) and countries/sectors fixed effectsDear All, I have a data base with export variation (between 2020 et 2019), by origin countries, des…
Nationality and NameHi! I have a dataset that has the names for around 17000 individuals, and I am wondering if there i…
Counting events falling in any 5 year window around the focal eventHello everyone, I am working on a dataset containing a sample announcement dates (each standing for…
Subscribe to:
Post Comments (Atom)
0 Response to renaming all value labels in a dataset
Post a Comment