Announcement

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

  • Edit forest plot, admetan

    Dear Statalist,

    I have made a forest plot using admetan, and I wish to edit the output. I have searched this site, but I haven't come up with an answer yet. I've tried different options using codes from other analyses (not admetan).

    I would like the lines to be thinner, and I would like the subgroup title to appear in bold or italic. Can the appearance of the arrows be changed as well? Lastly, is it possible to remove the subtitle "Subgroup and Variable"?


    Code:
    admetan lnor lnlci lnuci, study(variable) eform effect(OR) by(subgroup)  ///
         nowt nooverall keeporder keepall forestplot(nobox nosubgroup favours(Decreased Risk#Increased Risk) ///
      xlabel(0.2 0.5 1 2 5) cirange(.2 5))
    Click image for larger version

Name:	1.png
Views:	1
Size:	79.4 KB
ID:	1489495



    Thank you in advance,

    Best regards,
    Katrine

  • #2
    Dear Katrine,

    Regarding making the subgroup headings bold or italic, and changing the subtitle "Subgroup and Variable", you might find this recent post useful: https://www.statalist.org/forums/for...n-forest-plots

    Appearance of lines and arrows may be changed using standard Stata "twoway" options. See for example help connect_options (for lines) or help twoway_pcarrow (for arrowheads).

    I hope that helps!

    Best wishes,

    David.

    Comment


    • #3
      Dear David,

      Thank you so much for your help - again. It certainly did the trick.

      Best regards,
      Katrine

      Comment


      • #4
        Dear David,

        I am so sorry to bother you again. But is it possible to change the order of the subgroups and not have the default as alphabetical?

        I have tried to use sortby(var) in admetan, but it is overruled. I have tried to generate a variable sorting the outcome after admetan and before forestplot, but it doesn't seem to work either. I cannot seem to find the right phrase using "h forestplot" or "h admetan"

        Thank you,
        Best regards,
        Katrine

        Comment


        • #5
          Dear Katrine,

          Oddly enough you're not the first person to ask about the sortby() option recently... I should update the help file to make it clearer.

          sortby() changes the order of the studies, but not the subgroups. To change the ordering of subgroups you need to use encode or recode (or an equivalent strategy).

          For instance, if your subgroups are A and B, but you want B to appear before A, you could use:

          Code:
          ** If "subgroup" is string:
          label define neworder 1 "B" 2 "A"
          encode subgroup, gen(newsubgroup) label(neworder)
          
          ** Or if "subgroup" is numeric:
          recode subgroup (1=2 "A") (2=1 "B"), gen(newsubgroup) label(neworder)

          Hope that helps,

          David.

          Comment


          • #6
            Dear David,

            Thank you - again. I am sorry if you have answered the very same question in another post. I really try to look the other posts through before asking.

            Best regards,
            Katrine

            Comment

            Working...
            X