2

I'm looking to estimate a spatial panel model in STATA, however, I'm running into difficulties creating a spatial weight matrix. For note my N=66 while my T=25.

I'm a novice when it comes to utilising spatial econometric methods. However, I wonder could I use QGIS to create a spatial weight matrix? I have longitude and latitude data which provides coordinates of countries. Is it possible to create a binary weight matrix to indicate if 1 if any region 1..66 shares a border and 0 if they do not? Obviously this will not change over time.

I would like to then export this matrix into a csv file and upload it to STATA. Sorry if any of my terminology is off as I'm a novice when it comes to these methods.

Any help is most welcome!

2
  • it sounds like you want an adjacency matrix not distance
    – Ian Turton
    Commented Feb 1, 2016 at 14:03
  • Hi Ian! I wonder is it's not too much trouble would you be able to discuss both. From the paper I'm basing my estimation on they utilise a contiguity-based binary weight matrix to represent interaction across regions. To you does this sound like an adjacency matrix?
    – Sean O'C
    Commented Feb 1, 2016 at 14:09

2 Answers 2

2

This is probably a little late for you, but a few thoughts:

First, I am guessing you probably just did this by hand, as it wouldn´t be too difficult to look at a map and create your variable.

Second, if you are working in STATA, you might want to check out the spwmatrix module to create spatial weights within STATA. If you can avoid going back and forth between different programs, that´s probably for the best.
http://www.haghish.com/statistics/stata-blog/stata-programming/download/spwmatrix.html

Third, I am not an expert with QGIS, but if you are looking for a quick-and-easy way to create a spatial weights matrix, I would recommend checking out GeoDa. http://geodacenter.github.io/index.html

0
  1. Go to the processing toolbox and search for "distance weighting matrix".
  2. Select the parameters you wish to set.
  3. Instead of "saving as temporary file", mark that you want to save a copy as a *.csv.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.