用于INLA固定效应系数ggplots的R库
ggplot for INLA Fixed Effect Coefficients
You can get it using:
devtools::install_github("hesscl/coefINLA")
coefINLA()
is currently the only function in this library, and requires an INLA
model as it’s main argument (mod.inla
)
exp = TRUE
intercept = FALSE
exclude = 'varname'
or include multiple colnames with c()
your_labeller()
for ggplot, and utilize this with the function’s labeller
argument.bayesplot::mcmc_areas()
. coefINLA()
uses the middle 95% and is based on integrated nested laplace approximation (cuz’ you’re using INLA
).
#setup your model, run it through INLA
mod1 <- inla(form1, data = df, ...)
#default
coefINLA(mod1)
#for those that don't like purple...
coefINLA(mod1, "Blues")
#add title
coefINLA(mod1) +
labs(title = "My fancy title")
#remove intercept
coefINLA(mod1, intercept = FALSE)
#save plot with title to pdf
coefINLA(mod1) +
labs(title = "My fancy title") +
ggsave(filename = "my fancy file.pdf")