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"
Identify the age-period-cohort effectDear friends, I tried to apply the command of ''apcd''. The code is, Code: use "http://www.louisc…
cannot get accurate reault of large number calculationsHi ! I want to generate variable c by a - b, but the result is : c == a?! I don't know why and pleas…
Generating a dummy variable for an entire household based on a individual labour market characteristicHey there I am using cross-sectional for South Africa that that includes household(hhid) and indivi…
Spelling of decompositionDear Stata uers, My question is not related to statistics. My native language is not English, there…
colours for coefplot with matrixHi, I am using Stata16 and would like to produce a multicoloured coefplot from a matrix that contai…
Subscribe to:
Post Comments (Atom)
0 Response to generating variables with "or"
Post a Comment