elhorst: Elhorst procedure

Description Usage Arguments Value References Examples

View source: R/elhorst.R

Description

Elhorst procedure

Usage

1
elhorst(formula, data, listw, alpha = 0.05, criterion = "RLM")

Arguments

formula

a formula object (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

a data.frame object containing the variables in the model.

listw

a listw object containing weights.

alpha

a numeric value providing the confidence level between 0 and 1.

criterion

either RLM (default), AIC or BIC: in case if several models are selected, using additional criterion to draw out the best model.

Value

returns a list of two dataframes of test results.

References

Elhorst, J. P. (2010). Applied spatial econometrics: raising the bar. Spatial economic analysis, 5(1), 9-28.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(spatialreg)
require(spdep)
require(rgdal)
columbus <- readOGR(system.file("shapes/columbus.shp", package="spData")[1])
weights <- nb2listw(poly2nb(columbus))
formula <- CRIME ~ INC + HOVAL

elhorst(formula = formula, data = columbus, listw = weights, alpha = 0.05)
elhorst(formula = formula, data = columbus,
        listw = weights, alpha = 0.05, criterion = "AIC")
elhorst(formula = CRIME ~ INC, data = columbus, listw = weights)

Psqrt/spcomparison documentation built on Nov. 25, 2019, 12:33 a.m.