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
Questions about components' stationarity in VAR model.I am very confused about the stationarity of variables in VAR. It seems that different econometrics …
Correlation Coefficient and logarithmic variablesHi, I am working on some data containing 1400 observations over a 7 year period, whereas the observ…
Efficiently creating lags only for certain yearsHi, I am working with election data and have two datasets (concerned variables explained below): D…
Endogeneity in panel dataHi everyone, I have a balanced panel data N=14 (country) T=5. I have developed a Correlated random-e…
Program to label variables from list of words - How to use fewer single and double quotesI am used to make reusable programs, and find myself having issues with how I use the local single q…
Subscribe to:
Post Comments (Atom)
0 Response to Creating an indicator variable from multiple, non-mutually exclusive, dummy variables
Post a Comment