Announcement

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

  • Show 3 sets of variables in only one map

    Dear all,
    I am using the spmap module created by Maurizio Pisati to graph some maps. My question is how I could represent in the same map a set of three variables (specifically, dummy variables) with three different colors accordingly. My dataset would be something like this:
    department high_soybean high_maize high_both
    A 1 0 0
    B 0 1 0
    C 0 0 1
    D 1 0 0
    ......
    Is it possible to represent the 3 set of dummies in one map using three different colors? Thanks for your advice.


  • #2
    One strategy would be creating - egen + group - a grouping variable.
    Best regards,

    Marcos

    Comment


    • #3
      Originally posted by Marcos Almeida View Post
      One strategy would be creating - egen + group - a grouping variable.
      Hi Marcos, thanks for the suggestion. Is it possible for you to help me out with a piece of code for getting a better sense of your suggestion? Many thanks in advance!

      Comment


      • #4
        Sure.

        Please take a look if this is what you wish:

        Code:
        egen mygroups = group(high_soybean high_maize high_both)
        Best regards,

        Marcos

        Comment


        • #5
          Hi Marcos,
          Thanks. It just worked fine with your clever solution. Maybe a related question is how I could set up a "clmethod(unique)" option when I use Michael Stepner's maptile? (Since I am plotting a categorical variable, this option is very convenient).

          Thanks again,

          Pablo


          Comment


          • #6
            I'm glad the advice was helpful to solve the problem.

            With regards to the user-written maptile, I have no experience with this program so far. However, to my knowledge, it wouldn't pose any problems, because it is aimed at facilitating the mapping, if compared to spmap.

            Finally, if you're using Stata 15.1, there is a whole bunch of commands (grmap, for example), making this process user-friendly as well. If you have the new Stata version, I strongly recommend you take a look at the manual about this topic.
            Best regards,

            Marcos

            Comment

            Working...
            X