Example 1: Association Rules Applied to Consumer Preferences
This example is based on the FastFood.sta data file, which is also described in some detail in Example 6: Tabulating Multiple Responses and Dichotomies of Basic Statistics.
To illustrate the application of association rules, and the interpretation of results, in this example only respondents' gender and food preferences will be analyzed. The variables of interest in this example are identified and described below:
(1) Hamburger
(2) Sandwiches
(3) Chicken
(4) Pizza
(5) Mexican fast-food
(6) Chinese fast-food
(7) Seafood
(8) Other ethnic or regionally popular fast-food
The three choices that each respondent makes are entered into the data file as a multiple response variable, that is, their first choice is entered into variable Food_1 (first preference or favorite fast food), their second choice (if available) is entered into variable Food_2, and their third choice into variable Food_3 (see also Categorical Variables, Multiple Response Variables, and Multiple Dichotomies in Computational Procedures and Terminology for a discussion of variable types).

There is no need to select the actual codes since the analysis will automatically pick up all distinct values found in the selected variables.
Next, click on the Advanced tab to specify the parameters that will guide the a priori algorithm for identifying the association rules (see Agrawal and Swami, 1993; Agrawal and Srikant, 1994; Han and Lakshmanan, 2001; see also Witten and Frank, 2000); to learn more about these parameters, see Computational Procedures and Terminology.

For this example, change the Minimum support value to .4, and leave all other options at the defaults. In general, you may always want to start with the default settings for these parameters. If no association rules satisfying these conditions (i.e., with the required Minimum support, Minimum confidence, Minimum correlation, etc.) can be found in the data, Statistica will issue a warning to that effect. You can then gradually relax these conditions, i.e., require lower Minimum support, Minimum confidence, and Minimum correlation, until a reasonable number of association rules can be derived.
The latter two parameters, Maximum item set size in body/head, are used to control the maximum complexity of rules derived from the data. Remember that in general, association rules have the form If Body then Head (see Association Rules: If Body then Head in Computational Procedures and Terminology ); so an association rule involving 10 items on each side of this rule would be quite complex (If X1 and X2 and ... X10 then Y1 and Y2 and .. Y10).
Now click OK to display the Results dialog.

We have four rules that associate males (Gender=Male) with certain food preferences:
- If Gender=Male then Pizza
- If Gender=Male then Hamburger
- If Pizza then Gender=Male
- If Hamburger then Gender=Male
The interpretation of these results - and this is one of the strengths of the association rules method in general - is rather apparent: Males like Pizza and Hamburger (in this sample).

As discussed in Graphical Representation of Associations, the 2D association rules network provides a summary of all important information regarding the rules derived from the data. Remember that association rules follow the general form If Body then Head, where Body and Head are categories, items, text values, or conjunctions of categories, items, and text values. In this graph, the items identifying the Body of each rule are shown on the left side of the graph, the Head of each rule is shown on the right. The lines connecting the Body to the Head represent the association rules.
The support values for the Body and Head portions of each association rule are indicated by the sizes and colors of each circle (see also Computational Procedures and Terminology). The thickness of each line indicates the confidence value (joint probability) for the respective association rule; the sizes and colors of the circles in the center, above the Implies label, indicate the joint support (for the co-occurrences) of the respective Body and Head components of the respective association rules.
It is easy to see how all relevant statistics that describe the association rules are efficiently summarized in the sizes of circles, lines, and colors in this graph (see also section on Association Rules Networks, 2D in Graphical Representation of Associations for a more complex example graph related to text mining).

As in the 2D association network, the support values for the Body and Head portions of each association rule are indicated by the sizes and colors of each circle in the 2D plane (see also Computational Procedures and Terminology). The thickness of each line indicates the confidence value (joint probability) for the respective association rule; the sizes and colors of the "floating" circles plotted against the (vertical) z-axis indicate the joint support (for the co-occurrences) of the respective Body and Head components of the association rules. The plot position of each circle along the vertical z - axis indicates the respective confidence value. Again, the rules relating Gender=Male to Pizza and Hamburger are clearly visible in this graph.

This graph shows, for example, that the confidence value (conditional probability) for the rule If Pizza then Gender=Male is relatively low (compared to the other rules).