MBANALYSIS Procedure
Getting Started: MBANALYSIS Procedure
Note: Input data must be in a CAS table that is accessible in your CAS session. You must refer to this table by using a two-level name. The first level must be a CAS engine libref, and the second level must be the table name. For more information, see the sections Using CAS Sessions and CAS Engine Librefs and Loading a SAS Data Set onto a CAS Server in Chapter 2, Shared Concepts.
This example finds frequent item sets in the sampsio.assocs data set and generates rules for finding association between those frequent item sets. The sampsio.assocs data set contains 1,000 observations, each of which contains products purchased by a customer.
You can load the sampsio.assocs data set into your CAS session by specifying your CAS engine libref in the first statement in the following DATA step:
data mylib.assocs;
set sampsio.assocs;
run;
These statements assume that your CAS engine libref is named mylib, as in the section Using CAS Sessions and CAS Engine Librefs, but you can substitute any appropriately defined CAS engine libref.
The following statements execute the MBANALYSIS procedure on the mylib.assocs data table and generate output in the mylib.out data table:
proc mbanalysis data=mylib.assocs items=3 support=100;
output out=mylib.out outfreq=mylib.outfreq outrule=mylib.outrule;
customer Customer;
target product;
run;
The PROC MBANALYSIS statement specifies mylib.assocs as the input data table and specifies the rule generation criteria: the number of items and level of support. The OUTPUT statement specifies output tables for storing the results. The CUSTOMER statement identifies Customer as identification variable for the transactions. The TARGET statement defines Product as the target variable.
The procedure stores the list of frequent items in the mylib.outfreq table, the frequent item sets in the mylib.out table, and the generated rules in the mylib.outrule table. The mylib.outrule table contains the rules that are generated for the frequent item sets after rule generation criteria are applied.