For the latest version of JMP Help, visit JMP.com/help.


Consumer Research > Choice Models > Additional Examples of the Choice Platform > Example of Transforming Data to Two Analysis Tables
Publication date: 07/24/2024

Example of Transforming Data to Two Analysis Tables

This example demonstrates transforming a single table into multiple tables to use in a choice model. The data set contains the travel time for three transportation alternatives and the preferred transportation alternative for each subject.

Add Choice Mode and Subjects

1. Select Help > Sample Data Folder and open the Daganzo Trip.jmp data table.

Figure 4.43 Partial Daganzo Trip Table 

Partial Daganzo Trip Table

Each Choice number listed must first be converted to one of the travel mode names. This transformation is easily done by using the Choose function in the formula editor:

2. Select Cols > New Columns.

3. Specify the Column Name as Choice Mode and the modeling type as Nominal.

4. Click the Column Properties and select Formula.

5. Click Conditional in the functions list, select Choose, and press comma twice to obtain additional arguments for the function.

6. Click Choice for the Choose expression (expr), and double-click each clause entry box to enter “Subway”, “Bus”, and “Car (with the quotation marks).

Figure 4.44 Choose Function for Choice Mode Column of Daganzo Data 

Choose Function for Choice Mode Column of Daganzo Data

7. Click OK in the Formula Editor window.

8. Click OK in the New Column window.

The new Choice Mode column appears in the data table. Because each row contains a choice made by each subject, another column containing a sequence of numbers should be created to identify the subjects.

9. Select Cols > New Columns.

10. Specify the Column Name as Subject.

11. Click Missing/Empty next to Initialize Data and select Sequence Data.

12. Click OK.

Figure 4.45 Partial Daganzo Trip Data with New Choice Mode and Subject Columns 

Partial Daganzo Trip Data with New Choice Mode and Subject Columns

Stack the Data

In order to construct the Profile data, each alternative needs to be expressed in a separate row.

1. Select Tables > Stack.

2. Select Subway, Bus, and Car and click Stack Columns.

3. For the Output table name, type Stacked Daganzo. Type Travel Time for the Stacked Data Column and Mode for the Source Label Column.

Figure 4.46 Stack Dialog for Daganzo Data 

Stack Dialog for Daganzo Data

4. Click OK.

Figure 4.47 Partial Stacked Daganzo Table 

Partial Stacked Daganzo Table

Make the Profile Data Table

For the Profile Data Table, you need the Subject, Mode, and Travel Time columns.

1. Select the Subject, Mode, and Travel Time columns and select Tables > Subset.

2. Select All Rows and Selected Columns and click OK.

A partial data table is shown in Figure 4.48. Note the default table name is Subset of Stacked Daganzo.

Figure 4.48 Partial Subset Table of Stacked Daganzo Data 

Partial Subset Table of Stacked Daganzo Data

Make the Response Data Table

For the Response Data Table, you need the Subject and Choice Mode columns, but you also need a column for each possible choice.

3. From the Daganzo Trip.jmp data, select the Subject and Choice Mode columns.

4. Select Tables > Subset.

5. Select All Rows and Selected Columns and click OK.

Note that the default table name is Subset of Daganzo Trip.

6. Select Cols > New Columns.

7. For the Column prefix, type Choice.

8. Select Data Type>Character.

9. Enter 3 for the Number of columns to add.

10. Click OK.

The columns Choice 1, Choice 2, and Choice 3 have been added.

11. Type “Bus” (without quotation marks) in the first row of Choice 1. Right-click the cell and select Fill > Fill to end of table.

12. Type “Subway” (without quotation marks) in the first row of Choice 2. Right-click the cell and select Fill > Fill to end of table.

13. Type “Car” (without quotation marks) in the first row of Choice 3. Right-click the cell and select Fill > Fill to end of table.

Figure 4.49 Partial Subset Table of Daganzo Data with Choice Set 

Partial Subset Table of Daganzo Data with Choice Set

Fit the Model

Now that you have separated the original Daganzo Trip.jmp table into two separate tables, you can run the Choice Platform.

1. Select Analyze > Consumer Research > Choice.

2. From the Data Format list, select Multiple Tables, Cross-Referenced.

3. Specify the model, as shown in Figure 4.50.

Figure 4.50 Choice Dialog Box for Daganzo Data with Multiple Tables 

Choice Dialog Box for Daganzo Data with Multiple Tables

4. Click Run Model.

The resulting parameter estimate now expresses the utility coefficient for Travel Time.

Figure 4.51 Parameter Estimate for Travel Time of Daganzo Data 

Parameter Estimate for Travel Time of Daganzo Data

The negative coefficient implies that increased travel time has a negative effect on consumer utility or satisfaction. The likelihood ratio test result indicates that the Choice model with the effect of Travel Time is significant.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).