Description Usage Arguments Value References Examples

Elhorst procedure

1 |

`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. |

returns a list of two dataframes of test results.

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

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.