Announcement

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

  • How to make subgroup headings more prominent on forest plot made using metan

    Hello,

    I am very new to using Stata and also to this forum so I'm hoping you can help. I am using Stata 14.0 on Windows 10 and I created a forest plot using metan which I am pretty happy with (see attached). However, I would like to make the subgroup headings (combined, dabigatran, rivaroxaban) bold so that they stand out.

    I read the help documetation for metan and have managed to adjust some formatting from there and I have looked at the help documentation for graph_options and text, however I just cannot figure out what option I need to add to make the subgroups stand out.



    The code I used to make the graph was: metan loghr loglci loguci, eform lcols(author year age doac_dose) second(random) favours(Favours DOAC # Favours Warfarin) sgweight by(doac) boxsca(60)

    This is an example of my data:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str12 author float year byte(doac doac_dose age sex) float(loghr loglci loguci)
    "Forslund"     2017 1 1 1 1  .2546422 -.09431065  .6097656
    "Forslund"     2017 1 2 1 1  .6830968   .1655144 1.1999648
    "Forslund"     2017 1 3 1 1 .08617773 -.34249035  .5007753
    "Bengtson"     2017 2 1 1 1  .2311117  .01980261  .4382549
    "Avgil-Tsadok" 2016 2 1 1 1 .26236424  .13102825  .4054651
    end
    label values doac doac_name_lbl
    label def doac_name_lbl 1 "combined", modify
    label def doac_name_lbl 2 "dabigatran", modify
    label values doac_dose doac_dose_lbl
    label def doac_dose_lbl 1 "all", modify
    label def doac_dose_lbl 2 "standard", modify
    label def doac_dose_lbl 3 "low", modify
    label values age age_lbl
    label def age_lbl 1 "75 and over", modify
    label values sex sex_lbl
    label def sex_lbl 1 "both", modify

    Thank you in advance and sorry if I have added to much information! Anneka
    Attached Files
    Last edited by Anneka Mitchell; 31 Oct 2018, 10:23. Reason: Too many graphs appeared!

  • #2
    Wondering the same thing; I'd like to make the categories (combined, dabigatran, rivaroxaban) and the top row bold. Thank you!

    Comment


    • #3
      Dear Anneka Mitchell

      Sorry, I missed your post back in October. I have since replied to Eustina Kwon 's similar query; see https://www.statalist.org/forums/for...n-forest-plots. Hopefully it will be of use to you too.

      Kind regards,

      David.

      Comment


      • #4
        Hi David Fisher
        Thank you for pointing me towards your answer to Eustina Kwon. Unfortunately, I cannot seem to get admetan to produce a forest plot.

        admetan loges loglci loguci, lcols(study doac doac_dose age_sex) by(doac) forest(hetstat(p) leftj) saving(isch_meta) nograph

        This keeps giving me the following error:
        Error in option lcols() or rcols(): Label name doac attached to variable doac
        is reserved for use by ipdmetan, admetan and forestplot.
        In order to save the results set, please rename the label attached to this variable.
        Error in admetan.BuildResultsSet
        (Note: meta-analysis model was fitted successfully)
        r(101);

        Can you advise as to what I might be doing wrong? I've checked the help file for admetan but cannot work it out.

        Best Wishes,
        Anneka

        Comment


        • #5
          Hi Anneka,

          Unfortunately you have found a bug, which I have now fixed in an update.

          However, you may still find that the results aren't quite what you expect. This is because you are supplying the same variable name (doac) to both by() and to lcols(). The subgrouping variable -- that is, the variable in by() -- plays a particular role in creating the layout of the plot, and is designed to only appear as a subgroup heading, not as a column. Therefore, you may find that you obtain a better result if you create a copy of doac to pass to by(), as follows:

          Code:
          clonevar doac2 = doac
          admetan loges loglci loguci, lcols(study doac doac_dose age_sex) by(doac2) forest(hetstat(p) leftj) saving(isch_meta) nograph
          Hope that helps.

          David.

          Comment


          • #6
            David Fisher thank you for all your help, I've managed to make some nice looking plots using admetan now. Best Wishes, Anneka

            Comment

            Working...
            X