Sequence Analysis: Selector variable only

Scenario: Find the longest sequence of holidays a person has made to the same destination.

To get started, launch the Sequence Analysis wizard, then:

  1. Transactional Selection - right click and select the Bookings table as the transactional records to analyse.

  2. Grouping Table - set People as the table to group the bookings up to.

  3. Transaction Grouping - this is an optional step that allows additional grouping into the categories of an identified selector variable. No grouping variable is required here - simply click Next.

  4. Transaction Ordering - in this example:

    1. Drag and drop the Booking Date variable onto the drop-box.

    2. Leave the default order as Earliest to Latest.

    No maximum gap between transactions is necessary here - click Next.

  1. Leave the default - Selector Variable Only - as the pattern type to use.

  1. First:

    1. Drag and drop Destination as the pattern variable to use.

    You can now use the Pattern definition type drop-down to select either a 'longest' sequence option, or define your own pattern by selecting Manual.

    1. Select Longest Same.

    It is possible to specify categories to include or exclude, but this is not necessary here.

As this is selector only pattern matching, you move directly to the Pattern Return Value step.

  1. Use the Return the drop-down options to define the information you want to return. Here:

    1. Select the First

    2. Return the Pattern Length

    3. Return as a property on the Grouping Table

  1. Give your pattern match aggregation an appropriate description.

  1. You have the opportunity to review and, if necessary, edit your settings before creating the pattern match expression.

You cannot return to the wizard to make changes once you have generated the expression. You can edit settings within the expression window, or start the process again using the Sequence Analysis wizard.

Once you click Finish, a FastStats expression window opens. Switch to the on the fly aggregation tab to see the settings defined using the wizard.

 

To visualise the results, drag and drop the expression onto a data grid:

 

Related topics: