Announcement

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

  • metan: A comprehensive update to the popular meta-analysis command


    With thanks as ever to Kit Baum, I am excited to announce a major update to the user-written command "metan", version 4.0, now available via SSC.

    Firstly, a bit of history: as described in this thread I previously released v3.x of the admetan / ipdmetan meta-analysis command suite, and presented it at the 2018 London UK Stata Conference. One of the discussions that emerged was the possibility of merging admetan with the ever-popular but venerable metan, which had not been updated for a decade and currently has no dedicated support. Over the past year I have worked with Professor Jonathan Sterne, a co-author of metan, and Professor Julian Higgins -- both eminent figures in the meta-analysis field -- to make this happen. An important aspect of this work has been to make the update as seamless as possible -- that is, to enable existing metan users to continue to use the command in the same way as before, if they so wish. We have also ensured that all default behaviour is in keeping with current best practice in the field.

    Much of the "new" functionality is simply carried over from admetan, and as such is described in this thread. However, all new behaviour, and differences from the previous version and from Stata 16's meta suite, are fully documented in the *.sthlp files. In particular:
    • Standard heterogeneity output, including I-squared, is always based on a single Q statistic calculated directly from the data (either Cochran's Q, or a common-effect alternative e.g. using the Mantel-Haenszel log-effect size and weights) rather than on tau-squared. Tau-squared is reported in a separate table. If the user also wishes to see I-squared as derived from tau-squared and sigma-squared (see Higgins & Thompson 2002), they may use the option isqparam (see documentation).
    • Returned and saved effect sizes, standard errors and confidence intervals are *always* on the interval/log scale, even with Mantel-Haenszel methods. This avoids confusion when comparing between models (see below) and enables standardised interface with other commands. (However, note that previously-returned statistics such as r(RR) are still, additionally, available.)
    • A major new feature: the results of multiple models -- inverse-variance, Mantel-Haenszel, DerSimonian-Laird, REML, and so on -- may be presented simultaneously beneath the list of individual studies on-screen and in a forest plot. Presented weights are taken from the first model in the list. All pooled results, heterogeneity statistics etc. are returned in matrices. This can also be combined with a (single) subgroup variable with by().
    • metan now incorporates the functionality of the user-written programs metacum, metaninf and metaprop, respectively for cumulative and influence meta-analysis and meta-pooling of proportions. The older programs call metan from within them, and *should* still work OK (due to our desire for the update to be seamless), but it is recommended that metan now be used instead, with the options cumulative, influence or proportion as required (see documentation).
    As a result of this update, the admetan package will no longer be maintained. However, ipdmetan remains as a separate package -- albeit with a dependency on metan -- and will continue to be maintained (a small update to ipdmetan is also now available via SSC).

    Since this is such a major update, there are bound to be teething troubles; so please don't hesitate to contact me ([email protected]) with any bugs or other issues. If all else fails, the previous version of metan is still available within the package under the name metan9.ado.

    I hope you find the updated package useful.

    Season's greetings to all!

    David.


    David Fisher
    Statistician
    MRC Clinical Trials Unit at UCL, London, UK
    e-mail: [email protected]


    P.S. Apologies to anyone who has started threads here, or replied to existing threads, with issues related to admetan, ipdmetan or forestplot (or, indeed, metan) over the last couple of months; I've been putting all my energy into getting this update out. I will now try to catch up!

  • spencer keene
    replied
    Sorry coming back to my issue. it seems I found the answer here: metan/Examples/Example3.md at main · UCL/metan · GitHub

    I will try it now and leave an update

    Leave a comment:


  • spencer keene
    replied
    Thanks Nick. I will try to email him tomorrow if no reply here

    Leave a comment:


  • Nick Cox
    replied
    David Fisher is assiduous about answering on this topic once he knows there's a question. See if that ping works; otherwise email him directly.

    Stack Overflow is not a good place for this kind of question, as most people active there on Stata know very little about meta-analysis. I'd delete your SO post.

    Leave a comment:


  • spencer keene
    replied
    My question above was also posted to StackOverflow: https://stackoverflow.com/questions/...using-stata-16

    Leave a comment:


  • spencer keene
    replied
    Hello All,

    I have an issue where I would like to fill the boxes with colours according to a variable called exp_comp which has two subgroups. The final forest plot should have two estimates (one red and one blue) per group. admetan achieved something similar with the addition of plotid(exp_comp) forestplot(ci1opt(lcolor(red)) box1opt(mcolor(red)) ci2opt(lcolor(blue)) box2opt(mcolor(blue)))
    However, admetan does not do quite what I would like. My metan command is below:

    metan coef se, eform lcols(exp_comp) ///
    by(group) nosubgroup rcols(rr_ci p_val2) xlabel(0.75, 1,1.5, 2.0) force astext(72) classic boxsca(50) nostats ///
    textsize(120) boxopt() diamopt(lc(black) lw(thin)) pointopt() ciopt(lw(vthin)) /*aspect(1.8)*/ ///
    olineopt(lc(black) nobox lw(vthin) lp(shortdash)) nooverall graphregion(fcolor(white))

    Leave a comment:


  • Mah Tab
    replied
    Hi David

    I am using metan to do a meta-analysis and create forest plots for it. I have data on hazard ratios with their CI. In the output from Stata, I can see that tau-squared comes with confidence interval. I am able to add the tau- squared and I-squared to the forest plot. However, I don't know how I can incorporate the confidence intervals in the forest plot. What I want is that when I create the forest plot, the heterogeneity metrics along with their confidence intervals be reported in the plot.
    This is the code I used.

    Code:
    metan logHR loglowerCI logupperCI, eform effect(Hazard ratio) random(ebayes) forestplot(hetinfo (isq tausq) extraline(yes))
    Best regards,
    Mah

    Leave a comment:


  • David Fisher
    replied
    Just a quick note: Users of metan running Stata 15 or older may have encountered an error message as described in this thread: https://www.statalist.org/forums/for.../1758050-metan
    If so, they should update to new version 4.08.1 12jul2024. This is a minor patch, and no other changes have been made since v4.08.
    Thanks,
    David.

    Leave a comment:


  • David Fisher
    replied
    Dear all,

    With thanks as ever to Kit Baum, an updated version of metan (v4.08 17jun2024) is now available via SSC.

    The following bugs have (hopefully) been fixed (among other more minor ones!):
    • The issue with repeated heterogeneity across subgroups, as described in post #57 above
    • A related issue, resulting from heterogeneity info being placed on separate line from the effect size (e.g. with counts, or via option extraline() )
    Other improvements and changes:
    • After helpful discussions with Suhail Doi, weighting information for cumulative or influence (leave-one-out) meta-analysis is no longer displayed as "% Weight", because under random-effects models the "weights" are not directly interpretable as such, since the estimated heterogeneity variance is not constant across estimates (i.e. the denominator for the weights is not consistent). Instead the phrase "Ratio of Variances" is used, showing the ratio of the current estimate relative to that of the final estimate (i.e. with all studies included). The weighted boxes themselves have not changed, and the box weights and/or the display of the "weights" column may be suppressed as usual via the nobox or nowt options. Additionally, a new variable _WT_Final is left behind, containing the weights corresponding to the final estimate (i.e. with all studies included -- that is, a standard meta-analysis).
    • Introducing a new forestplot option, colsonly, which allows "compound" forest plots to be constructed, in which the study names and associated information may be placed within a separate plot, to avoid either repetition or inconsistency sizing of sub-plots. A new example is given in the help file to demonstrate this.
    As ever, thanks to all users who have reported issues or made suggestions -- please continue to do so! For instance, I am aware that metan currently does not allow multiple subgroup variables within the by() option, whereas the equivalent option in Stata's meta suite does; I will try to implement this in the next version, time permitting.

    Finally, a reminder also that metan has an associated GitHub page here.

    Best wishes,

    David.
    Last edited by David Fisher; 18 Jun 2024, 02:49.

    Leave a comment:


  • Suhail Doi
    replied
    Hi David

    I figured out where the bug is described in post #57:
    The original command used was:
    Code:
    metan lnes lneslci lneshci if smoking !=0 & ma==1,  model(ivhet)  study( studyid )  forestplot(astext(85) textsize(100) boxscale(50) spacing(1) leftjustify range(0.3 2.1) dp(2))  extraline(yes) hetinfo(isq) by(smokcat) eform(HR) noover
    When I drop extraline(yes) in the following code then all is well:
    Code:
    metan lnes lneslci lneshci if smoking !=0 & ma==1,  model(ivhet)  study( studyid )  forestplot(astext(85) textsize(100) boxscale(50) spacing(1) leftjustify range(0.3 2.1) dp(2)) hetinfo(isq) by(smokcat) eform(HR) noover
    Regards
    Suhail

    Leave a comment:


  • Suhail Doi
    replied
    Hi David,

    There is a bug in the subgroup forest plots in the latest version - the heterogeneity estimate in the last subgroup is repeated across previous subgroups but the main output page has the right values (only affects the forest plot). An example is given below where the I2 in the first group is 0%

    Regards
    Suhail
    Click image for larger version

Name:	figure 2.tif
Views:	1
Size:	47.3 KB
ID:	1735007

    Leave a comment:


  • David Fisher
    replied
    Dear all,

    With thanks as ever to Kit Baum, an updated version of metan (v4.07 15sep2023) is now available via SSC.

    The following bugs have (hopefully) been fixed (among other more minor ones!):
    • Proportion data: fixed bug which caused predictive intervals to sometimes be displayed incorrectly (e.g. with subgroups)
    • The issue with Quality Effects weights described in post #51 above
    Other improvements and changes:
    • Implemented "pooled" heterogeneity variance across subgroups (see e.g. Borenstein et al 2009)
    • Weights from multiple models can now be displayed in the forest plot and/or saved to the "results set", with new option allweights
    • Heterogeneity information display on forest plots is now more clearly arranged, particularly in complex plots e.g. with multiple models. I have also implemented the long-requested change so that the heterogeneity p-value under homogeneity is shown as "p < 0.001" rather than "p = 0.000".
    • Alignment of columns of data in forest plots is now handled via mlabpos(), which should hopefully reduce the risk of columns looking "wiggly" (see e.g. https://www.statalist.org/forums/for...text-alignment)
    • Due to a subtle but annoying error involving prediction intervals, I have introduced a new value for _USE (_USE==7) specifically for storing prediction interval data. It shouldn't make any obvious difference to how output is displayed.
    As ever, thanks to all users who have reported issues -- please continue to do so!


    I also presented a poster on metan at this year's Cochrane Colloquium in London earlier this month, and had a few interesting chats as a result. In order to "show off" the capabilities, I put together a series of forest plot examples, some of which were inspired by previous posts here on Statalist, or from email communications -- so thankyou for those. (All data for the examples were taken from published articles!) See our GitHub page here (scroll down to the "Examples" section). If I can find the time, I will try to put up more examples e.g. of particular analyses approaches or use-cases.


    Best wishes,

    David.

    Leave a comment:


  • Helen Jiahuan He
    replied
    Thank you very much David, somehow there is no such error anymore so the issue has been resolved!

    Leave a comment:


  • Suhail Doi
    replied
    Thanks David for the update in #53. Sounds good and I am glad it was nothing too serious. Look forward to your thoughts on the other issue as I have been working on the 'conclusiveness of meta-analyses' and all methods so far use the CMA results and from that perspective CMA in the main results and saved results seem logical though admetan can be used as well.

    Regards
    Suhail

    Leave a comment:


  • David Fisher
    replied
    Suhail Doi : Thanks for this example. The error arises as part of a check that I included in the code, to check that the total weight remains the same before & after the correction detailed in your 2015 CCT paper (which of course should always be the case, mathematically speaking). I have tracked the issue down to a line of code where a variable is not generated in double-precision, so that in this specific example, we see sufficient rounding-error for the error message to be triggered. This will be fixed in the next version. In the meantime, one way to avoid the issue is to run separate models in each subgroup; only "subgroup" calculations are affected by this issue, not "overall" calculations. Apologies!
    (P.S. I will contact you separately about the issue you raised back in April in post #50. I have been too busy to respond until recently, but I do have some thoughts on that.)

    Helen Jiahuan He . Unfortunately I am unable to replicate this error. Furthermore, if you type ssc describe metan, you can see that the file labbe.ado is listed as part of the package. Could it be a network or firewall issue? Ultimately, I guess the thing to do would be to contact SSC/RePEc via the email address they provide.

    Thanks,
    David.

    Leave a comment:

Working...
X