pbmsegeo: Parametric Bootstrap Mean Squared Error of EBLUP's for domain...

Description Usage Arguments Value Examples

View source: R/pbmseGeo.R

Description

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

Usage

1
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:

mse

A vector with a list of estimated mean squared error of EBLUPs estimators

Examples

 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)

ketutdika/geoSAE documentation built on Dec. 21, 2021, 6:35 a.m.