Announcement

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

  • Indent Author Names using Metan?

    Hello,

    I am using metan with Stata version 14.1.I want to indent the Author names in my forest plot. To make this more clear my code and graph is below.

    Here is the code I am using:
    HTML Code:
    metan casepos caseneg controlpos controlneg if smear<10, random or graph lcols(author) boxsca(30) nointeger by(smear) nooverall xlabel(0.5, 1, 2, 5,10, 50) force nowt xsize(10) ysize(8) classic astext(60) textsize(80)
    I get this plot:

    Graphfigure3new.png



    I want to indent the author names slightly so it is more clear in which stratification they are in. Is there a command to do this within metan?

    Thank you in advance!

    Leo




  • #2
    Never mind -- I figured out a way! Thanks anyways!

    Have a good day!
    Leo

    Comment


    • #3
      Leo - I have this same question and have not been able to find a successful solution. Would you please share your code?

      Thanks!
      Alex

      Comment


      • #4
        Hey Alex,

        I actually had to open the graph editor and format the graph as requested. That was the only way I could figure it out honestly. I never got any response about code that could potentially do it although I would guess that's its possible.
        Hope that helps
        Leo

        Comment


        • #5
          Thank you - I tried that as well, but could not get it to work in v14.2...however, that could be my own deficiency as I always rarely use the graph editor. I'll play with it more - thanks again!!

          Comment


          • #6
            I came to this thread hoping to find an answer for similar purposes. I'll post an update here in case it is of help to future users (maybe it's obvious to most!) And maybe others have found a better workaround than this, in which case I encourage them to add to this. (I am using Stata 18.)

            After some digging, I had success with including SMCL tags before the 'author' name. This is implemented in the variable itself, not in the code for -forestplot-. So, for example, I altered the dataset to something like this:

            Code:
            replace author = "{space 5}Shaw, 1948-1952" if author == "Shaw, 1948-1952"
            And then just ran forestplot again accordingly.

            (I did try {dlgtab} as well, but it created some unsightly horizontal lines on the plot that didn't work.)

            For Stata newbies like me who are not very familiar with SMCL, there's two nice help documents here (https://www.stata.com/manuals13/psmcl.pdf) and here (https://www.stata.com/bookstore/pdf/g_text.pdf).

            Comment

            Working...
            X