我正在尝试对多级多项逻辑回归建模。我有 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 个科目上有所不同。
抱歉英语不好和新手行为:(