Function betaTF used for estimation of subarea and area means simultaneously under Twofold Subarea Level Small Area Estimation Model Using Hierarchical Bayesian Method with Beta distribution
The range of data must be \(0<y<1\).
betaTF(
formula,
area,
weight,
iter.update = 3,
iter.mcmc = 1000,
coef = NULL,
var.coef = NULL,
thin = 1,
burn.in = floor(iter.mcmc/2),
sigma2.u = 1,
sigma2.v = 1,
data
)This function returns a list with following objects:
A dataframe contains the values, standard deviation, and quantile of Subarea mean Estimates using Twofold Subarea level model under Hierarchical Bayes method
A dataframe contains the values, standard deviation, and quantile of Area mean Estimates using Twofold Subarea level model under Hierarchical Bayes method
A dataframe contains area random effect
A dataframe contains subarea random effect
A dataframe that contains estimated subarea and area random effect variance \((\sigma_{u}^{2}\) and \(\sigma_{v}^{2})\)
A dataframe that contains the estimated model coefficient \(\beta\)
Trace, Density, Autocorrelation Function Plot of coefficient
Formula that describe the fitted model
Index that describes the code relating to area in each subarea.This should be defined for aggregation to get area estimator. Index start from 1 until m
Vector contain proportion units or proportion of population on each subarea. \(w_{ij}\)
Number of updates perform ( default = 3)
Number of total iterations per chain (default = 1000)
Vector contains prior initial value of Coefficient of Regression Model for fixed effect with default vector of 0 with the length of the number of regression coefficients
Vector contains prior initial value of variance of Coefficient of Regression Model for fixed effect with default vector of 1 with the length of the number of regression coefficients
Thinning rate, must be a positive integer
Number of iterations to discard at the beginning
Number of prior initial value of variance of subarea random effect
Number of prior initial value of variance of area random effect
The data frame
fit <- betaTF(y~X1+X2,area="codearea",weight="w",data=dataBeta, iter.mcmc = 500)
Run the code above in your browser using DataLab