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
Creating dummy variables with category namesDear all, I have a dataset comprising thousands of individuals. For each individual I have, among ot…
Confidence intervals for wtpHi everyone! Does anyone know why do we need to calculate Confidence Interval for Willingness to Pay…
Shaded bar between values of X axis of a line graphHi, I am making a line graph where x axis is the year. I want to highlight/shade the periods betwee…
Generate dummy from repeated valuesHello, I have a data with repeated numeric observations and would like to generate dummies that end …
Panel binary logistic regression, lagged independent and dependent variables, and age effectsDear Statalist users, I hope you are well. I am a PhD candidate at RMIT University, Melbourne. I a…
Subscribe to:
Post Comments (Atom)
0 Response to renaming all value labels in a dataset
Post a Comment