【问题标题】:Error in s + x[[i]] : non-conformable arrays in R - gmnl package for Latent Class Analysiss + x[[i]] 中的错误:R - 用于潜在类分析的 gmnl 包中的不一致数组
【发布时间】:2021-10-07 00:08:04
【问题描述】:

我正在使用 gmnl 包为选择建模运行潜在类分析。在以正确的格式(mlogit.data)获取我的数据后,我在运行 gmnl 模型时遇到了错误“Error in s + x[[i]] : non-conformable arrays”。

运行模型的代码是:

 lc <- gmnl(choice ~ v1 + v2 + v3 + v4 
            + v5| 0 | 0 | 0 | 1, 
           data = car, 
           model = "lc",
           Q = 3,method = 'bhhh')

我的数据样本如下:

我搜索了其他人遇到的类似问题,我发现 thisthis 非常相关,但它们都没有得到解决。任何帮助和提示将不胜感激。

另外,我想听听任何其他可以很好地用于潜在类分析的有用包,R 或 Python 的包都很棒!提前谢谢你。

【问题讨论】:

    标签: r matrix mlogit


    【解决方案1】:

    我认为问题在于所有选择集的备选方案数量并不相同。当您使用 mlogit 时,这不是问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 1970-01-01
      • 2019-01-12
      相关资源
      最近更新 更多