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"
Cumulative sums with duplicatesI am trying to create a variable based on employment data taken from a survey done over several year…
How to writing a code similar as the following code but by region?levelsof year, local(years) egen flag = tag(id_job year) gen stateratio = . foreach y of local years…
Multi-Level Modelling DecisionsDear fellow Stata users, I have some questions about the use of multi-level models. I am working o…
Probit or LPM?Hi Statalist, I am researching the wage and employment differences between graduates who have and h…
How to extract numeric part of a string var in STATADear everyone, I would like to know if someone knows a STATA code that I can use to extract numeric…
Subscribe to:
Post Comments (Atom)
0 Response to generating variables with "or"
Post a Comment