R 中的 mlogit 包:具有替代特定变量且没有拦截

mlogit package in R: with alternative specific variables and without intercept

我是 R 的新手,我正在尝试 运行 一个具有替代特定变量且没有拦截的 logit 模型。我已经检查了文档,但似乎当我 运行 具有替代特定变量的模型时,截距总是包含在内。谁能告诉我如何 运行 不拦截模型?谢谢。 以下是我尝试过的。我使用R中mlogit包中的数据集Fishing

m.fishing.1 <- mlogit(mode ~ price + catch | income, data = df.fishing, reflevel = "beach");

在模型公式规范中使用 +0 来排除截距。来自 mlogit::mFormula() 的帮助:

data("Fishing", package = "mlogit")
Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice =
                      "mode")    
f3 <- mFormula(mode ~ price + catch | income + 0)
mlogit(f3,Fish)

...输出:

> mlogit(f3,Fish)

Call:
mlogit(formula = mode ~ price + catch | income + 0, data = Fish,     method = "nr")

Coefficients:
         price           catch     income:boat  income:charter     income:pier  
   -2.1597e-02      7.1208e-01      2.1014e-04      2.4498e-04      3.1272e-05  

>