Description Usage Arguments Details Value References See Also Examples
Interface for predicting small area means based on a
gwlmm
( or rgwlmm
) model fit.
1 2 3 4 5 6 7 |
object |
(formula) object of class |
popdata |
(data.frame) an optional data frame (Default = NULL). If ommited, in-sample prdictions are estimated. |
size |
(character) name for the column in |
popAgg |
(logical) |
... |
not used |
bcConst |
(numeric) needed for objects of class |
maxit |
(integer) needed for objects of class |
tol |
(numeric) needed for objects of class |
The argument popdata
can have three different definitions:
(1) popdata = NULL
,
(2) popdata
is a data frame for aggregated population information,
(3) popdata
is a data frame for unit-level population information.
In case (1) only in-sample predictions are estimated. In case (2) the size
argument is obligatory.
In case (3) popAgg
must be TRUE
. Population data can contain non-sampled areas.
The method predict
is implemented for three combinations of
geographic information in the sampled (S) and population (P)
data: (1) only centroid information in S and P; (2) unit-level geographic information in S and P;
(3) unit-level geographic information in S and centriod informaton in P.
For objects of class gwlmm
: the MSE estimates for the small area means returned in areaEst
are named CCT
and CCST
. The former is based
on pseudo-linearization following Chambers et al. (2011), and latter is linearization-based following
Chambers et al. (2014).
For objects of class rgwlmm
: the MSE estimates for the small area means returned in areaEst
are named CCT
(and CCT_bc
) and CCST
( and CCST_bc
). The subscript _bc
indicates the respective
MSE estimate for bias corrected robust area mean. The MSE estimates are based on the pseudo-linearizetion (CCT)
and the linearization-based approach in Chambers et al. (2014).
For objects of class rgwlmm
: the bias correction is based on the area-specific prediction error where the influence of extreme
values is restricted using Huber's influence function. cbConst
defines this restriction but
should be less restrictive the k
in rgwlmm
. By default it is set cbConst = 3
.
The function predict.gwlmm
returns a list containing the predictions
If popdata = NULL
, a list with the following elements is returned.
call
(language) the call generating the value
nIter
(numeric) number of iterations needed for the estimation of the
random effects (only for rgwlmm
-objects)
raneff
(numeric) named vector of random effects
residuals
(numeric) vector of restimated residuals
prediction
(numeric) vector of estimated in-sample predicted values
xbeta
(numeric) vector of estimated fixed part of the in-sample predictions
If popdata
is a data.frame a list with the following elements is returned.
call
(language) the call generating the value
nIter
(numeric) number of iterations needed for the estimation of the
random effects (only for rgwlmm
-objects)
areaEst
(data.frame) a data frame containing area-specific mean predictions and MSE estimates.
ranEff
(data.farme) a data frame containing the random effects.
sampleEst
(data.frame) a data frame containing the in-sample
predictions (prediction, residuals, xbeta)
Chambers, R., J. Chandra, and N. Tzavidis (2011). On bias-robust mean squared error estimation for pseudo-linear small area estimators. Survey Methodology 37 (2), 153 - 170.
Chambers, R., H. Chandra, N. Salvati, and N. Tzavidis (2014). Outlier robust small area estimation. Journal of the Royal Statistical Society: Series B 76 (1), 47 - 69.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # Data sets ?sampleData, ?popaggData and ?popoutData are
# implemented in the rsarGWR-package. See help files.
## Not run:
formula <- y~1+x|clusterid |long + lat
#Model fit
gwmodel<-gwlmm(formula, data = data)
#In-sample predictions
pred<-predict(gwmodel)
#Small area mean prediction for aggregated population data
predagg<-predict(gwmodel, popdata = popaggData, size = "Size")
#Small area mean prediction for unit-level population data
preddisagg<-predict(gwmodel, popdata = popoutData, popAgg = FALSE)
## End(Not run)
##################################################################
# Outlier-robust estimation
## Not run:
# Model fit
rgwmodel<- rgwlmm(formula, data = sampleData)
# In-sample prediction
rpred<-predict(rgwmodel)
#Small area preditions (mean) for aggregated population data
rpredagg<-predict(rgwmodel, popdata = popaggData, size = "Size")
#Small area preditions (mean) for unit-level population data
rpreddisagg<-predict(rgwmodel, popdata = popoutData, popAgg = FALSE)
###########
# Robust model fit when sample only contains centroid information
rgwmodel<- rgwlmm(formula, data = sampleData, centroid = TRUE)
# In-sample prediction
rpred<-predict(rgwmodel)
#Small area means for aggregated population data
rpredagg<-predict(rgwmodel, popdata = popaggData, size = "Size")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.