Description Usage Arguments Details Examples
The strm
function provides maximum likelihood estimation of a spatio-temporal simultaneous autoregressive lag error model. This package is built on the errorsarlm()
function from the spatialreg
package.
1 2 3 4 5 6 7 8 9 10 11 |
formula |
Model formula specified by user (without lags). Any transformed variables, such as logged-variables, should be specified in the model formula. |
id |
Group identifier (example: state). |
data |
Name of dataframe. |
listw |
Spatial weights list object. |
time |
Number of time periods in the dataset. Lags will be taken for each time period. Default is 2 time periods. For a spatial-only regression model, set |
wide |
Boolean indicator. Takes |
filter_options |
Additional arguments to be passed to |
returndf |
Logical. If modified dataframe should be returned. Default is |
... |
Additional arguments to be passed to |
Spatio-temporal regression model
Any transformed variables should be included in the formula statement. For example, to request gdp
natural log-transformed, you would build the model formula as log(gdp)
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(spdep)
library(dplyr)
data("Produc", package="Ecdat")
data("usaww")
usalw <- mat2listw(usaww)
formula <- as.formula( log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp)
out1 <- strm(formula, id="state", data=Produc,
listw = usalw, time=2,wide=FALSE,
filter_options="year==1970 | year==1971")
out2 <- strm(formula, id="state", data=Produc,
listw= usalw, time=2, wide = FALSE,
filter_options="year==1970 | year==1971",
method="Chebyshev")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.