Learn R Programming

splm (version 1.6-5)

slag: Spatial lag operator

Description

Spatial lagging method for vectors or pseries objects.

Usage

# S3 method for pseries
slag(x, listw, maxlag, ...)
# S3 method for default
slag(x, listw, maxlag, index, ...)

Value

a pseries

Arguments

x

an object of class pseries

listw

an object of class listw

maxlag

the spatial lag order (including lower)

index

the default method needs a well-specified index

...

additional arguments to be passed

Author

Giovanni Millo

Examples

Run this code
data(Produc, package="plm")
data(usaww)
usalw <- spdep::mat2listw(usaww)
fm <- log(gsp)~log(pcap)+log(pc)+log(emp)+unemp+slag(log(pcap),
  listw=usalw)
slxmod <- spreml(fm, data=Produc, w = usaww,
  model="pooling", lag=FALSE, errors="ols")

Run the code above in your browser using DataLab