Hi, I wish to create a new variable given certain parameters of 3 other variables.
I have tried the basic creation of a new variable commands "gen highscore = . / replace highscore = 0 if (varA <1)
[I can get that far, but what I need is something essentially like the following - but the syntax doesn't work):
replace highscore = 0 if (varA <=1) or if (varB <=10) or if (varC >= 10)
Is there a way to fix this syntax?
Thanks for any and all help - I am sure the answer is pretty straightforward.
Related Posts with generating variables with "or"
Deleting entire Firm based on condition from panel data setHello Stata community, I have a panel dataset consisting of many firms over 20 years. Firms are iden…
Decomposing Wagstaff Concentration IndexDear All, I'm using Stata 16 and I'm trying to decompose my concentration index using the following…
Reshaping Data and Variables for a Dynamic Panel Data AnalysisHi there, I am happy to be new in this forum and currently writing on a Panel Data Analysis for a co…
multiple lines in one graph with if conditionshi statalist, I have the following data: Code: * Example generated by -dataex-. For more info, ty…
Graphic with graphs for sub catvars and overall graphHello, I want to create a graphic with multiple graphs for each sub catvar and also a graph that is…
Subscribe to:
Post Comments (Atom)
0 Response to generating variables with "or"
Post a Comment