Description Usage Arguments Value Examples
This function calculates MSE of EBLUP's based on unit level using Geoadditive Small Area Model
1 |
formula |
the model that to be fitted |
zspline |
n*k matrix that used in model for random effect of spline-2 (n is the number of observations, and k is the number of knots used) |
dom |
a*1 vector with domain codes (a is the number of small areas) |
xmean |
a*p matrix of auxiliary variables means for each domains (a is the number of small areas, and p is the number of auxiliary variables) |
zmean |
a*k matrix of spline-2 means for each domains |
data |
data unit level that used as data frame that containing the variables named in formula and dom |
B |
the number of iteration bootstraping |
This function returns a list of the following objects:
est |
A list containing the following objects: |
eblup: A Vector with a list of EBLUP with Geoadditive Small Area Model
fit: A list of components of the formed Geoadditive Small Area Model that containing the following objects such as model structure of the model, coefficients of the model, method, and residuals
sigma2: Variance (sigma square) of random effect and error with Geoadditive Small Area Model
mse |
A vector with a list of estimated mean squared error of EBLUPs estimators |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #Load the dataset for unit level
data(dataUnit)
#Load the dataset for spline-2
data(zspline)
#Load the dataset for area level
data(dataArea)
#Construct data frame
y <- dataUnit$y
x1 <- dataUnit$x1
x2 <- dataUnit$x2
x3 <- dataUnit$x3
formula <- y~x1+x2+x3
zspline <- as.matrix(zspline[,1:6])
dom <- dataUnit$area
xmean <- cbind(1,dataArea[,3:5])
zmean <- dataArea[,7:12]
number <- dataUnit$number
area <- dataUnit$area
data <- data.frame(number, area, y, x1, x2, x3)
#Estimate MSE
mse_geosae <- pbmsegeo(formula,zspline,dom,xmean,zmean,data,B=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.