density.summary_fitsae {tipsae} | R Documentation |
Density Plot Function for a summary_fitsae
Object
Description
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.
Usage
## S3 method for class 'summary_fitsae'
density(x, grid = TRUE, ...)
Arguments
x |
Object of class |
grid |
Logical indicating whether plots are displayed in a grid ( |
... |
Currently unused. |
Value
Two ggplot2
objects in a grid or in sequence.
See Also
summary.fitsae
to produce the input object.
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)
[Package tipsae version 1.0.2 Index]