plot.benchmark_fitsae | R Documentation |
benchmark_fitsae
ObjectThe method plot()
provides the boxplots of original and benchmarked estimates in comparison with the benchmark value. Note that share weights are not considered.
## S3 method for class 'benchmark_fitsae'
plot(x, ...)
x |
A |
... |
Currently unused. |
A ggplot2
object.
benchmark
to produce the input object.
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)
# creating a subset of the areas whose estimates have to be benchmarked
subset <- c("RIMINI", "RICCIONE", "RUBICONE", "CESENA - VALLE DEL SAVIO")
# creating population shares of the subset areas
pop <- emilia_cs$pop[emilia_cs$id %in% subset]
shares_subset <- pop / sum(pop)
# perform benchmarking procedure
bmk_subset <- benchmark(x = summ_beta,
bench = 0.13,
share = shares_subset,
method = "raking",
areas = subset)
plot(bmk_subset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.