Is there a way of getting “marginal effects” from a `glmer` object

后端 未结 4 1457
孤独总比滥情好
孤独总比滥情好 2020-12-28 15:59

I am estimating random effects logit model using glmer and I would like to report Marginal Effects for the independent variables. For glm models, p

4条回答
  •  时光说笑
    2020-12-28 16:30

    Here's an approach using the margins() package:

    library(margins)
    library(lme4)
    
    gm1 <- glmer(cbind(incidence, size - incidence) ~ period +
                     (1 | herd),
                 data = cbpp,
                 family = binomial)
    
    m <- margins(gm1, data = cbpp)
    m
    

提交回复
热议问题