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
Number of instruments in GMM-system estimatorDear all, I am currenlty working on the causal relationship between the informal care decision and …
variable with multiple conditionsHello. I'm attempting to create a new variable (metabolic syndrome) based on meeting at least three…
Joint Risk Genotype InteractionHi, Does anyone know how to do analysis of Joint Risk Genotype Interaction? I did case-control stu…
Sample Size AUC/AUROCHi all, I'm working on a study that will evaluate several score to predict the same outcome (surviv…
Question about scanning through directory and compress all stata filesHello, I just wanted to ask if I might run into any issues running the code below. We have some tera…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a new variable
Post a Comment