我正在尝试建模多级多项Logistic回归。 我有42个科目,每人82个观察。在每次观察中,对象(“VP”)能够以三种不同的方式作出反应
mldata <- mlogit.data(data1, choice = "reaction.response", shape ="wide",
alt.levels = c("reaction1","reaction2", "reaction3"), id.var
="VP")
为了实现随机预测器,我尝试了这个:
mod1<- mlogit(reaction.response ~ 1|TTC_ego_changer +TTC_changer_truck +
HW_changer_truck +HW_ego_changer,
data = mldatalong, panel = TRUE,
rpar = c("reaction2:TTC_ego_changer" = "n",
"reaction3:TTC_ego_changer" = "n" ),
R = 500, halton = NA)
但是我怎样才能让科目(“VP”)成为2级单位?随机斜率应该超过这42个科目。
对不起英语和新手的不良行为:(