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
Add Text to Graph CombineI am combining three graphs using 'graph combine'. By default they appear in a 2 x 2 arrangement wit…
Obtaining mean and SD from survey dataHello, I am trying to get the differences in the length of stay(LOS) in subpopulation of myocarditi…
-sreshape-i just installed -sreshape- onto stata mp.. does anyone know if it has a max variable limit? i have …
Lasso regress questionsHi, I am college student from Barcelona. It is hard to learn Stata by myself because the teacher doe…
Showing country-specific treatment effectsHello, I'm currently working with a dataset with individual respondents. In my analysis, I show the…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variable
Post a Comment