Hi! I'm trying to create an indicator variable from several dummy variables (which are not mutually exclusive). It would seem straightforward, but I am encountering some challenges. Could someone pls advise?
Here is a simplified example of what I am trying to do. Let's say we have three dummy variables for food preferences, A1=1 if respondent likes cereal for breakfast, 0 if not / A2=1 if respondent likes salad for lunch, 0 if not / A3=1 if respondent eats desert with dinner, 0 if not. The respondent could like all three, or some combination thereof.
How would I create one variable to catch all? For instance a new variable A, which is =1 if the respondents like breakfast, is =2 if they like salad, and =3 if they like desert, that will not drop those observations that overlap?
Related Posts with Creating an indicator variable from multiple, non-mutually exclusive, dummy variables
Wagstaff concentration Index for binary outcomeHi, I have read in existing literature that if we are dealing with a binary outcome (i.e th individ…
how to delete specific observationsHello everyone I need to delete the firms that does not have data for three years consecutively. ple…
Help creating graph for multiple linear regressionDear all, I am using Stata 16, on mac. I am estimating the regression: reg GDP agedpop population …
Exporting residuals vs prediction dataHi, So, I need to make a residuals versus predictor plot. However, the graphics aren't working in S…
Doubt on Heckprob model resultsHello everybody, I'm running a Heckman selection model based on a heckprob. I have some categorical…
Subscribe to:
Post Comments (Atom)
0 Response to Creating an indicator variable from multiple, non-mutually exclusive, dummy variables
Post a Comment