Dear all,
I hope you can help me.
I would like to generate a new variables based on values of another variable. The variable I would like to use has 18 values and I would like to trichotomize it into 3 categories with the values 0, 1, 3.
I tried to use:
gen newvardemo if country_code= 1=1 and if country_code= 2=0
but it appears this is not valid syntax.
Can you help me?
Related Posts with Generate a new variable
Conditionally Replacing Values in Long-Data Format Dataset?Hello, I have simplified an original question I had so that it is much more approachable. I have lo…
Advice on how to compute generalized residuals for order probit with panel dataHello, I am using a control function approach to correct for an endogenous ordinal variable (with t…
Using -reshape- to create male/female versions of key variablesHi Statalist. I would like to -reshape- some of my data from long to wide in order to apply the 'gen…
Mundlak device for the time dimensionDear all, This is a question not directly about stata application. I notice there are many topics a…
Running out of memory while merging .dtaDear all, I am encountering a problem similar to this post (running out of memory while merging). In…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variable
Post a Comment