hbsae | R Documentation |
This function performs Hierarchical Bayesian Small Area Estimation (HBSAE). It estimates predictions and computes the Relative Standard Error (RSE) based on the posterior predictive sample from the fitted Bayesian model.
hbsae(model, newdata = NULL)
model |
A |
newdata |
A dataset for making predictions. |
Hierarchical Bayesian Small Area Estimation
An object of class hbsae_results
, which is a list containing:
rse_model |
A numeric value indicating the overall relative standard error (RSE) of the model. |
mse_model |
A numeric value indicating the overall mean squared error (MSE) of the model estimates, representing the average estimation error across areas. |
result_table |
A |
Achmad Syahrul Choir and Saniyyah Sri Nurhayati
Bürkner, P. C. (2017). brms: An R package for Bayesian multilevel models using Stan. Journal of Statistical Software, 80(1), 1-28.
library(hbsaems)
data("data_fhnorm")
# Prepare the dataset
data <- data_fhnorm
# Fit the Basic Model
model <- hbm(
formula = bf(y ~ x1 + x2 + x3), # Formula model
hb_sampling = "gaussian", # Gaussian family for continuous outcomes
hb_link = "identity", # Identity link function (no transformation)
data = data, # Dataset
chains = 4, # Number of MCMC chains
iter = 4000, # Total MCMC iterations
warmup = 2000, # Number of warmup iterations
cores = 2 # Parallel processing
)
summary(model)
# Small Area Estimates
hbsae(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.