Announcement

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

  • Volcano plot

    Hi,

    I am wondering if it is possible to create a volcano plot in Stata. I want to present a large number of outcomes, both significant and not significant. I didn't create it before, so I don't have experience with it.

  • #2
    Dataex please

    Comment


    • #3
      Originally posted by Jared Greathouse View Post
      Dataex please
      please find an example below.
      Last edited by Noor Ahmad; 06 Mar 2023, 01:08.

      Comment


      • #4
        Code:
        * Example generated by -dataex-. For more info, type help dataex
        clear
        input str14 outcome float(coef se pvalue ci_l ci_u)
        "SU"        -1.4595655 .14353406  2.755579e-23  -1.741194 -1.1779372
        "AL"        -1.4105432   .167224 1.0182623e-16 -1.7386538 -1.0824327
        "AT"  1.2288225 .18672407  7.188197e-11   .8624509   1.595194
        "Ap"          1.0382018 .18100072 1.2495543e-08   .6830601  1.3933436
        "Bo"      1.0915558 .19679554  3.638013e-08   .7054231  1.4776887
        "DY"        -1.0109191 .18807442  9.323358e-08 -1.3799403   -.641898
        end
        Last edited by Noor Ahmad; 06 Mar 2023, 01:07.

        Comment


        • #5
          Okay. When I'm home in a few hours (bout 3pm EST) I'll look at this. In the meantime, others who now have your dataset may be able to assist. For reference, this is the plot of interest.

          I've never really seen this plot before. Perhaps Nick Cox could comment on its utility?

          Comment


          • #6
            Volcano plots are really just scatter plots with restrictions on the data being plotted, such that some continuous measure (like an odds or risk ratio, usually with the raw values on a log-scaled axis) is along the x-axis and p-values (or rather, the log transformation) is plotted on the y-axis. In this sense, -twoway scatter- is directly used. Sometimes additional annotations are applied, such as reference lines or marker labels, etc. They get their name because the resulting plot looks like a volcanic explosion (V-shaped).

            I’m away from my desk so I cannot suggest code, but is this the sort of graph you have in mind?

            Note: there is a user-contributed volcano plot package (-search volcano plot-) but this is for the very specific purpose of safety related plots using clinical trial data and I don’t think it can be applied here.
            Last edited by Leonardo Guizzetti; 06 Mar 2023, 06:30.

            Comment


            • #7
              Here's an example of a basic technique:

              Code:
              gen nlogp = -log10(pvalue)
              scatter nlogp coef, ysc(range(0 .)) ///
                , yline(`=-log10(0.05)') xline(0) ///
                ytitle("-log10(P-value)")

              Comment


              • #8
                Thank you very much Jared Greathouse and Leonardo Guizzetti I really appreciate your help.

                Comment


                • #9
                  I don't have anything useful to add.

                  I can only muse on the delicate trade-off between (a) evocative names for particular plots, which can amuse, entertain or inspire and (b) the fact that many such plots are just some standard plot, such as scatter or line, so that you don't need any special command, just some calculations first.

                  Comment

                  Working...
                  X