Dear all,
I am doing association rule analysis for my project. And I would like to separate the dataset into Monday, Tuesday....etc to see the pattern (The variable is named TOT, and 1=monday, 2=tueday.........). I try to apply filter, but it is only for raw or train dataset.
What can I filter a transaction dataset? I can only use SAS code to do that?
Thank you so much.
Regards,
Priscilla
Hi @priscillatsea,
Thanks for your question! I wanted to let you know that a SAS expert is looking into this and will get back to you soon.
Best,
Anna
I will start with a disclaimer: I love the Enterprise Miner SAS Code node. With the SAS Code node, all things are possible.
From the wording of your question, I am assuming you would prefer a code free solution. I do not think that is possible.
For my explanation, I have a hypothetical transaction data set called NFS_Assoc. It has an ID variable called Basket and a target variable called ProductName. There is also a DayOfWeek variable with values 1=Sunday through 7=Saturday. While your coding is 1=Monday, etc., the same strategy will apply. There is also a CustomerID variable and a Date variable.
I will provide a minimal code/maximal pain solution first.
To do an association analysis for Wednesday transactions, proceed as follows.
data &EM_EXPORT_TRANSACTION;
set &EM_IMPORT_DATA;
run;
For the minimal code/maximal pain solution, you needed a process flow with five nodes. For the maximal code/minimal pain solution, you only need three nodes.
data &EM_EXPORT_TRANSACTION;
set &EM_IMPORT_TRANSACTION;
where DayOfWeek=4;
run;
You can see why I prefer the more complicated coding solution (one extra line of code) to the kludging with extra nodes solution.
You indicate that your day of week variable is TOT, so everywhere I refer to DayOfWeek, you should substitute TOT, and you should use your coding (1=Monday, etc.).
You made me think about more efficient ways to pass through all DayOfWeek values, rather than just copying and pasting process flows. Perhaps Start Group/End Group would work. I don’t know how to do this. Perhaps someone has a better idea.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.