dataZINB | R Documentation |
Datasets to simulate Small Area Estimation using Hierarchical Bayesian Method under Zero Inflated Negative Binomial.
This data is generated by these following steps:
Generate sampling random area effect u
and v
with u ~ N(0,1)
and v ~ N(0,1)
.
The auxiliary variables are generated by uniform and bernoulli distribution with x1 ~ U(0,1)
and x2 ~ B(1,0.6)
.
The coefficient parameters β0, β1, β2, γ0, γ1, γ2 are set with a certain values. For the reference, see Desjardins, C.D. (2013).
Calculate π = exp(γ0 + x1γ1 + x2γ2 + u) / 1 + exp(γ0 + x1γ1 + x2γ2 + u)
Calculate μ = exp(β0 + x1β1 + x2β2 + v)
Generate direct estimate with y ~ rzinegbin
(μ, π, r), we set r = 2. Using library(VGAM)
Calculate the variance of y
with var(y)
= μ * (1 - π) * (1 + (μ / r) + (μ * π))
Auxiliary variables x1,x2
, direct estimation y
and vardir
are combined in a dataframe called dataZINB
data(dataZINB)
A data frame with 50 rows and 4 variables::
Direct Estimation of y
Auxiliary variable of x1
Auxiliary variable of x2
Sampling Variance of y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.