Announcement

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

  • Heatmap in Stata

    I am trying to create a heatmap that is gridded by 10% deciles of two variables. I want them to measure in terms of Y. So I have a series, say x1 and another x2 and used the following
    Code:
    xtile dx1 = x1, nquantiles(10)
    xtile dx2 = x2, nquantiles(10)
    hmap dx1 dx2 y, noscatter
    and I get the following:
    Click image for larger version

Name:	heatmapexample.JPG
Views:	1
Size:	33.1 KB
ID:	1512330


    I want to put labels for the axes and a legend for what each colour represents. The documentation for -hmap- is severely lacking in options.
    Side note: the grey squares imply missing observations which is ok.

    In short: Is anyone familiar with -hmap- or have an alternative? I may just settle on creating a contour plot if I can't figure this out by the end of the week.
    Thanks ahead!

  • #2
    hmap is by Austin Nichols and available from SSC (as you are supposed to tell us -- see Forum FAQ). As a potential alternative, check out Ben Jann's heatplot, also on SSC

    Comment


    • #3
      Thank you, -heatplot- is what ive been looking for. Sorry for not including the source for the code, I will do so from now on.

      Comment

      Working...
      X