density.summary_fitsae function

Density Plot Function for a summary_fitsae Object

Density Plot Function for a summary_fitsae Object

The method density() provides, in a grid (default) or sequence, the density plot of direct estimates versus HB model estimates and the density plot of standardized posterior means of the random effects versus standard normal.

## S3 method for class 'summary_fitsae' density(x, grid = TRUE, ...)

Arguments

  • x: Object of class summary_fitsae.
  • grid: Logical indicating whether plots are displayed in a grid (TRUE) or in sequence (FALSE).
  • ...: Currently unused.

Returns

Two ggplot2 objects in a grid or in sequence.

Examples

library(tipsae) # loading toy dataset data("emilia_cs") # fitting a model fit_beta <- fit_sae(formula_fixed = hcr ~ x, data = emilia_cs, domains = "id", type_disp = "var", disp_direct = "vars", domain_size = "n", # MCMC setting to obtain a fast example. Remove next line for reliable results. chains = 1, iter = 150, seed = 0) # check model diagnostics summ_beta <- summary(fit_beta) # visualize estimates and random effect densities via density() function density(summ_beta)

See Also

summary.fitsae to produce the input object.

  • Maintainer: Silvia De Nicolò
  • License: GPL-3
  • Last published: 2024-09-13

Useful links