Description Usage Arguments Details Value References See Also Examples
Modelbased recursive partitioning based on linear regression adjusting for a (global) spatial simultaneous autoregressive lag.
1 2 3 4 
formula 
formula specifying the response variable and regressors and partitioning variables, respectively. For details see below. 
data 
data.frame to be used for estimating the model tree. 
listw 
a weights object for the spatial lag part of the model. 
method 
"eigen" (default)  the Jacobian is computed as the product
of (1  rho*eigenvalue) using 
zero.policy 
default NULL, use global option value; if TRUE assign zero to the lagged value of zones without
neighbours, if FALSE (default) assign NA  causing 
interval 
default is NULL, search interval for autoregressive parameter 
control 
list of extra control arguments  see 
rhowystart 
numeric. A vector of length 
abstol 
numeric. The convergence criterion used for estimation of the model.
When the difference in loglikelihoods of the model from two consecutive
iterations is smaller than 
maxit 
numeric. The maximum number of iterations to be performed in estimation of the model tree. 
dfsplit 
logical or numeric. 
verbose 
Should the loglikelihood value of the estimated model be printed for every iteration of the estimation? 
plot 
Should the tree be plotted at every iteration of the estimation? Note that selecting this option slows down execution of the function. 
... 
Additional arguments to be passed to 
Spatial lag trees learn a tree where each terminal node is associated with different regression coefficients while adjusting for a (global) spatial simultaneous autoregressive lag. This allows for detection of subgroupspecific coefficients with respect to selected covariates, while adjusting for spatial correlations in the data. The estimation algorithm iterates between (1) estimation of the tree given an offset of the spatial lag effect, and (2) estimation of the spatial lag model given the tree structure.
The code is still under development and might change in future versions.
The function returns a list with the following objects:
formula 
The formula as specified with the 
call 
the matched call. 
tree 
The final 
lagsarlm 
The final 
data 
The dataset specified with the 
nobs 
Number of observations. 
loglik 
The loglikelihood value of the last iteration. 
df 
Degrees of freedom. 
dfsplit 
degrees of freedom per selected split as specified with the 
iterations 
The number of iterations used to estimate the 
maxit 
The maximum number of iterations specified with the 
rhowystart 
Offset in estimation of the first tree as specified in the 
abstol 
The prespecified value for the change in loglikelihood to evaluate
convergence, as specified with the 
listw 
The 
mob.control 
A list containing control parameters passed to

Wagner M, Zeileis A (2019). Heterogeneity and Spatial Dependence of Regional Growth in the EU: A Recursive Partitioning Approach. German Economic Review, 20(1), 67–82. doi: 10.1111/geer.12146 https://eeecon.uibk.ac.at/~zeileis/papers/Wagner+Zeileis2019.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  ## data and spatial weights
data("GrowthNUTS2", package = "lagsarlmtree")
data("WeightsNUTS2", package = "lagsarlmtree")
## spatial lag model tree
system.time(tr < lagsarlmtree(ggdpcap ~ gdpcap0 + shgfcf + shsh + shsm 
gdpcap0 + accessrail + accessroad + capital + regboarder + regcoast + regobj1 + cee + piigs,
data = GrowthNUTS2, listw = WeightsNUTS2$invw,
minsize = 12, alpha = 0.05))
print(tr)
plot(tr, tp_args = list(which = 1))
## query coefficients
coef(tr, model = "tree")
coef(tr, model = "rho")
coef(tr, model = "all")
system.time({
ev < eigenw(WeightsNUTS2$invw)
tr1 < lagsarlmtree(ggdpcap ~ gdpcap0 + shgfcf + shsh + shsm 
gdpcap0 + accessrail + accessroad + capital + regboarder + regcoast + regobj1 + cee + piigs,
data = GrowthNUTS2, listw = WeightsNUTS2$invw, method = "eigen",
control = list(pre_eig = ev), minsize = 12, alpha = 0.05)
})
coef(tr1, model = "rho")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.