# Poisson GLMM
count_mod <- galamm(
formula = y ~ lbas * treat + lage + v4 + (1 | subj),
data = epilep, family = poisson
)
# Plot response versus link:
plot(
predict(count_mod, type = "link"),
predict(count_mod, type = "response")
)
# Predict on a new dataset
nd <- data.frame(lbas = c(.3, .2), treat = c(0, 1), lage = 0.2, v4 = -.2)
predict(count_mod, newdata = nd)
predict(count_mod, newdata = nd, type = "response")
Run the code above in your browser using DataLab