CHAPTER: Spatial Regression
I've gotten feedback from @TaylorOshan that our SLX discussion is somewhat unclear. I'd like to revisit it soon before we sent it back to the publisher.
On that chapter I had on my list to rename "Spatial Feature Engineering" for "Spatial Heterogeneity" (that's really the correct term IMHO, and that way we don't confuse terminology with Ch.12. So if you can fix that one it'd be ace :-)
Great, I've done this now with #142
Arraiz et al (2010) (line 614 in the markdown) needs to be replaced with proper referencing.
Comments from @darribas final pass on this chapter:
- [ ] I don't fully understand the second full paragraph in p.262, beginning with "Indee, this matters...". I think it needs to be reworded and I've tried my best but I'm not sure it's done well because I don't know exactly what it wants to say.
- [ ] It'd be really nice if we could add equation numbers to refer to them in the text. For example, in the first line of p.265, it's unclear which one we're referring to.
- [ ] We should rename Section 12.4.1 because, although it is called "Challenge Questions", there are no questions whatsoever. This is more of an advanced extension? This needs amendment. If we decide to keep it in the book, I think the code cells should be documented.
- [ ] I don't know why but
seabornnow uses a different background style. We should definitely amend this.
Things to ensure:
- [x] Library imports (first time inline, afterwards at the top of the chapter
- [x] No aliases on imports (
import pandas) - [x] Ensure no
XXXfor citations - [x] Ensure
matplotlibRC file is picked up and figures are standard - [x] Remove
%matplotlib inline - [ ] Graphics
- No style
- No title (unless multi-axis titles, but not
suptitle) - No axes for maps (
ax.set_axis_off())
- [x] Code comments are fine if needed
- [ ] ~~Hide/remove code cells that we want to hide (see docs here)~~
- [x] Typesetting check
- [x] General flow of the text
- [ ] Ensure there is a "next step" section at the end of the chapter pointing to further references for the topic (re. #137)
The edits are over at https://github.com/gdsbook/book/pull/210.
IMPORTANT -- I don't think this had a first final pass by anyone, so I think this chapter should be reviewed at least once more by someone. Also, my edits are pretty significant at parts, so I'd be more comfortable if an additional pair of eyes was laid on it.
I don't fully understand the second full paragraph in p.262, beginning with "Indee, this matters...". I think it needs to be reworded and I've tried my best but I'm not sure it's done well because I don't know exactly what it wants to say.
I think I wrote that. I've gone back over it since writing it too, on suggestion from @TaylorOshan :/ maybe I'm misunderstanding something, so let me try to explain where I'm coming from.
The point there is to make sure people understand that \gamma is an indirect effect (x_i's effects on surroundings), not a direct effect (x_i's effect on y_i). This means we can think of two "ways" to explain what \gamma does:
First, we can think of \gamma focusing on outcomes at site i:
a unit change in the spatial lag at site i results in a \gamma change for site i.
This is straightforward, since it just talks about \gamma, and ignores the spatial structure in W. But, it's also confusing, since we don't generally think of a "unit change in the lag" as an independent thing: people generally find it more intuitive to think about changes to X itself.[1]
To resolve this, we can think of \gamma focusing on conditions at site i:
a unit change in X at site i 'spills over' onto its neighbors with strength wij\gamma
I think this is the clearer explanation, which shows that interventions at site i will affect its neighbors not \gamma, but wij\gamma. And, if you change X_i by one, then the corresponding change on y_i is zero for most weights matrices, because the self-weight is zero. Thus, you can see that the "direct" effect of X on y is \beta, and the "spillover" of X on y is \gamma on average, but for any specific site X_i, it'll be wij \gamma.
Maybe this is pointless detail, but I think it's pretty important, just like the indirect/direct effect argument for the spatial lag of Y model.
[1]: As a simplification, a unit change in the lag is equivalent to a unit change in X when W is fully connected and row-standardized, but it still feels weird to think about adjusting WX directly, since it's derived from X.
Instead of rewriting the expositions for the wx indirect/direct predictions, let’s just signpost that the exposition is going into the conceptual details of how the wx model thinks about marginal effects.
Modern spatial econometrics with Geoda Mostly pointless spatial econometrics Cressie and wikle Dewi Owen’s progress article.