knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE )
The run_sae_app()
function in the hbsaems
package provides an interactive Shiny Dashboard for Hierarchical Bayesian Small Area Estimation (HBSAE) using brms
for Bayesian inference with Stan
. This application offers a user-friendly interface to upload data, define models, and obtain estimation results without requiring extensive R coding.
Ensure that you have installed the hbsaems
package:
install.packages("hbsaems")
library(hbsaems)
To launch the application, simply call:
run_sae_app()
This will start a Shiny application that runs in your web browser.
Users can either upload a .csv
file or select a data frame available in the current R environment.
.csv
file from your computer.This tab provides four types of data exploration tools to help users understand the characteristics of the dataset:
Users can define key model components:
.csv
)Before fitting the model, users can configure prior distributions and perform prior predictive checks:
Configure sampling parameters for Bayesian estimation:
Click "Fit Model" to begin model fitting using brms
.
After fitting, results are available through multiple tabs:
.csv
or select data from environment.brms
.If you encounter errors when launching the app:
Ensure all dependencies are installed manually:
r
install.packages(c("shiny", "shinyWidgets", "shinydashboard", "readxl", "DT"))
Reinstall hbsaems
:
r
remove.packages("hbsaems")
install.packages("hbsaems")
Check the app directory:
r
system.file("shiny/sae_app", package = "hbsaems")
run_sae_app()
provides an intuitive way to perform HBSAE modeling using a Shiny interface, making Bayesian small area estimation accessible without requiring in-depth coding knowledge. Users can define models, inspect results, and generate predictions interactively.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.