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/08/13 10:21] Wolfgang Viechtbauernews:news [2024/03/29 10:40] Wolfgang Viechtbauer
Line 2: Line 2:
  
 ~~NOTOC~~ ~~NOTOC~~
 +
 +==== 2024-03-28: Version 4.6-0 Released on CRAN ====
 +
 +A new version of the metafor package has been released on CRAN. This update occurred a bit sooner than originally planned, but there were two minor issues that flagged metafor as requiring an update as otherwise it would have been archived on CRAN, which would have led to some unpleasant consequences for other packages that depend on metafor. So an update needed to be pushed out relatively quickly.
 +
 +The issues themselves were easy to fix. The first was a very minor formatting oversight in one of the help files. The second issue was the result of two packages being archived that metafor had listed as suggested packages, namely [[https://cran.r-project.org/package=Rcgmin|Rcgmin]] and [[https://cran.r-project.org/package=Rvmmin|Rvmmin]]. These packages provided some alternative optimizers that could be chosen for fitting certain models, but were not essential dependencies for the metafor package and hence could be easily removed. Actually, these optimizers have been moved to the [[https://cran.r-project.org/package=optimx|optimx]] package and will probably be reincorporated into metafor later on.
 +
 +The update itself took a bit longer (prompting a few well-deserved reminders from the CRAN team) due to other work-related responsibilities, plus I wanted to finish a few other updates to the package I was working on in the meantime. The full changelog can be found [[:updates#version_46-0_2024-03-28|here]] but I would like to highlight a few items.
 +
 +First of all, I have finally added effect sizes measures for computing the standardized mean change using raw score standardization with pooled standard deviations to the ''[[https://wviechtb.github.io/metafor/reference/escalc.html|escalc()]]'' function. Traditionally, following Becker's 1988 seminal paper ([[https://doi.org/10.1111/j.2044-8317.1988.tb00901.x|link]]), this measure was computed with $$d = \frac{\bar{x}_1 - \bar{x}_2}{s_1},$$ where $\bar{x}_1$ and $\bar{x}_2$ are the means at the two measurement occasions and $s_1$ is the standard deviation of the raw scores observed at the first measurement occasion (followed by a slight bias correction applied to $d$). In principle, one can also use $s_2$ in the denominator, but crucially, only one of two standard deviations is used for the standardization. While there is nothing inherently wrong with doing so (and it simplifies the derivation of the exact distribution of $d$), some would prefer to pool the two standard deviations and hence use $$d = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2 + s_2^2}{2}}}$$ as the effect size measure (i.e., we average the variances and then take the square-root thereof). This is now possible with ''measure="SMCRP"'' under the assumption that the true variances are the same at the two measurement occasions and as ''measure="SMCRPH"'' without this assumption, that is allowing for heteroscedasticity of the two variances (in the latter case, the computation of the sampling variance needs to be adjusted slightly). See the [[https://wviechtb.github.io/metafor/reference/escalc.html#-outcome-measures-for-change-or-matched-pairs|documentation of the escalc function]] for further details.
 +
 +Second, the ''[[https://wviechtb.github.io/metafor/reference/selmodel.html|selmodel()]]'' function has received a few updates. To start, the function no longer stops with an error when one or more intervals defined by the ''steps'' argument do not contain any observed p-values (instead a warning is issued and model fitting proceeds, but may fail). For automating analyses and simulation studies, one can now set ''ptable=TRUE'' in which case the function will simply return the table with the number of p-values falling into the various intervals, based on which one can decide how to proceed. 
 +
 +Furthermore, by setting argument ''decreasing=TRUE'', it is now possible to fit the step function model under the assumption that the selection function parameters are a monotonically decreasing function of the p-values. This feature is somewhat experimental -- it requires using optimization with inequality constraints or a clever reformulation of the objective function that enforces such a constraint, which complicates some internal issues and makes model fitting more difficult. One can also debate whether one should ever make this assumption in the first place, but it is a feature I wanted to implement for testing and research purposes anyway.
 +
 +Finally, per request, it is now also possible to pass the observed p-values of the studies to the function directly via the ''pval'' argument. This can in principle be of interest when the observed p-values were not computed with a standard Wald-type test (as assumed by the function) but based on a different method. This is an undocumented and experimental feature, because doing so creates a bit of a mismatch between the assumptions internal to the function (since the integration step to compute the weighted density of the effect size estimates still assumes the use of a standard Wald-type test). To what extent this is actually a problem and whether this feature can improve the accuracy of the results from selection models remains to be determined in future research.
 +
 +==== 2023-09-27: Version 4.4-0 Released on CRAN ====
 +
 +A new version of the metafor package has been released on CRAN. Some of the more important/interesting updates to the package include:
 +
 +  * The older (convoluted) way of setting some package options has been replaced by two functions, ''getmfopt()'' and ''setmfopt()'', for getting and setting package options. This new approach makes use of the standard way of setting options in R (see ''help(options)''). Also, some of the options that can be set in this way are now more flexible.
 +  * The ''fsn()'' function can now carry out a fail-safe N calculation based on a random-effects model (when using ''type="General"''). This is a generalization of the Orwin and Rosenberg methods, which is an interesting methodological development in itself.
 +  * The theming of all plots (based on the foreground and background colors of the plotting device) has been further improved. Within RStudio, plot colors can now also be automatically set based on the theme (with ''setmfopt(theme="auto")'').
 +  * The various ''forest()'' functions now have an additional argument called ''tabfig'', which makes it easier to exactly align the numbers in the annotations on the right-hand side.
 +  * The ''addpoly.default()'' and ''addpoly.rma.predict()'' functions gain a ''constarea'' argument, for the option to draw the polygons with a constant area. This idea arose from a [[https://scholar.social/@wviechtb/111131706271083360|discussion on Mastodon]] about drawing so-called 'diamond plots' (see https://psyarxiv.com/fzh6c for more details about such plots). The idea is that, by default, the eyes of the person looking at a plot are automatically drawn to the polygons that have a wider confidence interval (which occupy a larger area on the plot), which is actually the opposite of what you want to happen (since estimates with wider confidence intervals are less precise). By making the area of the polygons constant (which requires reducing their height according to the interval widths), this undesired effect can be compensated to some extent.
 +  * Two new measures have been added to ''escalc()'', namely ''"R2"'' and "''ZR2"'', for meta-analyzing coefficients of determination (but read the caveats mentioned under ''help(escalc)'' with respect to these measures).
 +  * For measures ''"PCOR"'', ''"ZPCOR"'', ''"SPCOR"'', and ''"ZSPCOR"'', argument ''mi'' in ''escalc()'' now refers to the total number of predictors in the regression models (i.e., also counting the focal predictor of interest). This is a non-backwards compatible change (which I really try to avoid), but in this case this was important for consistency with other measures/equations. The change is also very minor, since ''mi'' always appears in equations as a value that is subtracted from ''ni'' (the sample size) and since the latter is (hopefully) large relative to ''mi'', the impact of this change should be very minor.
 +  * The suite of automated package tests now also includes automated visual comparison tests of plots. Therefore, any changes I make to the package that unintentionally break a particular plotting function are now automatically detected.
 +
 +The full changelog can be found [[:updates#version_44-0_2023-09-27|here]].
  
 ==== 2023-08-13: Dynamic Plot Colors Based on the RStudio Theme ==== ==== 2023-08-13: Dynamic Plot Colors Based on the RStudio Theme ====
news/news.txt · Last modified: 2024/03/29 10:44 by Wolfgang Viechtbauer