Announcement

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

  • option label() not allowed in heatplot

    Hi everyone,

    I am having an issue that seems to work fine in Stata 16 on one of my machines, but when I switch over to a separate machine I'm getting the option label() not allowed when I run a heatplot. I thought maybe the option was discontinued in Stata 17, so I switched back to Stata 16.1, and I'm still getting the same error. I'm running this code.

    Code:
    pwcorr q2 q1a q1b q1c q1d q1e q1f q1g q1h q1i q1j q1k q1l q1m q1n q1o q1p q1q [aw=weight], sig
    matrix C = r(C)
    matrix sig = r(sig)
    heatplot C, values(label(sig)) generate
    Indeed, when I pull up the help file on my Mac the option for values(label) exists to substitute the significance values. It says,
    "As seen above, option values() can be used to display the values of the
    correlations with the color fields. It is also possible to print
    alternative information collected from a second matrix using suboption
    label(). In the following example, p-values are printed:

    . pwcorr price mpg trunk weight length turn foreign, sig
    . matrix C = r(C)
    . matrix sig = r(sig)
    . heatplot C, values(label(sig) format(%9.3f)) color(hcl diverging,
    intensity(.6)) legend(off) aspectratio(1)
    But on my help file on the Windows machine, I don't see this as an option. Does anyone know if this option has been discontinued recently? If so, is there a way to incorporate this? I'm trying to produce a heatplot with a correlation matrix with significance stars.

    Thanks.

  • #2
    heatplot is from SSC and written for Stata 14.2 up.

    Code:
    which heatplot
    should give the same result, ideally

    Code:
    *! version 1.1.1  24aug2021  Ben Jann
    on each machine you use. The change from Stata 16 to Stata 17 is unlikely to be material here.

    Comment


    • #3
      Nick Cox That is what was so strange to me. I'm probably using an outdated version in Stata 17. I'll try to update and see what happens. Thanks.

      Comment


      • #4
        The example in #1 is reproducible given the dataset implied

        Code:
        sysuse auto, clear 
         
        pwcorr price mpg trunk weight length turn foreign, sig
        matrix C = r(C)
        matrix sig = r(sig)
        heatplot C, values(label(sig) format(%9.3f)) color(hcl diverging, intensity(.6)) legend(off) aspectratio(1)
        and I just ran that without problems in Stata


        Stata/MP 17.0 for Windows (64-bit x86-64)
        Revision 15 Feb 2022

        using heatplot from SSC as just updated.

        Comment

        Working...
        X