proc sequence data=dmseq dmdbcat=catseq
assoc=aout
out=sout(label='Output from Proc Sequence')
nitems=2;
cust customer;
target product;
visit time;
run;
proc sort data=sout;
by descending support;
run;
proc print data=sout(obs=10);
var count support conf rule;
title 'Partial Listing of the 2-Item Sequences';
run;
Output
PROC PRINT Partial Listing of the SAMPSIO.ASSOCS Data Set
Partial Listing of the ASSOCS Data Set
OBS CUSTOMER TIME PRODUCT
1 0 0 herring
2 0 1 corned_beef
3 0 2 olives
4 0 3 ham
5 0 4 turkey
6 0 5 bourbon
7 0 6 ice_cream
8 1 0 baguette
9 1 1 soda
10 1 2 herring
Partial Listing of the 2-Item Sequences
The OUT= sequence data set contains the following variables:
COUNT - contains the number of transactions meeting the rule.
q
SUPPORT - contains the percent of support, that is the percent of the total number of transactions that qualify for
the rule.
q
CONF - contains the percent of confidence.
q
RULE - contains the text rule.
q
ISET1, ISET, ISETn - contain, in order, the events that form the event chain. For this example, the ISET variables
are not printed.
q
The first rule, cracker ==> unhidden, indicates that 337 customers bought unhidden after buying crackers. The
confidence factor indicates that 69% of the time a customer will buy unhidden after they buy crackers. Thirty-three
percent of the customer base supports this rule.
Partial Listing of the 2-Item Sequences
OBS COUNT SUPPORT CONF RULE
1 337 33.6663 69.0574 cracker ==> unhidden
2 235 23.4765 48.3539 herring ==> heineken
3 233 23.2767 49.2600 olives ==> bourbon
4 229 22.8771 47.1193 herring ==> corned_beef
5 226 22.5774 46.5021 herring ==> olives
6 225 22.4775 57.3980 baguette ==> heineken
7 220 21.9780 69.1824 soda ==> cracker
8 220 21.9780 56.1224 baguette ==> herring
9 220 21.9780 46.5116 olives ==> turkey
10 218 21.7782 68.5535 soda ==> heineken
Partial Log Listing
1
2 proc dmdb batch data=sampsio.assocs out=dmseq dmdbcat=catseq;
3 id customer time;
4 class product(desc);
5 run;
Records processed= 7007 Mem used = 511K.
NOTE: The PROCEDURE DMDB used 0:00:02.65 real 0:00:00.96 cpu.
6
7 proc assoc data=dmseq dmdbcat=catseq
8 out=aout(label='Output from Proc Assoc')
9
10
11 items=5 support=20;
12
13 cust customer;
14 target product;
15 run;
----- Potential 1 item sets = 20 -----
Counting items, records read: 7007
Number of customers: 1001
Support level for item sets: 20
Maximum count for a set: 600
Sets meeting support level: 20
Megs of memory used: 0.51
----- Potential 2 item sets = 190 -----
Counting items, records read: 7007
Maximum count for a set: 366
Sets meeting support level: 183
Megs of memory used: 0.51
----- Potential 3 item sets = 1035 -----
Counting items, records read: 7007
Maximum count for a set: 234
Sets meeting support level: 615
Megs of memory used: 0.51
----- Potential 4 item sets = 1071 -----
Counting items, records read: 7007
Maximum count for a set: 137
Sets meeting support level: 317
Megs of memory used: 0.51
----- Potential 5 item sets = 85 -----
Counting items, records read: 7007
Maximum count for a set: 116
Sets meeting support level: 71
Megs of memory used: 0.51
NOTE: The PROCEDURE ASSOC used 0:00:06.52 real 0:00:03.16 cpu.
16
17 proc sequence data=dmseq dmdbcat=catseq
18 out=sout(label='Output from Proc Sequence')
19
20
21 nitems=2;
22
23 cust customer;
24 target product;
25
26 visit time;
27 run;
Large itemsets: 1206
Total records read: 7007
Customer count: 1001
Support set to: 20
Total Litem Sequences: 398
Number >= support 291
Memory allocated megs: 2
NOTE: The PROCEDURE SEQUENCE used 0:00:05.74 real 0:00:02.52 cpu.