betaTF {saeHB.TF.beta} | R Documentation |
Small Area Estimation using Hierarchical Bayes Twofold Subarea Level Model under Beta Distribution
Description
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
.
Usage
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
)
Arguments
formula |
Formula that describe the fitted model |
area |
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 |
weight |
Vector contain proportion units or proportion of population on each subarea. |
iter.update |
Number of updates perform ( default = |
iter.mcmc |
Number of total iterations per chain (default = |
coef |
Vector contains prior initial value of Coefficient of Regression Model for fixed effect with default vector of |
var.coef |
Vector contains prior initial value of variance of Coefficient of Regression Model for fixed effect with default vector of |
thin |
Thinning rate, must be a positive integer |
burn.in |
Number of iterations to discard at the beginning |
sigma2.u |
Number of prior initial value of variance of subarea random effect |
sigma2.v |
Number of prior initial value of variance of area random effect |
data |
The data frame |
Value
This function returns a list with following objects:
Est_sub |
A dataframe contains the values, standard deviation, and quantile of Subarea mean Estimates using Twofold Subarea level model under Hierarchical Bayes method |
Est_area |
A dataframe contains the values, standard deviation, and quantile of Area mean Estimates using Twofold Subarea level model under Hierarchical Bayes method |
area_randeff |
A dataframe contains area random effect |
sub_randeff |
A dataframe contains subarea random effect |
refVar |
A dataframe that contains estimated subarea and area random effect variance |
coefficient |
A dataframe that contains the estimated model coefficient |
plot |
Trace, Density, Autocorrelation Function Plot of coefficient |
Examples
fit <- betaTF(y~X1+X2,area="codearea",weight="w",data=dataBeta, iter.mcmc = 500)