The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


news:news

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
news:news [2021/11/25 09:24] Wolfgang Viechtbauernews:news [2022/04/21 15:45] Wolfgang Viechtbauer
Line 3: Line 3:
 ~~NOTOC~~ ~~NOTOC~~
  
-==== 2021-06-09: Version 3.Released on CRAN ====+==== 2022-04-21: Version 3.Released on CRAN ====
  
-A new version of the metafor package (version 3.0) has been published on CRAN. This version includes a lot of updates that have accumulated in the development version of the package over the past 14-15 months. Some highlights:+A new version of the metafor package (version 3.4) has been released. Some highlights:
  
-  * The documentation has been further improved. I now make use of the [[https://cran.r-project.org/package=mathjaxr|mathjaxr]] package to nicely render equations in the HTML help pages (and in order to do this, I had to create the mathjaxr package in the first place!).  +  * The ''[[https://wviechtb.github.io/metafor/reference/vcalc.html|vcalc()]]'' function was added. With this functionone can construct or approximate the variance-covariance matrix of dependent effect sizes for a wide variety of circumstances
-  * ''[[https://wviechtb.github.io/metafor/reference/selmodel.html|selmodel()]]'' was added for fitting a wide variety of selection modelsincluding the beta selection model by Citkowicz and Vevea (2017), various models described by Preston et al. (2004), and step function models (with the three-parameter selection model (3PSM) as a special case). +  * The ''[[https://wviechtb.github.io/metafor/reference/robust.html|robust()]]'' function, for cluster-robust inferences (also known as robust variance estimation)now interfaces fully with the excellent [[https://cran.r-project.org/package=clubSandwich|clubSandwich]] package, so one can make use of the improved methods therein. 
-  * As another technique related to publication/small-sample biasthe ''[[https://wviechtb.github.io/metafor/reference/tes.html|tes()]]'' function was added to carry out the test of 'excess significance' (Ioannidis & Trikalinos, 2007; see also Francis, 2013)+  * For meta-analyses involving complex dependency structures, ''vcalc()''''rma.mv()'', and ''robust(...clubSandwich=TRUE)'' are all part of a general workflow that can handle the vast majority of dependencies in meta-analyses, as described [[https://wviechtb.github.io/metafor/reference/misc-recs.html#general-workflow-for-meta-analyses-involving-complex-dependency-structures|here]]. 
-  * The ''[[https://wviechtb.github.io/metafor/reference/regtest.html|regtest()]]'' function now shows the 'limit estimateof the (average) true effect/outcome. This is in essence what the PET/PEESE methods do (when the standard errors / sampling variances are used as predictors in meta-regression model). +  * The ''[[https://wviechtb.github.io/metafor/reference/aggregate.escalc.html|aggregate.escalc()]]'' method -- for aggregating ''escalc'' datasets with dependent effect sizes to higher level -- has a new 'structure' (''struct="CS+CAR"''if there are effects at multiple time points and multiple effect sizes at these time points
-  * One can now also fit so-called 'location-scale models' via the ''[[https://wviechtb.github.io/metafor/reference/rma.uni.html|rma()]]'' function (using the ''scale'' argument). With this, one can specify predictors for the amount of heterogeneity in the outcomes (to examine if the outcomes are more/less heterogeneous under certain circumstances). +  * A few more measures were added to ''[[https://wviechtb.github.io/metafor/reference/escalc.html|escalc()]]''''"MPORM"'' for computing marginal log odds ratios based on marginal 2x2 tables and ''"REH"'' for computing the (log transformed) relative excess heterozygosity (this is a bit more esoteric stuff). 
-  * The ''[[https://wviechtb.github.io/metafor/reference/regplot.html|regplot()]]'' function can be used to draw bubble plots based on meta-regression models. For models involving multiple predictors, the function draws the line for the 'marginal relationship' of a predictor. Confidence/prediction interval bands can also be shown+  * ''[[https://wviechtb.github.io/metafor/reference/rma.glmm.html|rma.glmm()]]'' -- for meta-analytic generalized linear (mixed-effects) models -- allows more flexibility in the coding of the group variable and whether the random study effects should be allowed to be correlated with the random group effects
-  * Two functions were added that are related to the meta-analysis of correlation matrices / regression coefficients: ''[[https://wviechtb.github.io/metafor/reference/rcalc.html|rcalc()]]'' for calculating the var-cov matrix of correlation coefficients and ''[[https://wviechtb.github.io/metafor/reference/matreg.html|matreg()]]'' for fitting regression models based on correlation/covariance matrices+  * Even more optimizer choices for ''[[https://wviechtb.github.io/metafor/reference/rma.mv.html#note|rma.mv()]]'' (including a subspace-searching simplex algorithm and the Barzilai-Borwein gradient decent method): If you can't get the model to converge with any of the available options, all hope is lost! 
-  * Sometimesit might be necessary to aggregate meta-analytic dataset with multiple outcomes from the same study to the study levelAn ''[[https://wviechtb.github.io/metafor/reference/aggregate.escalc.html|aggregate()]]'' method for ''[[https://wviechtb.github.io/metafor/reference/escalc.html|escalc]]'' objects was added that can do thiswhile (approximately) accounting for various types of dependencies. +  * All datasets that used to be part of the metafor package have now been moved to the [[https://wviechtb.github.io/metadat/|metadat]] package (which now includes even more meta-analysis datasets)
-  * When using functions that allow for parallel processing, progress bars can now also be shown, thanks to the [[https://cran.r-project.org/package=pbapply|pbapply]] package. Gives you an idea whether to just grab a coffee or go out for lunch while your computer is chugging along. +  * A bunch of smaller convenience features (e.g., some ''as.data.frame()'' methods, a ''refit'' argument in ''anova()'', more use of a ''data'' argument), a few clever tricks with a custom package environment to store settings, and free candy (not really). 
-  * 24 new datasets were added (there are now over 60 datasets included in the package). These datasets also cover advanced methodology, such as multivariate/multilevel models, network meta-analysis, phylogenetic meta-analysis, and models with a spatial correlation structure.+  * Lots of documentation updates, including a description of [[https://wviechtb.github.io/metafor/reference/misc-models.html|fixed- versus random-effects models]][[https://wviechtb.github.io/metafor/reference/misc-recs.html|some recommended practices]], and [[https://wviechtb.github.io/metafor/reference/misc-options.html|miscellaneous options and features]].
  
-Lots of smaller tweaks/improvements were also made. I feel like so much has accumulated that this warranted a version jump to version 3.0.+The full changelog can be found [[:updates#version_34-0_2022-04-21|here]].
  
-==== 2021-04-21Better Degrees of Freedom Calculation ====+==== 2022-03-20Forest Plot with Exact Confidence Intervals ====
  
-In random/mixed-effects models as can be fitted with the ''[[https://wviechtb.github.io/metafor/reference/rma.html|rma()]]'' function, tests and confidence intervals for the model coefficients are by default constructed based on a standard normal distributionIn general, it is better to use the Knapp-Hartung method for this purpose, which does two things: (1the standard errors of the model coefficients are estimated in a slightly different way and (2) a t-distribution is used with $k-p$ degrees of freedom (where $k$ is the total number of estimates and $p$ the number of coefficients in the model). When conducting simultaneous (or 'omnibus') test of multiple coefficients, then an F-distribution with $mand $k-p$ degrees of freedom is used (for the 'numerator' and 'denominator' degrees of freedom, respectively), with $m$ denoting the number of coefficients tested. To use this method, set argument ''test="knha"''.+A question was recently raised on the [[https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis|R-sig-meta-analysis]] mailing list that asked about the difference between the confidence intervals shown in forest plots and those computed based on 'exactmethods (see [[https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2022-March/003947.html|here]] for the question and [[https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2022-March/003950.html|here]] for my response). Using a slightly more common example of a meta-analysis based on $2 \times 2table dataI have written up a little illustration to show how one can create a [[tips:forest_plot_with_exact_cis|forest plot with exact confidence intervals]].
  
-The Knapp-Hartung method cannot be directly generalized to more complex models as can be fitted with the ''[[https://wviechtb.github.io/metafor/reference/rma.mv.html|rma.mv()]]'' function, although we can still use tand F-distributions for conducting tests of one or multiple model coefficients in the context of such models. This is possible by setting ''test="t"''. However, this then raises the question how the (denominator) degrees of freedom for such tests should be calculated. By default, the degrees of freedom are calculated as described above. However, this method does not reflect the complexities of models that are typically fitted with the ''[[https://wviechtb.github.io/metafor/reference/rma.mv.html|rma.mv()]]'' function. For examplein multilevel models (with multiple estimates nested within studies), a predictor (or 'moderator') may be measured at the study level (i.e., it is constant for all estimates belonging to the same study) or at the level of the individual estimates (i.e., it might vary within studies). By setting argument ''dfs="contain"'', a method is used for calculating the degrees of freedom that tends to provide tests with better control of the Type I error rate and confidence intervals with closer to nominal coverage rates. See the documentation of the function for further details.+==== 2022-03-12Over 10,000 Citations ====
  
-==== 2021-04-03Scatter Plots Bubble Plots for Meta-Regression Models ====+Since I don't obsessively check my Google Scholar profile like everybody else does, it is by mere coincidence that I noticed that my [[https://doi.org/10.18637/jss.v036.i03|JSS paper about the metafor package]] has now been [[https://scholar.google.com/scholar?oi=bibs&hl=en&cites=8753688964455559681|cited more than 10,000 times]] (of course, like everybody else, I will ignore the Web of Science count, which isn't quite there yet ...). I greatly appreciate that people are citing the paper and hence supporting the creation and maintenance of this R package in this way. It can still be difficult to receive proper credit for software development in academia, so citing the software is one of the best ways that you can support developers in their work (aside from donating a million bucks you happen to have lying around). I think it also helps if there is a paper or book about the software, which is sometimes a bit easier to cite than the software itself (what was again the APA style for citing software?) and citation counts are more easily tracked for papers/books than citations of the software itself.
  
-I finally got around to adding a function to the package for drawing scatter plots (also known as bubble plotsfor meta-regression models. See the documentation of the ''[[https://wviechtb.github.io/metafor/reference/regplot.html|regplot()]]'' function for further details. An example illustrating such a plot is provided [[plots:meta_analytic_scatterplot|here]].+==== 2022-03-06: Specifying Inputs to the rma() Function ====
  
 +Unfortunately, I have seen a number of cases where users of the metafor package have misspecified the inputs to the ''rma()'' function, giving the standard errors of the effect sizes as an unnamed second argument. This will lead to incorrect results. To explain the problem in more detail (and so that I can simply point people to a place where this issue is explained thoroughly), I have written up [[tips:input_to_rma_function|this discussion]].
 +
 +==== 2022-01-02: More Forest Plot Examples ====
 +
 +Happy New Year! Hope this one will be at least marginally less crazy than the previous ones ...
 +
 +I was recently asked whether I would add the feature to show multiple confidence intervals for each of the studies in a forest plot (e.g., by using lines with varying thickness) to the metafor package. Turns out that one can already do this without too much difficulty using the existing tools, simply by superimposing two forest plots on top of each other. This is illustrated [[plots:forest_plot_with_multiple_cis|here]].
 +
 +I also wanted to see to what extent one can reproduce forest plots created by different software or using the aesthetics of certain journals. I started with the recreation of a forest plot that was obtained using RevMan, the software provided by the Cochrane Collaboration for conducting and authoring Cochrane reviews. You can find the figure and corresponding code for this [[plots:forest_plot_revman|here]]. Then I recreated a forest plot that was obtained from an article in the British Medical Journal. The resulting figure and code can be found [[plots:forest_plot_bmj|here]].
 +
 +Although it takes a bit of effort to recreate these figures (especially if one wants to make them look almost identical to the originals), it shows that one can essentially recreate any forest plot using the various ''forest()'' functions from metafor and then some additional functions like ''text()'', ''points()'', and so on, which give you full control over how things are drawn and the information included in the figure.
news/news.txt · Last modified: 2024/03/29 10:44 by Wolfgang Viechtbauer