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"
HistogramHi, I am trying to create an histogram of the variable x with frequency but of the variable weights…
reg2hdfespatialDear all, I want to use this link to install the user-written command -reg2hdfespatial-in Stata. ht…
How to convert a date into numerical for subtractionDear members I have the following date: 12-Dec-15 and would like to convert it to numerical so I ca…
Basic question about calculation of Residual Sum of Squares with -reg- commandHello everyone, I have a really basic question about Stata calculations for the -reg- command. I ha…
Creating a loop to run a command when the suffixes matchI have the following code in Stata 17 that aims to run a command when the suffixes match. In other w…
Subscribe to:
Post Comments (Atom)
0 Response to generating variables with "or"
Post a Comment