I want to set the value of a series based on whether 6 conditions are simultaneously true. (This involves the absolute value of various lags of the series falling into various ranges.) I was going to use a loop, but don't see how I can string together all the conditions.
I am hoping there is some version of
if ( abs(x) < ZZ and abs(x-1) > QQ and ....)
set y = 1
else
set y= 0
Thanks
multiple conditions
Re: multiple conditions
The logic has to be inside the SET expression:
set y = (abs(x)<zz.and.abs(x-1)>qq.and.other conditions)
The value of Y will be 1 if all the AND conditions are met and 0 otherwise.
set y = (abs(x)<zz.and.abs(x-1)>qq.and.other conditions)
The value of Y will be 1 if all the AND conditions are met and 0 otherwise.