fitFH: Small Area Estimation under a Fay Herriot model.

Description Usage Arguments References See Also Examples

Description

The function makes the estimation of the best lineal unbiased predictor (EBLUP) based on the Fay Herriot model.

Usage

1
2
fitFH(x, yhat, Sd.yhat, xk, method = "REML", x.predic = NULL,
  formula = NULL)

Arguments

x

data.frame which contains the information necessary to make the estimations.

yhat

Name of the column containing the variable’s estimated values.

Sd.yhat

Name of the column of estimated standard deviation for yhat

xk

vector of characters which contains the names of the covariantes.

method

Estimation method used by the function eblupFH

x.predic

Observations on which the forecast will be made

References

-

Fay, R.E. and Herriot, R.A. (1979). Estimation of income from small places: An application of James-Stein procedures to census data. Journal of the American Statistical Association 74, 269-277.

-

Marhuenda, Y., Morales, D. and Pardo, M.C. (2014). Information criteria for Fay-Herriot model selection. Computational Statistics and Data Analysis 70, 268-280

-

Rao, J.N.K. (2003). Small Area Estimation. Wiley, London.

See Also

S.fitFH, eblupFH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Reading data
data('etc2013')
# Add dummys
etc2013[["IND"]] <- ifelse(is.na(etc2013[["hat.prom"]]), 'NO','SI')
# Identify observations with missing data
etc2013[["IMP"]] <- apply(etc2013[,c('x1','x2','x3','x4')], 1,
                         function(x){ifelse(anyNA(x),'IMP','NO_IMP')})
table(etc2013[,c("IND","IMP")])
# Separate observations
sampling <- subset( etc2013,IND == 'SI' & IMP == 'NO_IMP')
# Variable prediction
predic   <- subset(etc2013,!c(IND == 'SI' & IMP == 'NO_IMP'))
# Impute observations prediction
imp <- mice::mice(predic[,c('x1','x2','x3','x4')], method = 'norm.boot')
predic[,c('x1','x2','x3','x4')] <- complete(imp)

FH <- fitFH(x = sampling, yhat  = "hat.prom", Sd.yhat = "hat.sd",
                 xk = c('x1','x2','x3','x4'), x.predic = predic)

stalynGuerrero/multisae documentation built on May 30, 2019, 8:44 a.m.