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

后端 未结 4 1492
孤独总比滥情好
孤独总比滥情好 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:49

    You could use the ggeffects-package (examples in the package-vignettes). So, for your code this might look like this:

    library(ggeffects)
    # dat is a data frame with marginal effects
    dat <- ggpredict(cfelr, term = "rank")
    plot(dat)
    

    or you use, as Benjamin described, the You could use the sjPlot-package, using the plot_model() function with plot-type "pred" (this simply wraps the ggeffects package for marginal effect plots):

    library(sjPlot)
    plot_model(cfelr, type = "pred", term = "rank")
    

提交回复
热议问题