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
Dealing with date and timeHi, I am using Stata 16 and seem to have problem extracting year, month and day from a date-time co…
LinktestHey guys, I have a question about the output of the linktest. I know that a significant _hatsq in c…
strtrim not producing desired resultsHi Stata Users, I am using strtrim command in Stata 15. The goal is to remove blank spaces at the b…
Interpolate to end of month instead of mid month data?Hello, all my data are for the end of month. But I have one variable where the data is listed mid mo…
Hurdel model with interval dataHi Does anyone know how to run a hurdle model with interval data? We have asked the respondents abo…
Subscribe to:
Post Comments (Atom)
0 Response to Creating new var w/ multiple values of another var
Post a Comment