cnchapman / choicetools

Tools for Choice Modeling, Conjoint Analysis, and MaxDiff analysis of Best-Worst Surveys
Apache License 2.0
27 stars 14 forks source link

Calculating HB in R using Sawtooth Software output(.cho and design) as a input #1

Open adaliahmet opened 4 years ago

adaliahmet commented 4 years ago

Hi, Many thanks for this library. We are using SSI licensed program tool for scripting and conjoint analysis. HB analysis takes many times when attributes and levels are higher. I wondering is it possible to calculating utilities (HB) in R using Sawtooth Software output which is we get after data collection .cho file or single-line CSV file in your library and how? :)

cnchapman commented 4 years ago

Hi there --

I am not sure I understand. It seems that you would like to estimate a CBC with data from a Sawtooth Software study. But choicetools in R is too slow for you. If so, I have a few suggestions:

  1. Sawtooth Software's estimation is especially fast. I would suggest to use that if speed is of concern. I do not know a way to call Sawtooth Software from R. However, you might look on their site for command-line tools; they used to have a command-line program for CBC HB. If that is available, you could perhaps call it with a system call from R.

  2. Choicetools gets slower as MCMC runs are longer. This appears to reflect memory usage in the choicemodelr dependency. You can increase speed by doing smaller MCMC runs at a time -- such as 2500 iterations at a time -- and restarting the sampler. For example, to get 50000 iterations, you might start with 1 run of 2500 iterations, and then 19 more runs of 2500 with "restart=TRUE" so each one will pick up from the previous estimate.

  3. Another option would be to use mlogit instead of choicetools; see Chapter 13 in my book http://r-marketing.r-forge.r-project.org/Instructor/slides-index.html with Elea Feit for more on that. Mlogit is a classical (not Bayesian) approach. It is not necessarily faster than choicetools, just different.

  4. Finally, you might use the Stan modeling language to estimate CBC. It can be much faster but needs more extensive work to define the model and set up the data. Kevin Van Horn and Elea Feit have notes on that here: https://github.com/ksvanhorn/ART-Forum-2017-Stan-Tutorial

Option #2 is probably the simplest, assuming you want to do the estimation in R. Best,

-- Chris

On Tue, Mar 3, 2020 at 1:46 AM adaliahmet notifications@github.com wrote:

Hi, Many thanks for this library. We are using SSI licensed program tool for scripting and conjoint analysis. HB analysis takes many times when attributes and levels are higher. I wondering is it possible to calculating utilities (HB) in R using Sawtooth Software output which is we get after data collection .cho file or single-line CSV file in your library and how? :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cnchapman/choicetools/issues/1?email_source=notifications&email_token=ABG7RQVHR2B2I34WGIE4OQ3RFTGYJA5CNFSM4LAGQ5D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IR6ZJRA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG7RQUV5FC7MYJ3COIJJVLRFTGYJANCNFSM4LAGQ5DQ .