Description Usage Arguments Details Value References See Also Examples
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.
1 2 3 4 5 |
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 |
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 |
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: |
method |
(character) defines the iterative algorithm for approximating the variance
parameters. Possible values: |
gwlmm
additionally conducts a likelihood ratio using the likelihood from the GWLMM
and a global LMM. The LMM is fitted using the lmer
function from the lme4
-package.
The test is saved in the LRtest
value and is based on Fotheringham et al. (2009, p. 92).
The bandwidth is optimized using the cross-validation procedure implemented
in gwr.sel
from the spgwr
-package.
The REML estimation implemented in the gwlmm
function is conducted using the Nelder-Mead algirithm (optim
from stats
-package)
as suggested by Chandra et al. (2012).
rgwlmm
uses robust ML estimation equations (following Sinha and Rao, 2009)
of the GWLMM that restrict the infuence of outliers on the parameter estimation using
Hubers's influence function (See Baldermann et al. (2016)). The tuning constant k
defines the restriction. The smaller k
, the stronger
the restriction and vice versa.Sinha and Rao (2009) recommended to set k = 1.346
following Huber (1964).
method
: using a fixed-point algorithm is recommended for estimating the variance parameters as it
is fast and stable compared to the Newton-Raphsom algorithm.
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
call
(language) the call generating the value
coefficients
(Matrix) the matrix of local regression coefficients
varcoefficients
(Matrix) the matrix containing the
model-based variances of the local coefficients
Variance
(numeric) the vector of fitted variance parameter(s)
nIter
(numeric) number of iterations needed
for estimating the model parameters
LRtest
(numeric) a named vector of test results for spatial
non-stationarity conating the likelihood, the likelihood ratio,
the effective degrees of freedom and the p-value. (only in gwlmm
-object)
Model
(list) contains all model information for forther calculations
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.
predict.gwlmm
, and predict.rgwlmm
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.