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
Crude OR and Adjusted ORHi to everybody. I have a dubt. Below the instrution and part of my stata's output : 1) logistic gr…
Number of timepoints for person fixed effectsIs there some sort of arbitrary number of timepoints needed in order to estimate person fixed effect…
Creating categorical summary values for cities annually, weighted/unweightedHi guys. New to running Stata for large groups. I'm working with IPUMs American Community Survey Da…
Graph with Coefplot: how to truncate X axis.Hi all, I try to design a graph for a logistic regression. I had included all significant variable…
xtivreg2 export first and second stage resultsAs the description of xtivreg2 says, it is the wrapper of ivreg2. But the "savefirst“ option of ivre…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a categorical variable from multiple continuous variables
Post a Comment