[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Kyle Hood <kyle.hood@yale.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: spatial weighting matrix |

Date |
Wed, 08 Apr 2009 14:07:35 -0400 |

Nick Cox wrote:

I think that's all correct, but one extra detail may bite. For example, a common size of problem is all 3000 or so counties in the USA. For coding contiguities for that, you really need to have or to mimic sparsematrix routines.Nickn.j.cox@durham.ac.ukKyle HoodThanks for the explanation of queen - I do recall that chess referencesare used, now; I guess I had forgotten since I have never based a weightmatrix on contiguity.I am a little confused about what the asker wants from Stata, here. Hesays he has addresses (points), but wants a weighting matrix thatdepends on contiguity, which only makes sense for areal data. If theseaddresses contain the areas in question (for example, zip codes orstates) then no geocoding is necessary -- one must simply extract theareas from the address data. However, after that, the informationconcerning which areas are adjacent to others is needed. I can'timagine that Stata can be used to obtain this information. If the askerhas this information already, then it would of course be trivial toprogram the weighting matrix in Stata (using Mata or not).If the addresses do not contain the areas in question (for example, theasker wishes to consider adjacent census tracts, but has street addressdata), then the address information will have to be geocoded. Thegeocoded data must then be matched up with a map of census tracts basedon location. In addition, information on which census tracts wereadjacent would be needed, and this presents the same problem as above.Some of this can be done in Stata, but there are pieces that othersoftware is better suited to deal with.Nick Cox wrote:The queen terminology in spatial analysis comes via chess.Imagine squares on a chessboard.A queen can enter a neighbouring square either across a length of boundary (over a link or edge in a boundary network) or diagonally (iftwo areas touch at a vertex or node in a boundary network).A rook or castle is limited to the first of those.In chess there are of course also other rules but they do not enterhere.Thus "queen" implies contiguity wide sense and "rook" strict sense.The terminology goes back at least as far as the work of geographer Andrew Cliff and econometrician-statistician Keith Ord in the late1960s.In terms of the question, I implemented weighting matrices via string variables [!!!] in -spautoc- on SSC in 1997, but I'd do it in Matanow,but I don't have detailed advice, let alone code.Nickn.j.cox@durham.ac.ukKyle HoodI'm not sure what "first-order queen contiguity" is, but you willprobably have to geocode address data (geocode: address->lat/lon), andIdon't think you can do this in Stata (that is, unless the breadth ofStata's capabilities is larger than I had realized, which is sometimesthe case). Try ArcGIS. Once you have the geocoded data, you canprobably compute the weight matrix in Stata, if you want.max r wrote:I need to create a spatial weighting matrix (first-order queen contiguity) for a unbalanced panel dataset. The dataset has address information in it. Is there a way to do this in STATA? I am trying to test for neigborhood effects in behavior. Appreciate your thoughts.* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

-- Kyle Hood Department of Economics Yale University New Haven, CT website: http://www.econ.yale.edu/~kkh25/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: spatial weighting matrix***From:*max r <maxr28@gmail.com>

**References**:**st: spatial weighting matrix***From:*max r <maxr28@gmail.com>

**Re: st: spatial weighting matrix***From:*Kyle Hood <kyle.hood@yale.edu>

**RE: st: spatial weighting matrix***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: spatial weighting matrix***From:*Kyle Hood <kyle.hood@yale.edu>

**RE: st: spatial weighting matrix***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**RE: st: spatial weighting matrix** - Next by Date:
**st: how to save output from TABLE or TABSTAT as a stata .dta data file** - Previous by thread:
**RE: st: spatial weighting matrix** - Next by thread:
**Re: st: spatial weighting matrix** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |