Tutorials › Econometrics (Graduate) › Worked Analysis of Spatial and Peer-Effects Models

Spatial and Network Econometrics · Tutorial 952 of 952

Worked Analysis of Spatial and Peer-Effects Models

Work through how spatial and peer-effects models are specified, estimated, checked for identification, and interpreted with appropriate impacts and robust uncertainty.

Advanced 11 min read

What You'll Learn

  • Specify a spatial-lag model and state the conditions that make its reduced form well-defined.
  • Calculate an equilibrium outcome vector from a spatial-weights matrix and a baseline predictor.
  • Interpret a spatial-lag estimate using robust standard errors, a confidence interval, and a p-value.
  • Derive direct, indirect, and total effects from the spatial multiplier.
  • Check the rank and relevance conditions needed to identify peer effects in a linear-in-means model.
  • Distinguish model-based uncertainty from uncertainty robust to spatial or network dependence.

From a Model to an Applied Analysis

Spatial and peer-effects models describe outcomes that may depend on outcomes elsewhere in a spatial system or network. Their coefficients are not automatically ordinary marginal effects: feedback can carry an initial change through multiple links. A careful analysis therefore connects the substantive specification to the weights matrix, checks that the model is identified and well-defined, and reports the resulting impacts with inference that reflects dependence.

The examples use hypothetical data. The first works through a spatial-lag equilibrium and its impacts; the second shows how to interpret a fitted spatial-lag coefficient with robust uncertainty; the third examines equilibrium and identification in a linear-in-means network model.

Spatial-Lag Specification and Equilibrium

Let \(y\) be an \(n\)-vector of outcomes, \(X\) an \(n\times k\) matrix of exogenous covariates, and \(W\) a specified spatial-weights matrix. The entry \(w_{ij}\) indicates the weight assigned to unit \(j\)'s outcome when forming the spatial lag for unit \(i\). Usually \(w_{ii}=0\). The matrix and its scaling must be described, since different choices define different models.

Definition: The spatial-lag model is $$ y=\rho Wy+X\beta+\varepsilon, $$ where \(\rho\) is the spatial-lag coefficient, \(\beta\) is a vector of covariate coefficients, and \(\varepsilon\) is an error vector. A well-defined reduced form requires \(I-\rho W\) to be nonsingular. A common sufficient condition is \(|\rho|<1/r(W)\), where \(r(W)\) is the spectral radius of \(W\).

For likelihood estimation under normal errors, a common additional assumption is \(\varepsilon\mid X,W\sim N(0,\sigma^2 I)\). More generally, \(X\) and \(W\) are treated as exogenous relative to \(\varepsilon\), while dependence in the errors may require robust inference. The simultaneous term \(Wy\) is generally endogenous: outcomes on the right-hand side are jointly determined. Thus ordinary least squares of \(y\) on \(Wy\) and \(X\) is not, in general, a valid estimator of \(\rho\).

Worked Example: Solving a Three-Unit Spatial Equilibrium

