Announcement

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

  • meta analysis ratio of means and forest plot

    I am using Stata Version 17. I have two questions about Forest plots. I want to conduct a meta analysis of ratio of means. There does not appear to be a command of meta esize for ratio of means. I calculated with Stata the log ratio of means and the log standard error. I used the meta set approach and the set of commands below

    A)meta set logratio logSEratio, random studylabel(author) eslabel(Log Ratio of Mean)
    B)meta summarize
    C)meta forestplot, nullrefline(favorsleft(Favors Treatment) favorsright(Favors Control) lcolor(red))

    Question 1
    How can I add columns in the Forest plot to display the sample size, mean, and standard deviation for both the treatment and control groups such as is shown when using a command like meta esize below? My reading of the description of meta set is that you cannot add extra columns. Is there any way to add extra columns with data?

    meta esize tn tmean tsd cn cmean csd, esize(hedgesg) random studylabel(author)

    Question 2

    I calculated with Stata the exponentiated log ratio of means and the exponentiated log standard error. I used the commands above for steps A, B, and C with meta set for A and meta forestplot for C.
    The Forest plot with the command of nullrefline still has the vertical line at 0. However, I want the vertical line at 1 since these are now exponentiated data. How can I add such a line at the value of 1 and remove the line at the value of 0? Also, I want to add the content of (favorsleft(Favors Treatment) favorsright(Favors Control) lcolor(red)). My reading of the description of meta set is that you cannot add custom vertical lines. Is there any way to add a vertical line at the value of 1 and then words such as above of favoring?

    Thanks.

  • #2
    Hello, Joshua.

    It is easy to help you if you provide us with a dataset example.

    https://www.stata.com/manuals/metametaforestplot.pdf

    Have you checked page 30 in the manual?

    Comment


    • #3
      I did not find anything useful on page 30 of the manual link that you sent. I posted some data below for three studies. The first column is author with a comma and then year, tn is treatment sample size, tmean is treatment mean, tsd is treatment standard deviation, cn is control sample size, cmean is control mean, and csd is control standard deviation.

      As this is a meta analysis of ratio of means, I used the four commands to obtain my ratios and exponentiated ratios.
      gen logratio = ln(tmean/cmean)
      gen logSEratio = sqrt(1/tn * (tsd/tmean)^2 + 1/cn * (csd/cmean)^2)
      gen ratio = exp(logratio)
      gen SEratio = exp(logSEratio)
      I then did the meta set and forest plot commands below.
      meta set ratio SEratio, random studylabel(author) eslabel(Ratio of Mean)
      meta forestplot, nullrefline(favorsleft(Favors Treatment) favorsright(Favors Control) lcolor(red))

      QUESTION: The nullrefline places content at 0. I want the line at 1 for my exponentiated data. What command can show that content at 1 and not at 0?
      QUESTION: If I would use the meta esize below (and NOT meta set) commands, the Forest plot has additional columns of n, mean, and SD.

      meta esize tn tmean tsd cn cmean csd, esize(hedgesg) random studylabel(author)
      meta forestplot, nullrefline(favorsleft(Favors Treatment) favorsright(Favors Control) lcolor(red))

      The Forest plot does not have content of N, Mean, SD for both treatment and control groups. How do I add columns with data with meta set? There is no meta esize command for ratio of means. I did an AI search and it claims there is such a command of esize(rom). This is an AI hallucination, as this is not in the Stata manual.
      Thanks.

      author tn tmean tsd cn cmean csd
      Brown, 2025 269 9.66 8.57 265 12.27 7.09
      Smith, 2024 131 58.95 44 121 92.3 74.28
      Green, 2023 584 6.39 7.43 834 15.09 14.85

      Comment


      • #4
        I believe all the information needed is in the manual. It may take a bit of time to get the hang of it, but all the details (with examples) are there.

        You can use -dataex- to provide Statalisters with a dataset example. It is the best way to get faster responses.
        Code:
        ssc install dataex
        From page 28-30 in the manual, we can use the following approach:

        Code:
        clear
        input str10 author int tn float(tmean tsd) int cn float(cmean csd)
        "Brown 2025" 269  9.66 8.57 265 12.27  7.09
        "Smith 2024" 131 58.95   44 121  92.3 74.28
        "Green 2023" 584  6.39 7.43 834 15.09 14.85
        end
        
        gen logratio = ln(tmean/cmean)
        gen logSEratio = sqrt((1/tn) * (tsd/tmean)^2 + (1/cn) * (csd/cmean)^2)
        meta set logratio logSEratio, studylabel(author)
        meta forestplot _id tn tmean tsd cn cmean csd _plot  _esci  _weight , nullrefline eform  xlabel(0.38 0.60  1 1.67 2.63)
        You can tweak the code to add other options, as explained in the manual. You can label the variables, create a new string showing mean (SD), say, "9.7 (8.6)", etc.

        Hope this helps.

        Tiago
        Last edited by Tiago Pereira; 07 Jan 2026, 14:19.

        Comment


        • #5
          Dear Tiago:

          Yes, your answer helps. You answered all my questions. Thank you.

          Sincerely,
          Joshua

          Comment

          Working...
          X