Market Basket Analysis

Reply
Occasional Contributor
Posts: 16

Market Basket Analysis

Hi all,

I am working on Market Basket Analysis and new to this analysis.The data is in the form of a binary item set. 1 implies that a person is a member of a particular club and 0 implies non membership.  Variables Family,Hobbies,Social_Club,Political,Professional,Religious and Support_Group.

I have attached the data as well in csv format.

Now , I would like to have a SAS code and interpretation.

Can someone help me out with the MBA(Market Basket Analysis) SAS Code?

Thanks and Regards,

Sandeep.K

Attachment
Super User
Posts: 9,681

Re: Market Basket Analysis

What output do you want ? If I understand what you mean.

proc import datafile="c:\temp\Association Rules.csv" out=have dbms=csv replace;
run;
data list;
 set have;
 array _x{*} _all_;
 do i=1 to dim(_x);
  do j=i+1 to dim(_x);
   if _x{i} eq 1 and _x{j} eq 1 then do;l=catx(' ',vname(_x{i}),vname(_x{j}));output;end;
  end;
end;
keep l;
run;
proc freq data=list noprint;
 table l / out=w nopercent;
run;
proc sort data=w ;by descending count;run;

Xia Keshan

Super User
Posts: 17,829

Re: Market Basket Analysis

Do you have eMiner? Market Basket Analysis is only implemented in eMiner as far as I know.

Ask a Question
Discussion stats
  • 2 replies
  • 684 views
  • 0 likes
  • 3 in conversation