Hi everyone,
New Stata user and first-time poster here. I'm trying to create a new categorical variable, catvar, based on 4 continuous variables: avar, bvar, cvar, and dvar.
Basically, catvar = 0 if avar, bvar, cvar, and dvar are all < 70;
catvar = 1 if exactly one of the four continuous variables > 70;
catvar = 2 if exactly two of the four are > 70 and within 10 units of one another;
catvar = 3 if exactly three of the four are > 70 and within 10 units of one another; and
catvar = 4 if all four variables are > 70 and within 10 units of one another.
I'm having some trouble getting the logic/operators to work, and would appreciate any/all tips, readings, and/or suggestions -- thanks so much!
Related Posts with Creating a categorical variable from multiple continuous variables
Interpreting coefficients when there are dummy variables presentHi, I had a question about interpreting coefficients on Stata. I have a continuous variable, call i…
WRDS / IBES - Get the right data into STATAHello, forgive me for the seemingly stupid question but this is my first empirical research and my …
table checking balance across covariates for two groups.Hi all, I am trying to create a small table where I test if covariates are balanced across two grou…
cmp command for rank-ordered probit modelDear all, I am running a rank-ordered probit model using the cmp command. The dependent variable is…
Different colors for two groups of bars in a bar chartDear all, I am trying to make a bar chart that shows mean value of a variable (attitudes toward immi…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a categorical variable from multiple continuous variables
Post a Comment