extract {tipsae} | R Documentation |
Extract Posterior Summaries of Target Parameters
Description
The extract()
function provides the posterior summaries of target parameters, including model-based estimates, and possibly benchmarked estimates, related to a fitted small area model.
Usage
extract(x)
Arguments
x |
An object of class |
Value
An object of class estimates_fitsae
, being a list of two data frames, distinguishing between $in_sample
and $out_of_sample
areas, which gathers domains name, direct and HB estimates, as well as posterior summaries of target parameters. When the input is a benchmark_fitsae
object, benchmarked estimates are also included.
See Also
summary.fitsae
and benchmark
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)
# extract model estimates
HB_estimates <- extract(summ_beta)
head(HB_estimates)
[Package tipsae version 1.0.2 Index]