Announcement

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

  • Help Regarding Map Charts in STATA

    I am new to STATA and I am creating a heat Map chart for access of electricity at state level for India. For this I need to highlight name of States on the map. I have a variable named States in my .dta file but I don't know how to use this variable in the smap command so that the name of states appear on the map. Also, I will really grateful if I can get some reading material to strengthen my knowledge.

  • #2
    Welcome to Statalist. This forum is for questions about the list and not about Stata. Please ask in the General forum. Before you do so, please read the FAQ, especially section 12, and follow the advice given there. In particular, please provide more information on your dataset and on the command(s) you are trying to use.

    Comment


    • #3
      Yogeshwar Bharat also it sounds like you are trying to generate a Choropleth map (e.g., encoding color/values to a polygon) vs a Heatmap (e.g., encoding colors/values to points/coordinate pairs). I'm not sure how small states are in India, but if they are polygons you may want to search for help on generating Choropleth maps instead.

      Comment


      • #4
        wbuchanan, Thanks for your suggestion. The states size in India is considerably large and I have polygon information for them. Even in Choropleth how can I add names to these states.

        Comment


        • #5
          Friedrich Huebler , Thanks a lot, I will keep this in mind. I am using a dataset which is showing access of electricity to different states in India. My idea is to show the distribution using a heat map or a Choropleth. the command I am using is:

          spmap per_hh_light_elec using "$Census\Map DTA File\rajcoord.dta" , id(id) fcolor(Blues) clnumber(5) legend(symy(*1) symx(*1) size(*1)) label(xcoord(_X) ycoord(_Y) label(region))

          but I am getting an error command showing I have not defined the xcood & ycoord correctly

          Comment


          • #6
            Yogeshwar Bharat it would be helpful if you showed all of the code that you used from the start of things through to the point where you encountered the error. It isn't possible to identify if it was an issue earlier in your commands creating the .dta file that would be used, or if it is an issue later that is only localized to spmap. Additionally, you should enclose your code inside of CODE tags to make it easier for others to replicate your issues like:

            Code:
            spmap per_hh_light_elec using "$Census\Map DTA File\rajcoord.dta" , id(id) fcolor(Blues) clnumber(5) legend(symy(*1) symx(*1) size(*1)) label(xcoord(_X) ycoord(_Y) label(region))
            This can sometimes make it easier to spot minor problems with syntax and for others to copy and paste a bit more consistently.

            Comment


            • #7
              Yogeshwar, please move this discussion to the General forum where it will be seen by many more people. The purpose of the present forum is not in-depth discussion of Stata problems. Please also follow the advice in the FAQ, as recommended in post #2. What you wrote so far indicates that you didn't read the FAQ.

              Comment

              Working...
              X