问题描述
我试图从 mlogit
包派生的多项式模型中获取边际效应,但它显示了错误。任何人都可以提供一些指导来解决问题吗?非常感谢!
# data
df1 <- structure(list(Y = c(3,4,1,2,3,5,3),D = c(12,8,6,11,14,22,15,13,18,9,10,28,16,17,26,23,12,30,24,27,7,25,21,19,20,29,15
),x1 = c(13,11),x2 = c(12,13)),class = "data.frame",row.names = c(NA,-100L))
library(mlogit)
mld <- mlogit.data(df1,choice="Y",shape="wide") # shape data for `mlogit()`
mlfit <- mlogit(Y ~ 1 | D + x1 + x2,reflevel="1",data=ml.d) # fit the model
effects(mlfit) # this shows the following error:
Error in if (rhs %in% c(1,3)) { : argument is of length zero
Called from: effects.mlogit(mlfit)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)