Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with shapefile and Stata

    Dear All,

    I have a shapefile which contains information about some European regions (a picture is attached). Some areas have been merged together, such that some "macro-regions are created". I use:

    Code:
    spshape2dta "\NUTS_RG_01M_2013
    to export information in Stata.

    I have a dataset which contains information at grid level (lat and lon are provided), covering a larger number of regions/state than those I am working on. So I try to map those lat and lon into my regions using:

    Code:
    geoinpoly _Y _X using NUTS_RG_01M_2013_shp
    According to my understanding, geoinpoly should capture only those coordinates that correspond to my regions, excluding the others. Morever, it should use the same level of aggregation I have in my dataset. But if so, why when I use geoinpoly it maps also regions/countries outside my shapefile (for instance Austria) and with a different level of aggregation (I have region BE1 in my shapefile, while after geopoly I find BE11, BE12 and so on)?

    Am I missing something?

    Thanks in advance for any help you may want to provide.

    Best,

    Dario
    Click image for larger version

Name:	Screenshot 2025-10-15 135944.png
Views:	1
Size:	62.7 KB
ID:	1782420


  • #2
    Maybe you haven't saved the new shapefile with the merged regions.
    I use QGIS to split/merge the features (regions) and save it as a new shapefile. It works. You can try it.
    Manh Hoang-Ba,
    Facebook,
    Eureka! Uni - YouTube,
    ManhHB94 (Manh Hoang Ba),
    Hoàng Bá Mạnh – Kinh tế lượng: Lý thuyết và ứng dụng

    Comment


    • #3
      Manh Hoang Ba The shapefile is saved correctly, but I am not sure about auxiliary files. I will double check this

      Comment


      • #4
        Solved apparently I did not change the auxiliary files. I have done this through QGIS and now it works

        Comment

        Working...
        X