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
couple id, family panel dataDear stata users, In my data I have children, mother and father. There is one record for the child, …
Free Causal Data Science MeetingThis might be of interest to the Stata community: Free causal data science meeting November 15th &a…
Individual trend instead of individual fixed effects?Dear All, I have a more general question, that I would like to discuss with you: In a pooled model …
Fgls/gls/wlsHi Experts If we don't assign weights to FGLS/WLS/GLS model then ; Are those results correct? (with…
Summary statistics for quintilesHi, I would like to create a table in stata, which describes summary statistics for quintiles of a …
Subscribe to:
Post Comments (Atom)
0 Response to Creating an indicator variable from multiple, non-mutually exclusive, dummy variables
Post a Comment