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
Generate matching groupGood Morning/Afternoon, after conducting an event-study on two different groups of bonds (Green and…
Fill column based on simple rulesSAMPLE DATA: Code: input person var1 1 1 1 2 1 . 1 3 1 1 1 4 2 2 2 2 2 . 2 . 2 3 2 3 3 3 3 4 3 . 3 …
merge dataHello everyone, sorry for asking many questions …
PpmlDear Joao Santos Silva I have a panel data set with a count dependent variable and several count re…
using egen to generate a variable based on a list of potential existing variablesHi all, I am relatively new to Stata and have a question regarding the generation of a new variable…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a new variable
Post a Comment