Hello, I have two variables, IS and Code. I would like IS to take on different values depending on what Code is. For example, I would like IS to equal 10401 if Code = 10085, 10087, 10090, 10091, 10095, or 60031. I would like IS to equal 10402 if Code = 10094, 10164, 60027, 60029, 60032, 60033 or 60034.
In this way I am trying to map about 900 Code values to about 100 IS values. Is there a relatively quick way I can do this using loops and groups instead of doing replace IS over and over again? I am very new to Stata and do not have much experience.
Related Posts with Creating new var w/ multiple values of another var
Copy variables (basic problems)Hi, I would love some help! I try to copy the personal tax in 2002 to all years. My initial data l…
Panel data regression weird ORDear statalist community, Thank you all in advance for taking the time to read this post and help m…
Time series portfolio betasHey everyone, For my thesis I am following the methodology from Dittmar & Lundblad (2017) to ob…
Fixed Effect variablesHello Statalist I want to perform a logit regression using various variables (not fixed effects) bu…
Interpreting z-value output from ivregress 2sls and query about bar chartsHi all, This is my first post but i'll try to make my questions as clear as possible. To be clear t…
Subscribe to:
Post Comments (Atom)
0 Response to Creating new var w/ multiple values of another var
Post a Comment