Reputation: 1
I am having difficulty appending datasets from multiple different years. I have made sure that the variable names are the same across the different datasets. However, within the numeric variables, the labelling is different--so that in one data set Catholic=1 but in another one Catholic=11. This causes the data to get messed up when appending. Is there a fix for this?
Upvotes: 0
Views: 501
Reputation: 311
Here is a short snippet which you can use to decode
all variables with value labels:
ds, has(vallabel)
foreach var in `r(varlist)' {
decode `var', gen(`var'x)
drop `var'
ren `var'x `var'
}
Upvotes: 1