-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
Description
I’ve created a model using the glmmTMB package which produces acceptable results. My model uses several years of data. The years are included as a random intercept.
I have plotted the model using jtools. I’m happy with the combined year plot. Next, I want to plot the individual years using GGPLOT’s facet_wrap function.
library(jtools)
library(ggplot2)
library(glmmTMB)
data(mpg)
fit <- glmmTMB(cty ~ displ + (1 | year), data = mpg)
jtools::effect_plot(fit, pred = displ,
interval = TRUE,
groups = list(year = unique(mpg$year)))
I've tried a few variations on the following code:
effect_plot(
fit,
pred = displ,
interval = TRUE,
groups = unique(mpg$year))
I've also tried using '+ facet_wrap(~year, ncol = 2)' but it produces the same plot given in my example code.
Thanks for any suggestions.