Announcement

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

  • #16
    Scott Merryman, thank you. I agree. Can you help with the line of code based on the file I shared? Thank you.

    Comment


    • #17
      Rahmat Gani, to simplify the answer to your question, you need to develop line data set and label dataset and then incorporate them into your previous spmap command line. It is a bit of a work at the first time because you need to adjust the X & Y position. But later on you can re-use the datasets for other purposes. Good luck.

      Comment


      • #18
        hello,

        im using Stata v17 and the following code to produce a map - the code works but the "South Eastern" name is presented as "South Easter" missing the last letter 'n'. Is there a character limit, and if so how do i change it?

        Code:
        shp2dta using "dohTrustBoundary", database(NIdb) coordinates(NIcoord) genid(id) gencentroids(c) replace 
        
        use "NIdb", clear
        describe
        list id TrustName in 1/5
        
        gen name=""
        replace name="Belfast" if id==1
        replace name="Northern" if id==2
        replace name="Western" if id==3
        replace name="Southern" if id==4
        replace name="South Eastern" if id==5
        keep id x_c y_c name
        save "NI_labels", replace
        
        insheet using "trust rate.csv", clear
        sort id
        merge 1:1 id using "NIdb"
        
        spmap adjratepertho using "NIcoord", id(id) fcolor(Blues) ///
        label(data(NI_labels) x(x_c) y(y_c) label(name) color(black) size(2.5))
        Many thanks

        Comment


        • #19
          solved it!

          Code:
          spmap adjratepertho using "NIcoord", id(id) fcolor(Blues) ///
          label(data(NI_labels) x(x_c) y(y_c) label(name) color(black) size(2.5) length(15))

          Comment

          Working...
          X