Announcement

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

  • shp2dta error: invalid dBASE data type

    Hi,

    I'm running Stata 15 and trying to use the user-written command shp2dta on a Macbook.

    Suppose the data is saved in folder "Maps". I have changed the working directory to this folder---which I confirmed by listing the folders of the working directory. I then follow the shp2dta syntax as specified but I keep getting an error message as follows.

    Code:
    cd "Maps"
    shp2dta using "DCW_countries", data("DCW_data")  coor("DCW_coordinates") replace
    type: 5
    DCW_countries.dbf: invalid dBASE data type
    r(610);
    The file "DCW_coordinates.dta" is successfully created, but not the "DCW_data.dta" file.

    I'm confused what to do with an "invalid dBASE data type" error and I cannot find a solution online.

    Thanks in advance for any help.

  • #2
    One last plea for help.

    I have checked the data and the shape file loads into ArcGIS no problem. The exact same error message results in Stata when trying other datasets as well. I am almost certain the problem is not with the data itself.

    If anyone has any experience using shp2dta I would be very grateful for some assistance.

    Comment


    • #3
      Since you are using Stata 15, try the new spshape2dta command to see if that works.

      Comment


      • #4
        I appreciate you bringing spshape2dta to my attention, Robert. It worked!

        Comment


        • #5
          Hello,

          I had the same pb and spshape2dta has worked. however, it provide the X and Y coordinate in the same dta file. How can I convert the below script given that I don't have a separate file for coordinates:

          spmap shdi2022 using PSE_coordinates, id(id)

          Many thanks for your assitance

          Comment


          • #6
            please ignore my previous question as I have found a solution.

            Comment

            Working...
            X