Actually, I want to create a new column name h_67 which will be equal one if the column/variable avg_percent_moneyness >=.67 twice within the sample period otherwise it will be zero. Here, in the code count function is not working as is it not correct. I need help in this regard, hope I will get the reply from you.
I tried the following code but it does not work. Variable holder in the data, is equal 1 if avg_percent_moneyness>= .67 or remains o
Data want;
set have;
If (count(avg_percent_moneyness>=.67))>=2 then holder_67=1;
else 0;
run;