Announcement

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

  • using sta2dta mapping

    error message with sta2dta command I have install sta2dta and I have the relevant shape files, but when I run this command I get this error, as if I have the wrong version of shp2dta. Has anyone encountered this?


    . shp2dta using "C:\Users\TJoyce\Dropbox\abortion_avail\AR_2017\AR 2021\1data\map
    > \tl_2017_us_state.shp", database("usdb") coordinates("uscoord") genid(id) data
    > base(usdb) coordinates(uscoord) genid(id)
    option database() not allowed

  • #2
    Update on error why can't this be opened?

    . shp2dta using "C:\Users\TJoyce\Dropbox\abortion_avail\AR_2017\AR 2021\1data\map\tl_2017_us_state.shp", database("usdb") coordinates("uscoord") genid("id")
    type: 5
    file uscoord.dta could not be opened

    Comment


    • #3
      I have made more progress but now I get this:


      shp2dta using "C:\Users\TJoyce\Dropbox\abortion_avail\AR_2017\AR 2021\1data\map\tl_2017_us_state.shp", database(usdb) coordinates(uscoord) genid(id)
      type: 5
      file uscoord.dta could not be opened
      r(603);

      Comment


      • #4
        You appear to be using the Tiger/Line US state shapefile from 2017. Both -sp2dta- and -spshape2dta- work in the example below.

        Code:
        . clear*
        
        . copy https://www2.census.gov/geo/tiger/TIGER2017/STATE/tl_2017_us_state.zip tl_2017_us_state.zip
        
        . unzipfile tl_2017_us_state.zip, replace
            inflating: tl_2017_us_state.cpg
            inflating: tl_2017_us_state.dbf
            inflating: tl_2017_us_state.prj
            inflating: tl_2017_us_state.shp
            inflating: tl_2017_us_state.shp.ea.iso.xml
            inflating: tl_2017_us_state.shp.iso.xml
            inflating: tl_2017_us_state.shp.xml
            inflating: tl_2017_us_state.shx
        
        successfully unzipped tl_2017_us_state.zip to current directory
        total processed:  8
                skipped:  0
              extracted:  8
        
        . shp2dta using tl_2017_us_state.shp, database(usdb) coordinates(uscoord) genid(id) replace
        type: 5
        
        . spshape2dta  tl_2017_us_state, replace
          (importing .shp file)
          (importing .dbf file)
          (creating _ID spatial-unit id)
          (creating _CX coordinate)
          (creating _CY coordinate)
        
          file tl_2017_us_state_shp.dta created
          file tl_2017_us_state.dta     created
        Note - in 2019 the Alaska county equivalent area of Valdez-Cordova was split into two separate entities:
        Changes to Counties or County Equivalent Entities: 2010s

        New Counties or County Equivalent Entities

        • Chugach Census Area, Alaska (02-063):
          Created from part of former Valdez-Cordova Census Area (02-261) effective January 02, 2019.
        • Copper River Census Area, Alaska (02-066):
          Created from part of former Valdez-Cordova Census Area (02-261) effective January 02, 2019.
        Deleted Counties or County Equivalent Entities

        • Valdez-Cordova Census Area, Alaska (02-261):
          Split to form Chugach Census Area (02-063) and Copper River Census Area (02-066) effective January 02, 2019.

        Comment


        • #5
          thanks but this is what I get. I know the directory and file are correct as I used "copy as path" with Windows 10.


          . unzipfile "C:\Users\TJoyce\Dropbox\abortion_avail\AR_2017\AR 2021\1data\map\tl_2017_us_state.zip", replace
          inflating: tl_2017_us_state.cpg
          file not found
          tl_2017_us_state.cpg (Access is denied)
          r(601);

          Comment


          • #6
            I got it to work by eliminating the path ....much thanks

            Comment

            Working...
            X