dataPanelbeta {saeHB.panel.beta} | R Documentation |
Sample Data under Beta Distribution for Small Area Estimation using Hierarchical Bayesian Method for Rao Yu Model when rho = 0
Description
Dataset under Beta Distribution to simulate Small Area Estimation using Hierarchical Bayesian Method for Rao-Yu Model with rho = 0 This data is generated by these following steps:
Generate random effect area
v
, random effect for area i at time point ju
, epsilon\epsilon
, variance of ydivardir
, sampling errore
, auxiliaryxdi1
andxdi2
Set coefficient
\beta_{0}=\beta_{1}=\beta_{2}=2
Generate random effect area
v_{i}~N(0,1)
Generate auxiliary variable
xdi1_{ij}~U(0,1)
Generate auxiliary variable
xdi2_{ij}~U(0,1)
Generate epsilon
\epsilon_{ij}
~N(0,1)
Generate
\phi_{ij}
~Gamma(1,0.5)
Calculate
\mu_{ij}=\frac{\exp{\beta_{0}+\beta_{1}xdi1_{ij}+\beta_{2}xdi2_{ij}+v_{i}+\epsilon_{ij}}}{(1+\exp{\beta_{0}+\beta_{1}xdi1_{ij}+\beta_{2}xdi2_{ij}+v_{i}+\epsilon_{ij}})}
Calculate
A_{ij}=\mu_{ij}*\phi_{ij}
Calculate
B_{ij}=(1-\mu_{ij})*\phi_{ij}
Generate ydi
y_{ij}~Beta(A_{ij},B_{ij})
Calculate variance of ydi with
vardir_{ij}=\frac{(A_{ij})(B_{ij})}{(A_{ij}+B_{ij})^2(A_{ij}+B_{ij}+1)}
Set
area=20
andperiod=5
Auxiliary variables
xdi1,xdi2
, direct estimationy
,area
,period
, andvardir
are combined in a dataframe calleddataPanel
Usage
dataPanelbeta
Format
A data frame with 100 rows and 6 variables:
- ydi
Direct Estimation of y
- area
Area (domain) of the data
- period
Period (subdomain) of the data
- vardir
Sampling Variance of y
- xdi1
Auxiliary variable of xdi1
- xdi2
Auxiliary variable of xdi2