inst/extexamples/as.mcmc-coda.R

### A saved reference grid for a mixed logistic model (see lme4::cbpp)
cbpp.rg <- do.call(emmobj, 
  readRDS(system.file("extdata", "cbpplist", package = "emmeans")))

# Predictive distribution for herds of size 20
# (perhaps a bias adjustment should be applied; see "sophisticated" vignette)
pred.incidence <- coda::as.mcmc(regrid(cbpp.rg), likelihood = "binomial", trials = 20)
summary(pred.incidence)

Try the emmeans package in your browser

Any scripts or data that you put into this service are public.

emmeans documentation built on June 22, 2024, 11:37 a.m.