Suppose three hypothetical regions follow \(y=b+\rho Wy\), where \(b=(2.2,1.8,2.3)'\), \(\rho=0.2\), and $$ W=\begin{pmatrix}0&0.5&0.5\\1&0&0\\1&0&0\end{pmatrix}. $$ Each row sums to one and the diagonal is zero. The baseline vector \(b\) collects the intercept and observed-covariate contributions. Find the equilibrium outcomes.

The equations are \(y_1=2.2+0.1y_2+0.1y_3\), \(y_2=1.8+0.2y_1\), and \(y_3=2.3+0.2y_1\). Substituting the last two into the first gives $$ y_1=2.2+0.1(1.8+0.2y_1+2.3+0.2y_1)=2.61+0.04y_1. $$ Thus \(0.96y_1=2.61\), so \(y_1=2.61/0.96=2.71875\). Substitution then gives \(y_2=1.8+0.2(2.71875)=2.34375\) and \(y_3=2.3+0.2(2.71875)=2.84375\). To three decimal places, the equilibrium vector is \((2.719,2.344,2.844)'\).

The solution is unique: the eigenvalues of this \(W\) are \(1, -1, 0\), so the eigenvalues of \(I-0.2W\) are \(0.8,1.2,1\), and \(I-0.2W\) is nonsingular. Equivalently, the solved equations have a nonzero coefficient \(0.96\) on \(y_1\). These are simultaneous equilibrium values, not predictions obtained by treating the peer outcomes as fixed.

Estimation, Identification, and Robust Inference

A standard likelihood analysis estimates the spatial-lag coefficient jointly with the covariate coefficients and error variance. Under the conditional normal model, writing \(e(\rho,\beta)=y-\rho Wy-X\beta\), the log-likelihood, up to a constant, is $$ \ell(\rho,\beta,\sigma^2)=\log|I-\rho W|-\frac{n}{2}\log(\sigma^2)-\frac{e(\rho,\beta)'e(\rho,\beta)}{2\sigma^2}. $$ The determinant term accounts for the change of variables from the structural errors to the observed outcomes. Numerical maximization is often used. Identification and estimation depend on having a specified, informative \(W\), variation in \(X\), and a parameter region where \(I-\rho W\) is nonsingular. A reported optimizer does not replace checks for convergence, boundary estimates, or a nearly singular spatial multiplier.

For quasi-likelihood or other estimators under possible error misspecification, uncertainty should not rely uncritically on the likelihood's independent, homoskedastic error assumption. A sandwich covariance estimator or a spatial-HAC estimator can allow specified forms of heteroskedasticity and spatial error dependence. The robust method must match the dependence structure being allowed; “robust” does not mean robust to every possible misspecification. With few spatial units, conventional large-sample approximations may also be unreliable, so the small-number-of-units issue must be taken seriously.

Worked Example: Testing a Spatial-Lag Coefficient

Suppose a hypothetical analysis of 120 regions reports \(\hat{\rho}=0.28\) and a spatial-HAC standard error \(SE(\hat{\rho})=0.11\). Assume the fitted model and weights matrix satisfy the nonsingularity condition in the relevant parameter region. Test \(H_0:\rho=0\) against \(H_a:\rho\ne0\) using a large-sample normal approximation at \(\alpha=0.05\).

The Wald statistic is $$ z=\frac{\hat{\rho}-0}{SE(\hat{\rho})}=\frac{0.28}{0.11}=2.545. $$ The two-sided normal-approximation p-value is \(2P(Z\ge2.545)\approx0.0109\), where \(Z\sim N(0,1)\). Since \(0.0109<0.05\), the data provide evidence against a zero spatial-lag coefficient under the stated model and inference procedure.

A 95% Wald interval is $$ 0.28\pm1.96(0.11)=[0.0644,0.4956]. $$ Under repeated sampling and the approximation used to construct it, this procedure covers the model's \(\rho\) in 95% of samples. The interval is for the spatial-lag coefficient, not the size of a covariate's total effect. If the rows of \(W\) sum to one, \(\rho=0.28\) describes the coefficient on a weighted average of neighboring outcomes; it is not itself a 28% causal effect.

Calculating Spatial Impacts

Solving the model gives \(y=(I-\rho W)^{-1}X\beta+(I-\rho W)^{-1}\varepsilon\). For covariate \(x_k\), the matrix of marginal effects is \(S_k=(I-\rho W)^{-1}\beta_k I\), assuming \(x_k\) enters \(X\) without spatial lags. Its diagonal elements are own-unit effects; its off-diagonal elements are effects transmitted to other units. Average direct, indirect, and total effects are, respectively, the average diagonal, the average off-diagonal row sum, and the average row sum of \(S_k\). This is why \(\beta_k\) alone is not the full impact.

Derivation: If \(r(\rho W)<1\), the Neumann series gives \((I-\rho W)^{-1}=I+\rho W+\rho^2W^2+\cdots\). The first term is the initial covariate response; later terms represent feedback after one or more rounds of spatial transmission. If \(W\mathbf{1}=\mathbf{1}\), then \((I-\rho W)^{-1}\mathbf{1}=\mathbf{1}/(1-\rho)\), so the average total effect of \(x_k\) is \(\beta_k/(1-\rho)\).

Worked Example: Direct, Indirect, and Total Effects

Use the three-region \(W\) and \(\rho=0.2\) from the equilibrium example. Suppose a covariate has estimated coefficient \(\hat{\beta}_k=0.5\). Calculate its impact matrix and the average direct, indirect, and total effects.

Solving \((I-0.2W)v=q\) gives \(v_1=(q_1+0.1q_2+0.1q_3)/0.96\), \(v_2=q_2+0.2v_1\), and \(v_3=q_3+0.2v_1\). Applying these equations to the three unit vectors gives $$ (I-0.2W)^{-1}= \begin{pmatrix} 1.041667&0.104167&0.104167\\ 0.208333&1.020833&0.020833\\ 0.208333&0.020833&1.020833 \end{pmatrix}. $$ Multiplying by \(0.5\) yields \(S_k\). The average direct effect is \(0.5(1.041667+1.020833+1.020833)/3=0.5139\). The three row sums of \(S_k\) are each \(0.625\), so the average total effect is \(0.625\). The average indirect effect is \(0.625-0.5139=0.1111\). As a check, row-standardization implies the total effect is \(\hat{\beta}_k/(1-\rho)=0.5/0.8=0.625\). These are outcome changes per one-unit increase in the covariate, with the covariate's units and outcome's units understood.

Linear-in-Means Network Models

A linear-in-means model describes outcomes jointly within a network. A useful specification is \(y=\alpha\mathbf{1}+\beta x+\gamma Wy+\delta Wx+u\). Here \(\gamma\) is the endogenous peer-effect coefficient, \(\delta\) is the contextual-effect coefficient on peers' observed characteristics, and \(u\) includes unobserved determinants. The model requires \(I-\gamma W\) to be nonsingular. Identification additionally requires exogenous variation that separates the endogenous peer outcome \(Wy\) from included regressors and unobserved determinants.

In particular, merely observing that outcomes co-move within groups does not identify \(\gamma\). Under exogenous network formation and appropriate exogeneity assumptions for \(x\) and \(W\), functions of peers' exogenous characteristics can provide instruments. If \(Wx\) is included as a contextual regressor, higher-order terms such as \(W^2x\) may supply excluded variation. They must be relevant after conditioning on included variables and valid relative to \(u\); a rank check is necessary, and weak instruments can make estimates unreliable. The reflection problem is the difficulty of separating endogenous peer effects, contextual effects, and shared unobserved influences using simultaneous group outcomes alone.

Worked Example: Equilibrium and an Identification Check in a Four-Node Network

Consider a hypothetical directed four-node cycle with \(W\) defined by \((Wy)_i=y_{i+1}\), wrapping from node 4 to node 1. Let \(x=(0,1,0,0)'\), so \(Wx=(1,0,0,0)'\) and \(W^2x=(0,0,0,1)'\). Suppose \(\alpha=1\), \(\beta=0.5\), \(\delta=0.2\), and \(\gamma=0.3\), with zero disturbances for this equilibrium calculation.

The baseline \(b=\alpha\mathbf{1}+\beta x+\delta Wx\) is \((1.2,1.5,1,1)'\). Since \(W^4=I\), $$ y=(I-0.3W)^{-1}b=\frac{b+0.3Wb+0.09W^2b+0.027W^3b}{1-0.3^4}. $$ Here \(Wb=(1.5,1,1,1.2)'\), \(W^2b=(1,1,1.2,1.5)'\), and \(W^3b=(1,1.2,1.5,1)'\). The numerator is \((1.767,1.9224,1.4485,1.522)'\), and \(1-0.3^4=0.9919\). Therefore \(y\approx(1.781,1.938,1.460,1.534)'\). This demonstrates how the peer coefficient feeds the baseline outcomes around the cycle.

For a simple rank illustration, the columns \(\mathbf{1},x,Wx,W^2x\) form the matrix $$ \begin{pmatrix}1&0&1&0\\1&1&0&0\\1&0&0&0\\1&0&0&1\end{pmatrix}, $$ which has nonzero determinant (its absolute value is 1). Thus these four columns are linearly independent in this constructed design. This is only a rank illustration, not evidence that an empirical instrument is valid or strong: an applied analysis must justify the exclusion restriction, test relevance in the estimation sample, and use inference appropriate to its instrument design and number of networks.

Common Pitfalls and Reporting

  • Wrong reasoning: “The estimate of \(\rho\) is 0.28, so outcomes rise by 28% when a neighboring outcome rises.” Correction: \(\rho\) multiplies the weighted outcome lag; feedback and the scale of \(W\) matter. Report impacts from the spatial multiplier for covariate effects.
  • Wrong reasoning: “OLS is acceptable because \(Wy\) is just another regressor.” Correction: \(Wy\) is jointly determined with \(y\). Use an estimator that addresses simultaneity and assess identification.
  • Wrong reasoning: “A significant peer association proves a causal peer effect.” Correction: Correlated effects, contextual effects, endogenous group formation, or invalid instruments can produce misleading associations. State the identifying assumptions and their limits.
  • Wrong reasoning: “A robust standard error fixes a misspecified model.” Correction: Robust covariance estimation changes uncertainty calculations under specified dependence conditions; it does not repair a wrong \(W\), invalid instruments, or omitted confounding.

A useful report states how \(W\) was constructed and scaled, the exact model and estimator, the identification strategy, and the inference method. For spatial covariates, report direct, indirect, and total impacts with uncertainty rather than presenting a structural coefficient as if it were a complete marginal effect. For peer models, explain which variation identifies the endogenous effect and why the excluded instruments are credible.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. Why is nonsingularity of \(I-\rho W\) needed to interpret a spatial-lag model as an equilibrium?
  2. For the three-region example, why does row-standardization imply an average total effect of \(0.5/(1-0.2)\)?
  3. What does the reported robust interval for \(\rho\) mean, and what does it not mean?
  4. Why is \(Wy\) generally endogenous in a linear-in-means model?
  5. In the network example, what additional evidence beyond the displayed rank check is needed before using \(W^2x\) as an instrument?
Clinical Biostats