All, I have another client-related question. The question was posed concerning Association Analysis, but perhaps the answer lies in Text Explorer. Here goes...
Using the sample "Grocery Purchases" data file, I can perform an association analysis, where I can see things like "For people who bought chicken, ice cream, and sardines, 100% of them also bought Coke."
The question is: Is there a way to essentially select this line in the Association Analysis Report, and have those rows selected in the original Data Table so that I can see which customers bought all 4 items?
I think I can get there in Text Explorer, though it involves considerable reformatting of the Grocery Purchases data file. Thoughts on that are welcome as well.
Thoughts?
It would be nice if this were built in with a linked table. Until then, this works but will be slow on bigger data.
1) Save off the transaction table with a right-click. Name it "Transaction".
2) Save off the rules table with a right-click. Name it "Rules".
3) In the transaction table, make a new formula column and for the formula, use the attached JSL.
4) Select any row you like in the rules table.
5) Click somewhere in the transaction table to make the formula update. Rows with a "1" in the new column mark transactions observing the selected Rule.
Cheers,
Brady
Names Default To Here( 1 );
dt1 = Data Table( "Rules" );
r = (dt1 << get selected rows)[1];
dt2 = Data Table( "Transactions" );
l1ContainsL2 = Function( {l1, l2},
{aa1, aa2},
aa1 = Associative Array( l1 );
aa2 = Associative Array( l2 );
aa2 << Remove( aa1 );
aa2 << get keys == {};
);
row()= 1;
l1Containsl2( Words( substitute(dt1:consequent[r], ", ",","), "," ) || Words( substitute(dt1:Condition[r],", ",","), "," ), Words( substitute(dt2:itemset[row()],", ",","), "," ) );