model <- glmer(protest ~ factora*factorb*numeric+factora+factorb+numeric+1 + (1 + factor1|level1) + (1|level2), data=data, family=binomial(link='logit'))
哪里
factora
和
factorb
numeric
是一个数值变量。
因素
常数为3,介于
系数B
(1-5)在数值范围内。
我尝试了以下选择,但没有成功:
library(psycho)
get_contrasts(model, formula="factora:factorb:numeric", adjust="tukey")
View(contrasts$contrasts)
这是可行的,但不幸的是结果是
数字
不变且仅变化
因素
系数B
. 因此,它没有回答我的问题。
library(multcomp)
test = glht(model,linfct=mcp("factora:factorb:numeric"="Tukey"))
这就产生了
Error in mcp2matrix(model, linfct = linfct) :
Variable(s) âfactora:factorb:numericâ have been specified in âlinfctâ but cannot be found in âmodelâ!
不考虑我指定交互的方式,也不考虑其他诸如
get_contrasts
我也试过:
library(emmeans)
contrast(m.3[[2]], interaction = c("factora", "factorb", "numeric"))
但这并不支持glmer。
有什么想法吗?