meHBt {saeHB.ME} | R Documentation |
Small Area Estimation with Measurement Error using Hierarchical Bayesian Method under Student-t Distribution
Description
This function is implemented to variable of interest (y)
that assumed to be a Normal Distribution when auxiliary variable is measured with error.
Usage
meHBt(
formula,
vardir,
var.x,
coef,
var.coef,
iter.update = 3,
iter.mcmc = 10000,
thin = 2,
tau.u = 1,
burn.in = 2000,
data
)
Arguments
formula |
an object of class |
vardir |
vector containing the |
var.x |
vector containing mean squared error of |
coef |
a vector contains prior initial value of Coefficient of Regression Model for fixed effect with default vector of |
var.coef |
a vector contains prior initial value of variance of Coefficient of Regression Model with default vector of |
iter.update |
number of updates with default |
iter.mcmc |
number of total iterations per chain with default |
thin |
thinning rate, must be a positive integer with default |
tau.u |
prior initial value of inverse of Variance of area random effect with default |
burn.in |
number of iterations to discard at the beginning with default |
data |
the data frame. |
Value
This function returns a list with the following objects:
Est |
A vector with the values of Small Area mean Estimates using Hierarchical bayesian method |
refVar |
Estimated random effect variances |
coefficient |
A data frame with the estimated model coefficient |
plot |
Trace, Dencity, Autocorrelation Function Plot of MCMC samples |
Examples
## Load dataset
data(dataTMEHB)
## Auxiliary variables only contains variable with error
example <- meHBt(Y~x1, vardir = "vardir",
var.x = c("v.x1"), iter.update = 3, iter.mcmc = 10000,
thin = 5, burn.in = 1000, data = dataTMEHB)
## Auxiliary variables contains variable with error and without error
example_mix <- meHBt(Y~x1+x2, vardir = "vardir",
var.x = c("v.x1"), iter.update = 3, iter.mcmc = 10000,
thin = 5, burn.in = 1000, data = dataTMEHB)
## Create dataset with nonsampled area
dataTMEHBns <- dataTMEHB
dataTMEHBns[c(1,10,20,30),"Y"] <- NA
## For data with nonsampled area use dataTMEHBns