Good day! In this dataset I have, I have different indicators of innovation: (innov1, innov2, innov3, innov4). These indicators are all in dummy format of 0 or 1. I want to generate a new variable that consolidates all those 4 indicators.
The outcome I want: have a variable innovation_all where it's 1 in the case any of the four indicators are 1.
Example:
innov1 is 0,
innov2 is 0,
innov3 is 1,
innov4 is 1; therefore my innovation_all should generate a 1 for that N.
And if all innov are 0, then the outcome should be a 0 for my innovation_all.
I need help looking for the right codes as the ones I've encountered does the opposite (creating new multiple variables based on 1 variable)
Related Posts with Generating a new variable
How can I get gr_edit to refer to specific graphs when multiple graphs are open in the graph window?I'm using a user-created command (-synth2-) that generates multiple graphs as outputs. I want to be …
What components should I pay attention to when buying a new laptop for Stata?Hello Statalisters, I don't know if I'm allowed to post this thread as it is not related to Stata p…
Logistic Regression Output with Factor Variable i.Year - Issues with InterpretationHi all! I’m having issues interpreting the coefficients in my regression output. My model has a dic…
Abnormal return for everday in a yearGood day everybody, I am new to Stata, and came up with an issue regarding the event study. I use t…
max # of variables in Cochran's Q test?Hello- I am trying to evaluate multiple choice (non-exclusive) binary questions. Ex: on a survey, a …
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable
Post a Comment