[GIS] Spatial weight matrix QGIS – export to stata

distance matrixqgisstata

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!

Best Answer

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

Related Question