ChoiceModelR - Hierarchical Bayes Multinomial Logit Model

心已入冬 提交于 2019-12-08 13:55:26

I know that this may not be helpful since you posted so long ago, but if it comes up again in the future, this could prove useful.

One of the most common reasons for this error (in my experience) has been that either the scenario variable or the alternative variable is not in ascending order within your data.

id    scenario    alt    x1   ...    y
1     1           1      4           1
1     1           2      1           0
1     3           1      4           2
1     3           2      5           0
2     1           4      3           1
2     1           5      1           0
2     2           1      4           2
2     2           2      3           0

This dataset will give you errors since the scenario and alternative variables must be ascending, and they must not skip any values. Just to fully reiterate what I mean, the scenario and alt variables must be reordered as follows in order to work:

id    scenario    alt    x1   ...    y
1     1           1      4           1
1     1           2      1           0
1     2           1      4           2
1     2           2      5           0
2     1           1      3           1
2     1           2      1           0
2     2           1      4           2
2     2           2      3           0

I work with ChoiceModelR quite frequently, and this is what has caused these errors for me in the past. If you have a github account, you can also post your data (or modified data) there if you end up wanting to have other users take a look.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!