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 [2023/05/09 06:41] – [2023-05-08: Version 4.2-0 Released on CRAN] Wolfgang Viechtbauernews:news [2023/08/13 10:18] Wolfgang Viechtbauer
Line 2: Line 2:
  
 ~~NOTOC~~ ~~NOTOC~~
 +
 +==== 2023-08-13: Dynamic Plot Colors Based on the RStudio Theme ====
 +
 +I am quite excited about a new feature that will be part of the upcoming version of the metafor package. The package now creates all plots in such a way that (if one sets ''setmfopt(theme="auto")'') they will have a consistent look depending on the chosen [[https://docs.posit.co/ide/user/ide/guide/ui/appearance.html#editor-themes|RStudio theme]]. You can see below some examples of how various plots change their look according to the theme:
 +
 +{{news:plots-rstudio-theme.mp4?800x500&nolink}}
 +
 +This creates a more pleasing experience when working interactively with RStudio, but could also be useful when creating presentations that do not use a white background. 
 +
 +The default setting (''setmfopt(theme="default")'') uses the default colors of the plotting device (which is typically a white background and a black foreground color), but one can also use ''setmfopt(theme="dark")'' to force plots to be drawn using a 'dark mode' (this may be useful when working with a different programming editor or IDE that also uses a dark mode).
  
 ==== 2023-05-08: Version 4.2-0 Released on CRAN ==== ==== 2023-05-08: Version 4.2-0 Released on CRAN ====
Line 33: Line 43:
  
 The full changelog can be found [[:updates#version_42-0_2023-05-08|here]]. The full changelog can be found [[:updates#version_42-0_2023-05-08|here]].
 +
 ==== 2023-03-19: Version 4.0-0 Released on CRAN ==== ==== 2023-03-19: Version 4.0-0 Released on CRAN ====
  
Line 43: Line 54:
 If you come across any issues/bugs, please report them [[https://github.com/wviechtb/metafor/issues|here]]. However, for questions or discussions about these functions (or really anything related to the metafor package or meta-analysis with R in general), please use the [[https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis|R-sig-meta-analysis]] mailing list. If you come across any issues/bugs, please report them [[https://github.com/wviechtb/metafor/issues|here]]. However, for questions or discussions about these functions (or really anything related to the metafor package or meta-analysis with R in general), please use the [[https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis|R-sig-meta-analysis]] mailing list.
  
- 
-==== 2022-10-15: Allowing $\tau^2$ to Differ Across Subgroups ==== 
- 
-A while ago, I wrote up a little discussion on how comparing estimates of independent meta-analyses or subgroups [[tips:comp_two_independent_estimates|here]]. Part of this discussion touched upon subgroup analyses and two possible approaches thereof, one where we assume that the amount of heterogeneity ($\tau^2$) is the same within the various subgroups and one where we relax this assumption and allow $\tau^2$ to differ across groups. I now wrote up a more extensive discussion of this [[tips:different_tau2_across_subgroups|here]] where I also illustrate several different methods/models for conducting a subgroup analysis that allow the amount of heterogeneity to differ across the subgroups. 
- 
-==== 2022-10-07: Convergence Problems with the rma.mv() Function ==== 
- 
-I already had written up a little [[tips:convergence_problems_rma|discussion]] of convergence problems that can arise when using the ''rma()'' (i.e., ''rma.uni()'') function (and some remedies to deal with them) previously. I have now added an analogous discussion for the ''rma.mv()'' function [[tips:convergence_problems_rma_mv|here]]. 
- 
-==== 2022-09-26: Confidence Intervals for $R^2$ ==== 
- 
-The (pseudo) $R^2$ statistic that is shown in the output for meta-regression models fitted with the ''rma()'' function provides an estimate of how much of the total amount of heterogeneity is accounted for by the moderator(s) included in the model (Raudenbush, 2009). However, it is important to realize that this statistic can be quite inaccurate, especially when the number of studies ($k$) is small. We may therefore want to construct a confidence interval to get a better sense of how precise the value may be. This can be done using bootstrapping, as illustrated [[tips:ci_for_r2|here]]. I also conducted a small simulation study to examine how well bootstrapping actually works for constructing CIs for $R^2$. The results indicate that the bias-corrected and accelerated (BCa) CI actually works quite well, as long as $k$ is at least 40 and the true value of $R^2$ is not too small. 
- 
-==== 2022-08-27: Version 3.8-1 Released on CRAN ==== 
- 
-I just sent a new version (3.8-1) of the metafor package to CRAN. This update was prompted due to a small issue in the help pages (related to my use of MathJax to render nice equations in the docs), which was easy to fix. I took the opportunity to incorporate some other updates into the new version, which provide a bit of polish. 
- 
-One thing I am kind of excited about is the completely overhauled ''[[https://wviechtb.github.io/metafor/reference/vif.html|vif()]]'' function for computing variance inflation factors. One of the major difficulties with VIFs is their interpretation. Is a particular value 'large'? Commonly used cutoffs like 5 or 10 are quite arbitrary. To make it easier to gauge whether a VIF value is relatively large, one can now simulate the distribution of a VIF under independence, similar to a 'parallel analysis' that is used in factor analysis to determine the number of factors. One can then examine how extreme the actually observed VIF is under this distribution. A [[https://wviechtb.github.io/metafor/reference/plot.vif.rma.html|plot method]] is also available to visualize this. 
- 
-There is now some more support for using an identity link when fitting location-scale models with the ''[[https://wviechtb.github.io/metafor/reference/rma.uni.html|rma()]]'' function, although the default log link is typically the better choice and avoids having to use constrained optimization to fit the model. 
- 
-I also added (experimental!) support for additional measures (e.g., log risk ratios and risk differences) to ''[[https://wviechtb.github.io/metafor/reference/rma.glmm.html|rma.glmm()]]'' (by using log and identity links in the generalized linear mixed-effects model), but using these measures will often lead to estimation problems. For 2x2 table data, the log odds ratio (i.e., using a logit link) is still the preferred choice. 
- 
-Another nice feature when computing standardized mean differences with the ''[[https://wviechtb.github.io/metafor/reference/escalc.html|escalc()]]'' function is that one can now specify d-values and t-test statistics directly. This makes it easier to assemble data for a meta-analysis with SMD values, as described [[tips:assembling_data_smd|here]]. 
- 
-Aside from this, there were a few smaller improvements. The full changelog can be found [[:updates#version_38-1_2022-08-26|here]]. 
- 
-==== 2022-08-22: Another Multilevel Meta-Analysis Example ==== 
- 
-My go-to example for illustrating the use of a multilevel meta-analysis is based on the dataset in the paper by [[analyses:konstantopoulos2011|Konstantopoulos (2011)]]. It is a nice example, but slightly unusual, since the multilevel structure in the dataset involves a clustering variable above studies. 
- 
-In practice, one is more likely to encounter cases where studies form the higher level clustering variable, with multiple effects/outcomes reported within at least some of the studies (e.g., for different samples). Such an example arises in the meta-analysis by [[analyses:crede2010|Credé et al. (2010)]] on the relationship between class attendance and grades, which I have now added as a case study to the analysis examples. 
- 
-==== 2022-06-19: Difference Between the Omnibus Test and Individual Predictors ==== 
- 
-When a meta-regression model includes multiple predictors, one can examine the significance of each individual predictor (i.e., coefficient), but also the significance of the model as whole. For the latter, we can conduct an omnibus test that tests the null hypothesis that all predictors are unrelated to the effect sizes. It can happen that the omnibus test leads to a different conclusion than tests of the individual coefficients. An illustration and discussion around this phenomenon is provided [[tips:diff_omnibus_vs_individual_tests|here]]. 
- 
-==== 2022-06-13: Forest Plot with Adjusted Text Position ==== 
- 
-By default, the ''forest()'' function places the annotations (giving the study-specific estimates and corresponding confidence interval bounds) to the right of the actual forest plot. See [[plots:forest_plot|here]] for an example. Sometimes, we might prefer to show those annotations in a different position. This can be done with the ''textpos'' argument, which takes as input a vector of length 2 to specify the placement of the study labels and the annotations. An illustration of the use of this argument is provided [[plots:forest_plot_with_textpos|here]]. 
- 
-==== 2022-05-24: Increasing Value of $\tau^2$ When Adding Moderators ==== 
- 
-In (mixed-effects) meta-regression models, it can happen that the estimate of $\tau^2$ (which denotes the amount of heterogeneity not accounted for by the model) exceeds the estimate of $\tau^2$ from the random-effects model (which denotes the total amount of heterogeneity). I have written up a little illustration to demonstrate and discuss this somewhat counterintuitive result [[tips:increasing_tau2_when_adding_moderators|here]]. 
- 
-==== 2022-04-27: Forest Plot with Aggregated Values ==== 
- 
-When a meta-analysis involves studies that contribute multiple effect size estimates to the analysis, the dataset can quickly become so large that drawing a forest plot of the individual estimates becomes infeasible. As an alternative visualization, we can aggregate estimates within studies and then use these aggregated values in a forest plot. I have written up [[tips:forest_plot_with_aggregated_values|a little illustration]] to show how this can be done. 
- 
-==== 2022-04-21: Version 3.4 Released on CRAN ==== 
- 
-A new version of the metafor package (version 3.4) has been released. Some highlights: 
- 
-  * The ''[[https://wviechtb.github.io/metafor/reference/vcalc.html|vcalc()]]'' function was added. With this function, one can construct or approximate the variance-covariance matrix of dependent effect sizes for a wide variety of circumstances. 
-  * 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. 
-  * 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/aggregate.escalc.html|aggregate.escalc()]]'' method -- for aggregating ''escalc'' datasets with dependent effect sizes to a 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. 
-  * 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). 
-  * ''[[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. 
-  * 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! 
-  * 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). 
-  * 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). 
-  * 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]]. 
- 
-The full changelog can be found [[:updates#version_34-0_2022-04-21|here]]. 
- 
-==== 2022-03-20: Forest Plot with Exact Confidence Intervals ==== 
- 
-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 'exact' methods (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 2$ table data, I 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]]. 
- 
-==== 2022-03-12: Over 10,000 Citations ==== 
- 
-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. 
- 
-==== 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