原文链接:https://www.lianxh.cn/news/0b822f835c9d5.html
- 原文:How to create animated graphics to illustrate spatial spillover effects
- 中文版PPT 在线浏览
- 6 March 2018
- 作者:Di Liu, Senior Econometrician
连享会 - Stata 暑期班
线上直播 9 天:2020.7.28-8.7
主讲嘉宾:连玉君 (中山大学) | 江艇 (中国人民大学)
课程主页:https://gitee.com/arlionn/PX | 微信版
This post shows how to create animated graphics that illustrate the spatial spillover effects generated by a spatial autoregressive (SAR) model. After reading this post, you could create an animated graph like the following.
This post is organized as follows. First, I estimate the parameters of a SAR model. Second, I show why a SAR model can produce spatial spillover effects. Finally, I show how to create an animated graph that illustrates the spatial spillover effects.
A SAR model
I want to analyze the homicide rate in Texas counties as a function of unemployment. I suspect that the homicide rate in one county affects the homicide rate in neighboring counties.
I want to answer two questions.
- How can I set up a model that explicitly allows the homicide rate in one county to depend on the homicide rate in neighboring counties?
- Given my model, if the unemployment rate in Dallas increases to 10%, how would the homicide rate change in the neighboring counties of Dallas ?
Fit a SAR model
A standard linear model for the homicide rate in county i i i ( h r a t e i ) ({\bf{hrate}}_{i}) (hratei) as a function of the unemployment rate in that county’s u n e m p l o y m e n t i {\bf unemployment}_{i} unemploymenti is
h r a t e i = β 0 + β 1 u n e m p l o y m e n t i + ϵ i {\bf hrate}_i = \beta_0 + \beta_1 {\bf unemployment}_{i} + \epsilon_i hratei=β0+β1unemploymenti+ϵi
A SAR model allows ( h r a t e i ) ({\bf hrate}_i) (hratei) to depend on the homicide rate in neighboring counties. I need some new notation to write down a SAR model. I let ( W i , j ) (W_{i,j}) (Wi,j) be a positive number if county j j j is a neighbor of county i i i, zero if the j j j is not a neighbor of i i i, and zero if j = i j=i j=i, because no county can border itself.
Given this notation, a SAR model that allows the homicide rate in county i i i to depend on the homicide rate in neighboring counties can be written as
h r a t e i = γ 1 ∑ j = 1 N W i , j h r a t e j + β 1 u n e m p l o y m e n t i + β 0 + ϵ i {\bf hrate}_i = \gamma_1\sum_{j=1}^N W_{i,j} {\bf hrate}_{j} + \beta_1 {\bf unemployment}_{i} + \beta_0 + \epsilon_i hratei=γ1j=1∑NWi,jhratej+<