predictFit: Predict Method for (Robust) GWLMM Fits

Description Usage Arguments Details Value References See Also Examples

Description

Interface for predicting small area means based on a gwlmm ( or rgwlmm) model fit.

Usage

1
2
3
4
5
6
7
## S3 method for class 'gwlmm'
predict(object, popdata = NULL, size = NULL,
  popAgg = TRUE, ...)

## S3 method for class 'rgwlmm'
predict(object, popdata = NULL, size = NULL,
  popAgg = TRUE, bcConst = 3, maxit = 100, tol = 1e-04, ...)

Arguments

object

(formula) object of class 'gwlmm' or 'rgwlmm'

popdata

(data.frame) an optional data frame (Default = NULL). If ommited, in-sample prdictions are estimated.

size

(character) name for the column in popdata containing the area-specific population sizes (Default = NULL). Obligatory when popAgg = TRUE.

popAgg

(logical) TRUE if popdata is aggregated and only contains area level information

...

not used

bcConst

(numeric) needed for objects of class rgwlmm. Defines the tuning constant for influience function in the bias correction term (default = 3). Ses datails.

maxit

(integer) needed for objects of class rgwlmm. Defines the maximum number of iterations for the estiamtion of the random effects for rgwlmm objects (default = 100).

tol

(numeric) needed for objects of class rgwlmm. Defines the tolerance for the convergence of the fitting process (default = 1e-04).

Details

Value

The function predict.gwlmm returns a list containing the predictions

If popdata = NULL, a list with the following elements is returned.

If popdata is a data.frame a list with the following elements is returned.

References

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.

See Also

rgwlmm, and gwlmm

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

baldermann/rsaeGWR documentation built on May 6, 2019, 2:19 p.m.