Get startedGet started for free

Inspect a choice in two files

The data frame choc_alts contains the alternatives for each choice. The choices are recorded in are in choc_choice Both data frames have a Subject column and a Trial column so that you can match them. Let's inspect one choice to make sure we understand how the two files relate. For subject 2410 choice 8, what was the price of the chocolate she chose? First, you'll have to filter choc_choice to see what alternative she chose (choc_choice$Subject==2410 & choc_choice$Trial==8) and then use the same criteria to filter choc_alts to find the price (choc_alts$Subject==2410 & choc_alts$Trial==8)

This exercise is part of the course

Choice Modeling for Marketing in R

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise