是否可以在 mlogit 模型中引入替代特定变量和单个特定变量之间的交互项

Is it possible to introduce an interaction term between an alternative specific and an individual specific variable to a mlogit modell

我正在尝试使用 r 函数 mlogit 预测选择实验的选项。我有替代的特定变量和个别特定变量。现在,我想介绍一个替代特定变量与单个特定变量之一之间的交互项。因此我的问题是:这可能吗?如果是,必须如何指定公式?如果没有,是否有其他支持此功能的软件包?

在介绍mlogit(http://www2.uaem.mx/r-mirror/web/packages/mlogit/vignettes/mlogit.pdf)的论文中,alternative和individual specific variables的使用规定如下(x1为alternative specific variable,x2为individual specific):

f1 <- mFormula(y ~ x1 | x2)

所以我尝试了几种变体,但其中 none 产生了预期的结果:

f1 <- mFormula(y ~ x1 | x1*x2 | x2)
f1 <- mFormula(y ~ x1*x2 | x2)
f1 <- mFormula(y ~ x1 | x1*x2)

响应。由于奇异性,我总是得到错误(倒数条件数不同,但错误保持不变):

Error in solve.default(H, g[!fixed]) : 
  system is computationally singular: reciprocal condition number = 3.99539e-21

在数学上不可能用备选变量和单个交互变量的交互来估计系统,因为系统变得奇异。直觉上,通过引入这种互动,你想说一些人更有可能购买某种替代品 - 但这种情况已经 "covered" 由 individual-specific 个变量决定。

见论文第 7 页:

One has to consider three kinds of variables:

  • alternative specific variables x_ij with a generic coefficient beta,
  • individual specific variables z_i with an alternative specific coefficients gamma_j,
  • alternative specific variables w_ij with an alternative specific coefficient delta_j

我想情况2就是你想要的。