Package 'geoSAE'

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

Help Index


Dataset on Area Level

Description

This dataset is data on unit level data which is averaged by area.

Usage

dataArea

Format

A data frame with 15 areas on the following 15 variables:

area

Domain codes

x1

Mean of auxiliary variable of X1

x2

Mean of auxiliary variable of X2

x3

Mean of auxiliary variable of X3

z1

Mean of z1 in Unit Level

z2

Mean of z2 in Unit Level

z3

Mean of z3 in Unit Level

z4

Mean of z4 in Unit Level

z5

Mean of z5 in Unit Level

z6

Mean of z6 in Unit Level

z7

Mean of z7 in Unit Level

z8

Mean of z8 in Unit Level

z9

Mean of z9 in Unit Level

z10

Mean of z10 in Unit Level

ni

the number of samples per area is small (sample size in area)

ybar_direct

mean of direct estimation Y

se.ybar._direct

varians of direct estimation Y


Dataset on Unit Level

Description

This dataset is data on unit level, dan this data will be implemented with the Geoadditive Small Area Model

Usage

dataUnit

Format

A data frame with 210 observations on the following 7 variables:

number

Order of observation

area

Domain codes

y

Direct Estimation of Y

x1

Auxiliary variable of X1

x2

Auxiliary variable of X2

x3

Auxiliary variable of X3


EBLUP's for domain means using Geoadditive Small Area Model

Description

This function calculates EBLUP's based on unit level using Geoadditive Small Area Model

Usage

eblupgeo(formula, zspline, dom, xmean, zmean, data)

Arguments

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

Value

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

Examples

#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)

Parametric Bootstrap Mean Squared Error of EBLUP's for domain means using Geoadditive Small Area Model

Description

This function calculates MSE of EBLUP's based on unit level using Geoadditive Small Area Model

Usage

pbmsegeo(formula, zspline, dom, xmean, zmean, data, B = 100)

Arguments

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

Value

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

Examples

#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)

Z-Spline

Description

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.

Usage

zspline

Format

A data frame with 210 observations on the following 10 variables (number of knots used)