plot_random_effects: Individual plot functions for INLA objects

View source: R/autoplot_inla.R

plot_random_effectsR Documentation

Individual plot functions for INLA objects

Description

Replicate the individual plots produced by plot using ggplot.

Usage

plot_random_effects(x, type = "line")

plot_fixed_marginals(x, priors = FALSE, CI = FALSE)

plot_hyper_marginals(x, CI = FALSE)

plot_marginals_fitted(x)

Arguments

x

An inla object

type

Which type of plot? 'boxplot' or 'line'

priors

Logical, plot priors as well.

CI

Plot credible intervals. TRUE for 95% CI or a numeric in [0, 1]

Examples

## Not run: 
 library(INLA)
 data(Epil)
 ##Define the model
 formula = y ~ Trt + Age + V4 +
          f(Ind, model="iid") + f(rand,model="iid")
 result = inla(formula, family="poisson", data = Epil, control.predictor = list(compute = TRUE))

 plot_random_effects(result)
 plot_random_effects(result, type = 'boxplot')
 plot_fixed_marginals(result)
 plot_hyper_marginals(result)

## End(Not run)

timcdlucas/INLAutils documentation built on Nov. 29, 2022, 5:41 a.m.