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
Year in orderHi I have values from 1 to 10 and I would like to rename the numbers to years 1992 to 2002. I tried…
Fixed effects in RD plotsHi, I am trying to generate RD plots with and without year FEs, but the graph doesn't look smoothed …
Latex with StataHi what is the command to present the results of summarize and esttab commands in latex, please …
Import 4000 (old-version?) excel files?Dear All, I have about 4,000 files in excel (please see the attached files. In fact, there are some …
Transform and log return series in a panel dataset to correct for violation of normality assumptionHello, I have an unbalanced panel dataset with approximately 4000 observations on the return on equ…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a categorical variable from multiple continuous variables
Post a Comment