J
jwang036
I have a table with the transaction records (currently 5000) of a store:
TranID ItemA ItemB ItemC ...
TranID=Text, one ID per visit
ItemX=1 or 0, if 1 ItemX is purchased, if 0 not purchased
What I want is a Co-occurrence matrix:
ItemA ItemB ItemC ...
ItemA AA AB AC
ItemB BA BB BC
ItemC CA CB CC
AA=all occurence of item A, how many times A appear in each ID
AB=all co-occurence of item A&B, how many times A &B (or B& A) appear at the
same time in each ID
No sequence difference, so AB=BA
I know I may should use Matlab etc. but it drives mad.
Thanks in advance!!!
TranID ItemA ItemB ItemC ...
TranID=Text, one ID per visit
ItemX=1 or 0, if 1 ItemX is purchased, if 0 not purchased
What I want is a Co-occurrence matrix:
ItemA ItemB ItemC ...
ItemA AA AB AC
ItemB BA BB BC
ItemC CA CB CC
AA=all occurence of item A, how many times A appear in each ID
AB=all co-occurence of item A&B, how many times A &B (or B& A) appear at the
same time in each ID
No sequence difference, so AB=BA
I know I may should use Matlab etc. but it drives mad.
Thanks in advance!!!