The 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 mycas.assocs;
   set sampsio.assocs;
run;

These statements assume that your CAS engine libref is named mycas, 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 mycas.assocs data table and generate output in the mycas.assocs data table:

proc mbanalysis data=mycas.assocs items=3 support=100;
 output out=mycas.out outfreq=mycas.outfreq outrule=mycas.outrule;
 customer Customer;
 target product;
 run;

The PROC MBANALYSIS statement specifies mycas.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 mycas.outfreq table, the frequent item sets in the mycas.out table, and the generated rules in the mycas.outrule table. The mycas.outrule table contains the rules that are generated for the frequent item sets after rule generation criteria are applied.

Last updated: November 11, 2020