fit: (Robust) Geographically weighted linear mixed model (GWLMM)

Description Usage Arguments Details Value References See Also Examples

Description

User interface for fitting a GWLMM model. The function gwlmm fits a GWLMM via REML whereas rgwlmm fits an outlier-robust GWLMM to data. The GWLMM is a random intercespt model that take into account spatial non-stationarity in the model coefficients.

Usage

1
2
3
4
5
gwlmm(formula, data, band = NULL, centroid = FALSE, maxit = 100,
  tol = 1e-04, ...)

rgwlmm(formula, data, band = NULL, centroid = FALSE, maxit = 100,
  tol = 1e-04, k = 1.345, Start = NULL, method = "Fix", ...)

Arguments

formula

(formula) a two-sided lineer formula object decribing the fixed effects, the random intercept and the geographical information of the model. The response is on the left of the ~ operator, and the x-variables on the right side are seperated by a + opeartor. The identifier for the random intercept is seperated with a vertical bar (|).After another (|), the two coordinates - longitude and latitude - are seperated by a + operator. Categorial x-variable need to be defined as factor-variables.

data

(data.frame) A dataframe containing the variables named in formula.

band

(numeric) A numeric value defining the bandwidth for the geographical weigths (default = NULL). For a predifined bandwdth, insert value here.

centroid

(logical) If coordinates in formula are constant within the area ID define cetroid = TRUE (default = FALSE)

maxit

(integer) Defines the maximum number of iterations for the fitting process (default = 100).

tol

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

...

not used

k

(numeric) defines the tuning constant for influience function (default = 1.346). Ses datails.

Start

(list) optioanl list containing three obejcts for the starting values for the robust approximation (default = NULL). The three objects are: betas (Matrix with local coefficients); sigma.v (numeric value for the variance of the random effects); sigma.e (numeric value for the error term variance).

method

(character) defines the iterative algorithm for approximating the variance parameters. Possible values: "Fix", "Newton", (default = "Fix"). See datails.

Details

Value

The function gwlmm returns an object of class gwlmm. The function rgwlmm returns an object of class rgwlmm. Both objects are lists containing the following elements

References

Baldermann, C., N. Salvati, T. Schmid (2016). Robust small area estimation under spatial non-stationarity. Working Paper.

Chandra, H., N. Salvati, R. Chambers, and N. Tzavidis (2012). Small area estimation under spatial nonstationarity. Computational Statistics and Data Analysis 56 (10), pp. 2875-2888.

Fotheringham, A. S., C. Brunsdon, and M. Charlton (2002). Geographically Weighted Regression. West Sussex: Wiley.

Huber, P. J. (1964). Robust estimation of a location parameter. The Annals of Mathematical Statistical 35, 73 - 101.

Bivand, R and D. Yu (2015). spgwr: Geographically Weighted Regression. R package version 0.6-28. https://CRAN.R-project.org/package=spgw

Sinha, S. K. and J. N. K. Rao (2009). Robust small area estimation. The Canadian Journal of Statistics 37 (3), 381 - 399.

See Also

predict.gwlmm, and predict.rgwlmm

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
47
# 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.