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
connect paired dot in scatter plotHi there, I'm working on a descriptive scatter plot where I need to show values of two variables, X…
stata commandI have several observations (individuals) with each belong to a household (so each has a household I…
qreg alternate solutions exists - retrieve solutionsHi, I am running a simple quantile (median) regression that has a dummy variable on the RHS. The y-…
How to find lag of a variable in long format panel dataset?I have a dataset akin to this User Date Value A 2012-01-01 4 A 2012-01-02 5 A 2012-01-03 6 A 2012-0…
Create a new column using a column of 1 and 0.Hello! I'd like to ask for advice. I have the following data: I want to make a "var2" using "var1". …
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable
Post a Comment