Learn R Programming

S2sls (version 0.1)

S2sls-package: Spatial Two Stage Least Squares estimation

Description

Fit a spatial instrumental-variable regression by two-stage least squares.

Arguments

Details

Package:
S2sls
Type:
Package
Version:
1.0
Date:
2016-01-06
License:
GPL-3

S2sls(Y~X,data,W) Spatial Two Stage Least Squares Estimation computes spatial instrumental variables s2SLS estimation where Y is the vector of the dependant variable, X is the matrix of the independent variables and W is the contiguity matrix.

References

Amemiyia T. (1971), The estimation of the variances in a variance--components model, International Economic Review, 12, pp.1--13.

Baltagi B.H. (1981), Simultaneous equations with error components, Journal of econometrics, 17, pp.21--49.

Baltagi B.H. (2001), Econometric Analysis of Panel Data. John Wiley and sons. ltd.

Millo, G., Piras, G. (2012) splm: Spatial Panel Data Models in R. Journal of Statistical Software, 47(1), 1--38. URL http://www.jstatsoft.org/v47/i01/.

Examples

Run this code
 # Load data
 data(Produc,package="spanel")
 data(usaww,package="spanel")
 # The contiguity matrix w must be a square matrix with size[nrow(log(gsp)),nrow(log(gsp))]
 # so for our example we transform usaww to a square matrix:
 ww<-as.matrix(usaww)
 h<-kronecker(ww,diag(17))
 # fit spatial two stage least squares model
 ran<-s2sls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,h)
 summary(ran)

Run the code above in your browser using DataLab