Dear All,
I have two variables V1 and V2 .
V2 has the option (1= Control , 2= CBE, 3=Government)
I want to recode some value in V1 with "if" condition according to three different Options, it works in separate line of code as following:
recode V1 (5=9)(6=10) if V2==1
recode V1 (5=7)(6=8) if V2==2
recode V1 (5=6)(6=6) if V2==3
but how can I do all the above mentioned three lines codes in one line code to do the above mentioned action. does recode accept more than one if condition
Kindest Regards,
Yousufzai
Related Posts with has problem with : recode with more than one if condition
Finding out proportions by groupsHello everyone, I'm struggling with one piece of code and am hoping I can get some help here. I hav…
Using moss to cut extremely long string variables in two (based on character position)Hello all, I am trying to import and clean a number of documents (imported into a dataset as a sing…
Combining forestplot graphs with subgroup analysisDear All, I am doing a meta-analysis using Stata 16. Was wondering if I can create a forestplot with…
Help with "variables out of order" errorHello everyone, I am trying to estimate a treatment effect model using the Heckman's sample selecti…
Converting CRSP daily stock return to weekly returnHi all, A Stata newbie here. I am working with the daily stock return data from CRSP. I am required …
Subscribe to:
Post Comments (Atom)
0 Response to has problem with : recode with more than one if condition
Post a Comment