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"
mlogit + margins + testUsing Stata 15.1, I was wondering how I test for equality of the coefficients for the marginal effec…
Identify if single cell contains multiple substringsHi, I'd like to identify observations when a string variable contains multiple substrings. In my d…
Download collin command for stata and suitable value for vif ?I use command findit collin, and scroll to the last, then click collin from https://stats.idre.ucl…
Time series ARIMA, how to forecast future?Hi everyone, I am new to STATA time series, and here is a question I have on how to perform forecas…
marginsplot with custom labelsHi, I saw a discussion about this topic here: https://www.statalist.org/forums/for...-custom-labels…
Subscribe to:
Post Comments (Atom)
0 Response to generating variables with "or"
Post a Comment