Title: | Geoadditive Small Area Model |
---|---|
Description: | This function is an extension of the Small Area Estimation (SAE) model. Geoadditive Small Area Model is a combination of the geoadditive model with the Small Area Estimation (SAE) model, by adding geospatial information to the SAE model. This package refers to J.N.K Rao and Isabel Molina (2015, ISBN: 978-1-118-73578-7), Bocci, C., & Petrucci, A. (2016)<doi:10.1002/9781118814963.ch13>, and Ardiansyah, M., Djuraidah, A., & Kurnia, A. (2018)<doi:10.21082/jpptp.v2n2.2018.p101-110>. |
Authors: | Ketut Karang Pradnyadika [aut, cre], Ika Yuni Wulansari [aut, ths] |
Maintainer: | Ketut Karang Pradnyadika <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-21 04:04:36 UTC |
Source: | https://github.com/ketutdika/geosae |
This dataset is data on unit level data which is averaged by area.
dataArea
dataArea
A data frame with 15 areas on the following 15 variables:
Domain codes
Mean of auxiliary variable of X1
Mean of auxiliary variable of X2
Mean of auxiliary variable of X3
Mean of z1 in Unit Level
Mean of z2 in Unit Level
Mean of z3 in Unit Level
Mean of z4 in Unit Level
Mean of z5 in Unit Level
Mean of z6 in Unit Level
Mean of z7 in Unit Level
Mean of z8 in Unit Level
Mean of z9 in Unit Level
Mean of z10 in Unit Level
the number of samples per area is small (sample size in area)
mean of direct estimation Y
varians of direct estimation Y
This dataset is data on unit level, dan this data will be implemented with the Geoadditive Small Area Model
dataUnit
dataUnit
A data frame with 210 observations on the following 7 variables:
Order of observation
Domain codes
Direct Estimation of Y
Auxiliary variable of X1
Auxiliary variable of X2
Auxiliary variable of X3
This function calculates EBLUP's based on unit level using Geoadditive Small Area Model
eblupgeo(formula, zspline, dom, xmean, zmean, data)
eblupgeo(formula, zspline, dom, xmean, zmean, data)
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 |
This function returns a list of 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 |
#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 the 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 EBLUP eblup_geosae <- eblupgeo(formula, zspline, dom, xmean, zmean, data)
#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 the 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 EBLUP eblup_geosae <- eblupgeo(formula, zspline, dom, xmean, zmean, data)
This function calculates MSE of EBLUP's based on unit level using Geoadditive Small Area Model
pbmsegeo(formula, zspline, dom, xmean, zmean, data, B = 100)
pbmsegeo(formula, zspline, dom, xmean, zmean, data, B = 100)
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 |
#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)
#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)
This dataset is obtained from the calculation of the optimum GCV (Generalized Cross Validation), where there are 10 knots that have the lowest GCV value.
zspline
zspline
A data frame with 210 observations on the following 10 variables (number of knots used)