Announcement

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

  • metan on Stata 16 column name

    Hi everyone,

    I've been recently using "metan" on Stata 16 to update my previous meta-analysis results. Noticed some nice handy changes on the forest plot and also the following issue.

    The same code was used to draw the forest plot stratified by the categorical variable "RiskBiasN" in Stata 14/15 and 16. Stata 14/15 prints only "Study" on top of the most left-hand side column as I put it in the lcols option; however, Stata 16 gives additionally the by variable as the header for the column (shows as "RiskBiasN and Study").
    I wanted to have only "Study" in the header for the column and wondered if anyone knows how to achieve it in the code (Graph editor won't fix and graph editing tool is not the desired solution ). Thanks in advance.

    Code:
     metan lnOR lnOR_LCI lnOR_UCI, eform randomi xlabel(0.01 0.5 1 2 5 10 20 100,force) by (RiskBiasN) effect(Odds Ratio) lcols(Study) null(1) nobox textsize(100)
    Click image for larger version

Name:	CaptureStata.JPG
Views:	1
Size:	85.4 KB
ID:	1607194


    Regards,
    Sifan

  • #2
    Hi Sifan, did you manage to solve this issue?

    Comment


    • #3
      Hi both,

      Firstly, apologies Sifan Cao for missing your original post back in May!

      To clear up some confusion: the command metan is a long-running community-contributed command which is not part of official Stata. I am the current maintainer of this package, and in the past ~18 months there have been various updates (see e.g. this Statalist post), following a period of some years where it was not formally maintained. By coincidence, this time period has also seen the arrival of new, official Stata commands for meta-analysis! So I can fully understand the confusion

      To answer Sifan's question: I can't remember exactly now, but at some stage my collaborators and I must have decided it would be best to have the column name explicitly reference both the study ID and the subgroup ID; hence the change. Different software handles this differently: e.g. Cochrane's Review Manager displays the generic heading "Study or Subgroup", whereas the metafor command in R has a similar behaviour to metan.

      I would be happy to consider adding an option in the next update to facilitate this; but in the meantime you can achieve it as follows:

      Code:
      preserve
      metan lnOR lnOR_LCI lnOR_UCI, or randomi xlabel(0.01 0.5 1 2 5 10 20 100,force) by(RiskBiasN) lcols(Study) nobox nograph clear
      label variable _LABELS "Study"
      forestplot, useopts
      restore
      All commands and variables here are described in the documentation (see help metan), but just to quickly explain what is going on here: basically, we want to make metan "pause" before drawing the forest plot, so that we can change the default column heading. Because metan makes changes to the data prior to plotting, and we want to edit this changed data (and not our original data), we first use preserve. Then, we use the clear option to metan, which loads this changed data into memory. We make our desired change -- in this case, changing the variable label of the left-hand column, which by default is named _LABELS. Finally, the command forestplot, useopts means "draw the forest plot, carrying forward all the options previously supplied to metan" (that is, xlabel() nobox and so on).

      Best wishes,

      David.

      Comment


      • #4
        Just updating this thread in light of an email I received recently from a metan user. In the most recent version (v4.07 15sep2023) there is a new option, labtitle(), which allows you to directly modify the default heading for the left-most column. So, for example, the code above could be simplified to:
        Code:
        metan lnOR lnOR_LCI lnOR_UCI, or randomi xlabel(0.01 0.5 1 2 5 10 20 100,force) by(RiskBiasN) lcols(Study) nobox labtitle(Study)

        Comment


        • #5
          Thank you so much, David. This is very helpful. I am glad I am still doing meta-analysis (not the same one! ) and came across your solutions now.
          Best,
          Sifan

          Comment

          Working...
          X