Marginal effects for spatial probit and Tobit models (SAR probit, SAR Tobit)
Marginal effects for spatial probit and Tobit models (SAR probit, SAR Tobit)
Estimate marginal effects (average direct, indirect and total impacts) for the SAR probit and SAR Tobit model.
## S3 method for class 'sarprobit'marginal.effects(object, o =100,...)## S3 method for class 'sartobit'marginal.effects(object, o =100,...)## S3 method for class 'sarprobit'impacts(obj, file=NULL, digits = max(3, getOption("digits")-3),...)## S3 method for class 'sartobit'impacts(obj, file=NULL, digits = max(3, getOption("digits")-3),...)
Arguments
object: Estimated model of class sarprobit or sartobit
obj: Estimated model of class sarprobit or sartobit
o: maximum value for the power tr(Wi),i=1,...,o to be estimated
digits: number of digits for printing
file: Output to file or console
...: additional parameters
Details
impacts() will extract and print the marginal effects from a fitted model, while marginal.effects(x) will estimate the marginal effects anew for a fitted model.
In spatial models, a change in some explanatory variable xir for observation i
will not only affect the observations yi directly (direct impact), but also affect neighboring observations yj (indirect impact). These impacts potentially also include feedback loops from observation i to observation j and back to i. (see LeSage (2009), section 2.7 for interpreting parameter estimates in spatial models).
For the r-th non-constant explanatory variable, let Sr(W) be the nxn matrix that captures the impacts from observation i to j.
The direct impact of a change in xir on its own observation yi can be written as
∂xir∂yi=Sr(W)iidyi/dxir=Sr(W)ii
and the indirect impact from observation j to observation i as
∂xjr∂yi=Sr(W)ijdyi/dxjr=Sr(W)ij
.
LeSage(2009) proposed summary measures for direct, indirect and total effects, e.g. averaged direct impacts across all n observations. See LeSage(2009), section 5.6.2., p.149/150 for marginal effects estimation in general spatial models and section 10.1.6, p.293 for marginal effects in SAR probit models.
The average direct impact is the average of the diagonal elements, the average total impacts is the mean of the row (column) sums.
For the average direct impacts Mr(D), there are efficient approaches available, see LeSage (2009), chapter 4, pp.114/115.
The computation of the average total effects Mr(T) and hence also the average indirect effects Mr(I) are more subtle, as Sr(W) is a dense nxn matrix. In the LeSage Spatial Econometrics Toolbox for MATLAB (March 2010), the implementation in sarp_g computes the matrix inverse of S=(In−ρW)
which all the negative consequences for large n. We implemented n−11n′Sr(W)1n via a QR decomposition of S=(In−ρW) (already available from a previous step) and solving a linear equation, which is less costly and will work better for large n.
SAR probit model
Specifically, for the SAR probit model the nxn matrix of marginal effects is
This function returns a list with 6 elements: 'direct' for direct effects, 'indirect' for indirect effects, 'total' for total effects, and 'summary_direct', 'summary_indirect', 'summary_total' for the summary of direct, indirect and total effects.
Warning
Although the direct impacts can be efficiently estimated, the computation of the indirect effects require the inversion of a nxn matrix and will break down for large n.
tr(Wi) is determined with simulation, so different calls to this method will produce different estimates.
References
LeSage, J. and Pace, R. K. (2009), Introduction to Spatial Econometrics, CRC Press
require(spatialprobit)# number of observationsn <-100# true parametersbeta <- c(0,1,-1)rho <-0.75# design matrix with two standard normal variates as "covariates"X <- cbind(intercept=1, x=rnorm(n), y=rnorm(n))# sparse identity matrixI_n <- sparseMatrix(i=1:n, j=1:n, x=1)# number of nearest neighbors in spatial weight matrix Wm <-6# spatial weight matrix with m=6 nearest neighbors# W must not have non-zeros in the main diagonal!W <- kNearestNeighbors(x = rnorm(n), y = rnorm(n), k = m)# innovationseps <- rnorm(n=n, mean=0, sd=1)# generate data from model S <- I_n - rho * W
z <- solve(qr(S), X %*% beta + eps)y <- as.vector(z >=0)# 0 or 1, FALSE or TRUE# estimate SAR probit modelset.seed(12345)sarprobit.fit1 <- sar_probit_mcmc(y, X, W, ndraw=500, burn.in=100, thinning=1, prior=NULL, computeMarginalEffects=TRUE)summary(sarprobit.fit1)# print impactsimpacts(sarprobit.fit1)################################################################################## Example from LeSage/Pace (2009), section 10.3.1, p. 302-304################################################################################## Value of "a" is not stated in book! # Assuming a=-1 which gives approx. 50% censoring library(spatialprobit)a <--1# control degree of censored observationn <-1000rho <-0.7beta <- c(0,2)sige <-0.5I_n <- sparseMatrix(i=1:n, j=1:n, x=1)x <- runif(n, a,1)X <- cbind(1, x)eps <- rnorm(n, sd=sqrt(sige))param <- c(beta, sige, rho)# random locational coordinates and 6 nearest neighborslat <- rnorm(n)long <- rnorm(n)W <- kNearestNeighbors(lat, long, k=6)y <- as.double(solve(I_n - rho * W)%*%(X %*% beta + eps))table(y >0)# set negative values to zero to reflect sample truncationind <- which(y <=0)y[ind]<-0# Fit SAR Tobit (with approx. 50% censored observations)fit_sartobit <- sartobit(y ~ x, W, ndraw=1000, burn.in=200, computeMarginalEffects=TRUE, showProgress=TRUE)# print impactsimpacts(fit_sartobit)