Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How to export CBC data into STATA to run mixed-logit model

Hi,

There is a similar question that was already on here however I'm not sure it applies to the Discover Platform.

Using Discover I designed a survey that has a CBC with 5 questions and 4 concepts presented followed by socio-demographic questions.

There are two attributes:
Attribute 1: 4 levels
Attribute 2: 5  levels

When I go into survey reports and download the survey data it just lists the 20 combinations presented in the following format:

[[1,4,5],[2,1,3],[3,2,4],[4,3,2],[5,2,5],[6,3,4],[7,4,1],[8,1,2],[9,3,4],[10,1,1],[11,2,5],[12,4,3],[13,3,3],[14,4,4],[15,1,1],[16,2,2],[17,3,5],[18,1,1],[19,4,2],[20,2,3]]

Then it has given me a value for the choice made for each exercise. The issue I have here is importing this data into STATA in a form that will then enable me to analyse and run a panel data mixed logit model.

Can someone please help me?
asked Mar 10 by anonymous

1 Answer

0 votes
 
Best answer
From the Data page instead of Download Data go to the Advanced Settings tab.
There is an 'Export CBC Design and Choices' option which will I think give you what you want.

From that downloaded CSV file you will probably want to recode the levels of the attributes in the design (1,2,3..) to the  levels of the attributes (price =20,50,100,..etc).

You use 'reshape' in Stata to get the data into the right layout.

The CBC Design and Choices data will  just be attribute levels and choices. You can combine with information about respondents (age. gender,..) by downloading the main data file and using 'merge' in Stata (on respondent ID) to combine the 2 files.


Dan
answered Mar 10 by dan r Bronze (2,830 points)
edited Mar 11 by dan r
Hi Dan, Thanks I have managed to download it as per your instructions however I am struggling to combine the two data sets in STATA.
This should help
https://www.stata.com/manuals/dmerge.pdf

Both datasets need to be sorted by the linking variable (example 'respid')
Your choice data (‘choicedata’) will have many rows per respid
Your full data (‘maindata’) will have 1 row per respid

So if you are in maindata you will be matching one : many

You need something like:
 merge 1:m respid using choicedata

Or if working in  choicedata:
merge m:1 respid using maindata
...