summary.fitsae: Summary Method for 'fitsae' Objects

View source: R/summary_fitsae.R

summary.fitsaeR Documentation

Summary Method for fitsae Objects

Description

Summarizing the small area model fitting through the distributions of estimated parameters and derived diagnostics using posterior draws.

Usage

## S3 method for class 'fitsae'
summary(
  object,
  probs = c(0.025, 0.25, 0.5, 0.75, 0.975),
  compute_loo = TRUE,
  ...
)

Arguments

object

An instance of class fitsae.

probs

A numeric vector of quantiles of interest. The default is c(0.025,0.25,0.5,0.75,0.975).

compute_loo

Logical, indicating whether to compute loo diagnostics or not.

...

Currently unused.

Details

If printed, the produced summary displays:

  • Posterior summaries about the fixed effect coefficients and the scale parameters related to unstructured and possible structured random effects.

  • Model diagnostics summaries of (a) model residuals; (b) standard deviation reductions; (c) Bayesian P-values obtained with the MCMC samples.

  • Shrinking Bound Rate.

  • loo information criteria and related diagnostics from the loo package.

Value

A list of class summary_fitsae containing diagnostics objects:

raneff

A list of data.frame objects storing the random effects posterior summaries divided for each type: ⁠$unstructured⁠, ⁠$temporal⁠, and ⁠$spatial⁠.

fixed_coeff

Posterior summaries of fixed coefficients.

var_comp

Posterior summaries of model variance parameters.

model_estimates

Posterior summaries of the parameter of interest \theta_d for each in-sample domain d.

model_estimates_oos

Posterior summaries of the parameter of interest \theta_d for each out-of-sample domain d.

is_oos

Logical vector defining whether each domain is out-of-sample or not.

direct_est

Vector of input direct estimates.

post_means

Model-based estimates, i.e. posterior means of the parameter of interest \theta_d for each domain d.

sd_reduction

Standard deviation reduction, see details section.

sd_dir

Standard deviation of direct estimates, given as input if type_disp="var".

loo

The object of class loo, for details see loo package documentation.

shrink_rate

Shrinking Bound Rate, see details section.

residuals

Residuals related to model-based estimates.

bayes_pvalues

Bayesian p-values obtained via MCMC samples, see details section.

y_rep

An array with values generated from the posterior predictive distribution, enabling the implementation of posterior predictive checks.

diag_summ

Summaries of residuals, standard deviation reduction and Bayesian p-values across the whole domain set.

data_obj

A list containing input objects including in-sample and out-of-sample relevant quantities.

model_settings

A list summarizing all the assumptions of the input model: sampling likelihood, presence of intercept, dispersion parametrization, random effects priors and possible structures.

call

Image of the function call that produced the input fitsae object.

References

\insertRef

janicki2020propertiestipsae

\insertRef

vehtari2017practicaltipsae

\insertRef

JSStipsae

See Also

fit_sae to estimate the model and the generic methods plot.summary_fitsae and density.summary_fitsae, and functions map, benchmark and extract.

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 via summary() method
summ_beta <- summary(fit_beta)
summ_beta

tipsae documentation built on Sept. 13, 2024, 5:07 p.m.