Hello everyone,
I have a set of categorical variables which have certain value labels attached to their value. I want to change (using loop) the value labels if these labels contain certain words. For example,
Var1 has three values 1, 2, 3 and the respective value labels are "Bottle Large Red", "Bottle Small Black", "Bottle No data"
I want to change all the value labels to "The bottle is large and red" if the value label contains words "Red" & "Large"; to "The bottle is small and black" if it contains words "Black" & "Small". No change if the value label does not contain all the that words I specify.
I hope I am clear in asking my question. Kindly advise how can I do this.
Thanks.
Amit
Related Posts with How to modify value labels based on certain words already present in value labels
maximum number of iterations exceeded" with predictnl commandPlease stata show me this message "maximum number of iterations exceeded" when i use the predictnl c…
Loops and local macroGreetings everybody, I have one big dataset with variables starting from v4 to v66, and I want to d…
histogram colorsHi everyone, i hope you are all keeping safe. I have a simple question. i am creating a histogram pl…
Logit - Panel - BaseHello, I have a panel data set from 2013 - 2017 where each individual is included for 3 years. My d…
Create hbar with multiple dummy varsHello everyone, I would like to create a bar in which on the X axis I have a numerical var and on t…
Subscribe to:
Post Comments (Atom)
0 Response to How to modify value labels based on certain words already present in value labels
Post a Comment