View source: R/beta_nonspatial.R
| beta_nonspatial | R Documentation |
This function gives small area estimator under Non-Spatial Model. It is implemented to a variable of interest (y) that is assumed to follow a Beta Distribution. The range of data is 0 < y < 1.
beta_nonspatial(
formula,
data,
iter.update = 3,
iter.mcmc = 2000,
thin = 1,
burn.in = 1000,
chains = 2,
n.adapt = 1000,
coef = NULL,
var.coef = NULL,
tau.v = 1,
seed = 123,
quiet = FALSE,
plot = TRUE,
keep.fit = FALSE
)
formula |
Formula that describes the fitted model. |
data |
The data frame. |
iter.update |
Number of updates performed during Gibbs sampling. Default is |
iter.mcmc |
Total number of MCMC iterations per chain. Default is |
thin |
Thinning rate for MCMC sampling. Must be a positive integer. Default is |
burn.in |
Number of burn-in iterations discarded from each MCMC chain. Default is |
chains |
Number of parallel MCMC chains. Default is |
n.adapt |
Number of iterations used for the adaptation phase in JAGS. Default is |
coef |
Optional vector containing the mean of the prior distribution of the regression model coefficients. |
var.coef |
Optional vector containing the variances of the prior distribution of the regression model coefficients. |
tau.v |
Initial value or shape for the random effect precision. Default is |
seed |
An integer seed for the random number generator to ensure reproducibility. Default is |
quiet |
Logical; if |
plot |
Logical; if |
keep.fit |
Logical; if |
This function returns a list with the following objects:
A dataframe containing the posterior mean estimates, posterior standard deviations, and 95% credible intervals of the small area means estimated using the Hierarchical Bayesian method.
A dataframe containing the posterior mean estimates, posterior standard deviations, and 95% credible intervals of the area-specific random effects (v).
A dataframe containing the posterior mean estimates, posterior standard deviations, and 95% credible intervals of the global random effect variance (\sigma_{v}^{2}).
A dataframe containing the posterior mean estimates, posterior standard deviations, 95% credible intervals, Rhat convergence diagnostics, and effective sample sizes (ESS) for the regression coefficients (\beta) and the global precision parameter (\phi).
# Load dataset
data(databeta)
# Fit the Non-Spatial Beta model
result <- beta_nonspatial(
formula = y ~ x1 + x2,
data = databeta
)
# View the estimation results
# 1. Small Area Estimates
result$est
# 2. Estimated area-specific random effects
result$randeff
# 3. Estimated global variance of the random effects
result$refvar
# 4. Estimated regression coefficients and precision parameter
result$coefficient
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.