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.
extract(x)
Arguments
x: An object of class summary_fitsae or benchmark_fitsae.
Returns
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.
Examples
library(tipsae)# loading toy datasetdata("emilia_cs")# fitting a modelfit_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 diagnosticssumm_beta <- summary(fit_beta)# extract model estimatesHB_estimates <- extract(summ_beta)head(HB_estimates)
See Also
summary.fitsae and benchmark to produce the input object.