Announcement

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

  • How to draw a correlation forest map with the admetan command?

    Dear Statalist, I have recently done a meta-analysis of the correlation coefficient, but I encountered such an error in the process of analyzing a set of data with stata software,I tried it many times, but it failed. Please help me correct the error and rewrite the running code. Thank you!

    My operation process was as follows


    First I run the code
    input str10 study year r n
    Bill 2002 .34 39
    Amanda 2004 .41 80
    Kevin 2004 .55 40
    Geroge 2006 .45 200
    Jacob 2008 .38 98
    lin 2009 .35 100
    Fang 2010 .24 58
    end

    generate z = atanh(r)
    generate sez = sqrt(1/(n - 3))

    metan z sez, label(namevar = study, yearvar = year)

    admetan z sez

    generate _USE = 1

    generate lb = tanh(_LCI)
    generate ub = tanh(_UCI)

    generate _LABELS = study + " (" + string(year, "%02.0f") + ")"

    label var n "Sample size"

    local new = _N + 1
    set obs `new'
    replace _LABELS = "{bf:Overall}" if _n == _N
    replace r = tanh(r(eff)) if _LABELS == "{bf:Overall}"
    replace lb = tanh(r(eff) - (1.96 * r(se_eff))) if _LABELS == "{bf:Overall}"
    replace ub = tanh(r(eff) + (1.96 * r(se_eff))) if _LABELS == "{bf:Overall}"
    replace _USE = 5 if _LABELS == "{bf:Overall}"

    format %-9.0g n

    forestplot r lb ub, nonull effect("Correlation") rcol(n) nowt

    Then I got the result (as shown below. )
    --------------------------------------------------------------------
    Study | Effect [95% Conf. Interval] % Weight
    ---------------------+----------------------------------------------
    1 | 0.354 0.027 0.681 6.06
    2 | 0.436 0.212 0.659 12.96
    3 | 0.618 0.296 0.941 6.23
    4 | 0.485 0.345 0.624 33.16
    5 | 0.400 0.199 0.601 15.99
    6 | 0.365 0.166 0.564 16.33
    7 | 0.245 -0.020 0.509 9.26
    ---------------------+----------------------------------------------
    Overall effect | 0.424 0.343 0.504 100.00
    --------------------------------------------------------------------

    Test of overall effect = 0: z = 10.322 p = 0.000
    Heterogeneity Measures
    ---------------------------------------------------------
    | Value df p-value
    ---------------------+-----------------------------------
    Cochran's Q | 4.46 6 0.614
    I?(%) | 0.0%
    Modified H? | 0.000
    tau? | 0.0000
    ---------------------------------------------------------

    I?= between-study variance (tau? as a percentage of total variance
    Modified H?= ratio of tau?to typical within-study variance
    option lalign() not allowed
    Error in forestplot

    r(198);
    Last edited by bruce song; 28 Nov 2018, 07:57.

  • #2
    Hi Bruce,

    Are you using Stata 14 or earlier? Unfortunately it has recently been brought to my attention that this error will occur, as lalign() was only introduced in Stata 15. When coding that part of forestplot, I did check help whatsnew but as it wasn't mentioned I assumed it existed in previous versions and wouldn't be a problem.

    I will release a corrected version very soon, but in the meantime you can fix it by opening the file "forestplot.ado" (type which forestplot to find out where it is stored on your system) and remove "lalign(center)" from line 3091. (You will need to restart Stata for it to read the new version of the code.)

    Hope that helps; sorry for the inconvenience.

    David.

    (author of admetan and forestplot)

    Comment


    • #3


      Hey, David, thank you for replying me so soon, I did use the stata version 12, after I deleted "lalign(center)", I can get the results (shown below), thank you for your work and help!

      Sincerely

      Bruce


      --------------------------------------------------------------------
      Study | Effect [95% Conf. Interval] % Weight
      ---------------------+----------------------------------------------
      1 | 0.354 0.027 0.681 6.06
      2 | 0.436 0.212 0.659 12.96
      3 | 0.618 0.296 0.941 6.23
      4 | 0.485 0.345 0.624 33.16
      5 | 0.400 0.199 0.601 15.99
      6 | 0.365 0.166 0.564 16.33
      7 | 0.245 -0.020 0.509 9.26
      ---------------------+----------------------------------------------
      Overall effect | 0.424 0.343 0.504 100.00
      --------------------------------------------------------------------

      Test of overall effect = 0: z = 10.322 p = 0.000


      Heterogeneity Measures
      ---------------------------------------------------------
      | Value df p-value
      ---------------------+-----------------------------------
      Cochran's Q | 4.46 6 0.614
      I?(%) | 0.0%
      Modified H? | 0.000
      tau? | 0.0000
      ---------------------------------------------------------
      I?= between-study variance (tau? as a percentage of total variance
      Modified H?= ratio of tau?to typical within-study variance

      Attached Files
      Last edited by bruce song; 29 Nov 2018, 02:00.

      Comment


      • #4
        Hi Bruce,

        Yes, that's right. There is just one line of code which refers to "lalign", and all it does is set a default for precisely how the lines are drawn. So the code should run just fine once you have removed the text "lalign(center)". [Note that the rest of that line should be left as it is, though!]

        I am hoping that my software team will allow me to have an additional older version of Stata installed, so that I can guard against this sort of thing happening again in future.

        Best wishes,

        David.

        Comment


        • #5
          Dear David ,
          Thank you very much for your help last time. I really appreciate it. I have performed a correlation meta-analysis recently. However, I got stuck when I was trying to draw correlation forest plots for subgroup Analysis.


          My operation process was as follows:
          input str10 study year n r method score
          Kearney 2014 239 -0.125 1 5
          Lundell 2017 54 -0.38 1 6
          Yiannakas 2016 51 -0.283 1 8
          Brownlee 2014 55 -0.33 2 6
          Petzold 2016 16 0.17 2 4
          Schneider 2012 34 -0.5 2 5
          Furby 2017 131 0 2 6
          Biao 2018 44 -0.61 2 5
          Jiwon 2014 133 -0.43 3 5
          Evanthia 2014 150 -0.75 3 7
          liu 2016 35 -0.374 3 6
          end

          generate z = atanh(r)
          generate sez = sqrt(1/(n - 3))
          metan z sez,random label(namevar = study, yearvar = year)
          admetan z sez,study(study)by(method)
          generate _USE = 1
          generate lb = tanh(_LCI)
          generate ub = tanh(_UCI)
          generate _LABELS = study + " (" + string(year, "%02.0f") + ")"
          label var n "Sample size"
          local new = _N + 1
          set obs `new'
          replace _LABELS = "{bf:Overall}" if _n == _N
          replace r = tanh(r(eff)) if _LABELS == "{bf:Overall}"
          replace lb = tanh(r(eff) - (1.96 * r(se_eff))) if _LABELS == "{bf:Overall}"
          replace ub = tanh(r(eff) + (1.96 * r(se_eff))) if _LABELS == "{bf:Overall}"
          replace _USE = 5 if _LABELS == "{bf:Overall}"
          forestplot r lb ub, nobox favours(Decreased Risk#Increased Risk) xlabel(-0.5 0 0.5) cirange(-0.5 0.5)

          What should I do next?
          My question is: (1) How to draw forest plots based on the subgroup of different methods.
          (2) How to display the value of I2 on the forest plots.
          (3) Is there any way to show the corresponding score of studies on the forest plots.

          I'm looking forward to your reply, thank you!


          Best regards,
          Bruce




          Last edited by bruce song; 15 Feb 2019, 04:17.

          Comment

          Working...
          X