Hi!
I have created a dummy variable as my target variable where 0 indicates that the event "payment handled" has not occured, and 1 that is have occured. Furthermore, i want to add a value "2" in my target variable indicating that the event "payment handled" has not occured due to another event called "decleration rejected". This means that the event has to have a value <0 at decleration rejected, and 0 at payment handled. Both events are extracted from the same column named, activity_id.
Can someone help?
It has to have a value >0 at decleration rejected**
If I understand you correctly than add a line:
sum(activity_id="decleration rejected") as rejected /* new dummy */
then add a new step:
data tuetravelexpenses_cases;
set tuetravelexpenses_cases;
if rejected > 0 then target_variable=2;
*drop rejected;
run;
Almost!
The value "2" requires that "payment handled" is 0, and "declaration rejected" > 0, and not only that "declaration rejected" > 0.
But i managed that by adding "and". Thanks for the help!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.