View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jwang036 jwang036 is offline
external usenet poster
 
Posts: 18
Default Calculate Co-occurrence

I have a table with the transaction records (currently 5000) of a sto

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!!!