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
Plotting graphs related to synth (synthetic control)Array Folks, I’m trying to plot some graphs related to command synth in Stata, but I’m not succeedin…
Positive and Negative DV Values in Panel Data analysis, potential solutionsis it possible to regress a period average of your DV onto annual values of IVs. My DV is Chinese OF…
Analysing Likert scale outcome variable and how to combine questions into oneHello friends I have a challenge analysing likert scale outcome variable. Allow me share full detail…
Stata's log-likelihood and likelihood ratio test for gamma GLMI'm trying to make sense of the log-likelihood reported by Stata for a glm with family(gamma), which…
Wald test for one-sided hypothesis - strict inequalityI am trying to test a one-sided hypothesis after running a regression to see if the sum of two coeff…
Subscribe to:
Post Comments (Atom)
0 Response to Creating new var w/ multiple values of another var
Post a Comment