On this page, you can find a description of the (recent) updates to the metafor package. Older updates are archived here.
forest() functions: argument header is now TRUE by default, the y-axis is now created with yaxs="i", and the y-axis limits have been tweaked slightly in accordanceforest.rma() and the various addpoly() functions now provides multiple styles for drawing the prediction interval via the predstyle argumentforest.rma() and addpoly.rma() now write out the default label (instead of an abbreviation) for the model results; as before, the label can be changed via the mlab argumentilab.lab argument to the various forest() functions for adding header labels to the plot for the additional study information columnspar(mfrow) automatically when no plotting device is open or when the number of panels in an open plotting device is too small for the number of panels to be plotted; all multi-panel plots also set par(mfrow)=c(1L,1L) upon exit; argument layout has been deprecated from plot.permutest.rma.uni(), plot.vif.rma(), and plot.infl.rma.uni()predict.rma() and predict.rma.ls() functions now also accept a matrix as input that includes a column for the intercept term (in which case the intercept argument is ignored and the first column of the matrix controls whether the intercept term is included in calculating the predicted value(s))se() for extracting standard errors from model objectspairmat() to construct a matrix of pairwise contrastsdeltamethod() to apply the (multivariate) delta method to a set of estimatesanova() and predict() gain an adjust argument for adjusting p-values / interval bounds for multiple testingpredict() ignoring the level argument for robust.rma objects obtained with clubSandwich=TRUEprint.anova.rma() and print.list.anova.rma() now also print significance stars for some tests (unless getOption("show.signif.stars") is FALSE)collapse argument to the various cumul() functions (to specify whether studies with the same value of the order variable should be added simultaneously)leave1out() functions gain a cluster argumentrma.mv() now counts the number of levels of a random effect more appropriately; this may trigger more often the check that the number of levels is equal to 1, in which case the corresponding variance component is automatically fixed to 0; this check can be omitted with control=list(check.k.gtr.1=FALSE)Rcgmin and Rvmmin available again via the optimx packageshade in funnel() now automatically uses a color gradient for the regions when multiple level values are specifiedlim, ci, pi, legend, and flip arguments to labbe()fsn(..., type="General") now computes the final estimates after rounding the fail-safe N value (not before)permutest.rma.uni() gains a btt argument and permutest.rma.ls() gains btt and att argumentsselmodel() gains a subset argument (to specify a subset of studies to which the selection function should apply); for the beta selection model, one can now also specify two steps values to fit a truncated beta selection modelnobs() now just returns the number of estimates, not the effective number of observationsvcalc() to speed up the calculations (by James Pustejovsky)"PRZ", "CLES", "AUC", "CLESN", "AUCN", "CLESCN", "AUCCN", "R2F", and "ZR2F" to escalc()escalc() gains a flip argumentescalc() gains a correct argument (to specify whether a bias correction should be applied)transf.dtoovl() (for transforming standardized mean differences to overlapping coefficient values) and transf.dtocliffd() (for transforming standardized mean differences to Cliff's delta values)qqnorm.rma.uni() now shades the pseudo confidence region; all qqnorm() functions gain a grid argumentoutlist="minimal"steps argument in the various profile() functions can now also be a numeric vector to specify for which parameter values the likelihood should be evaluatedescalc(): "SMN" for the single-group standardized mean / single-group standardized mean difference, "SMCRP" for the standardized mean change using raw score standardization with pooled standard deviations, and "SMCRPH" for the standardized mean change using raw score standardization with pooled standard deviations and heteroscedastic population variances at the two measurement occasions"SMDH", "SMD1H", and "SMCRH" was slightly adjusted for consistencyplot.gosh.rma(), can also set het="tau" (to plot the square root of tau^2 as the measure of heterogeneity)forest() functions, argument ylim can now only be a single value to specify the lower bound (while the upper bound is still set automatically)forest() and regplot(), observation limits set via olim are now properly applied to all elementsselmodel()selmodel() 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)decreasing argument to selmodel() for enforcing that the delta estimates must be a monotonically decreasing function of the p-values in the step function modelpval to selmodel() for passing p-values directly to the function (doing this is highly experimental)getmfopt() and setmfopt() functions for getting and setting package options and made some of the options more flexibleweighted from fsn() (whether weighted or unweighted averages are used in Orwin's method is now simply determined by whether sampling variances are specified or not); added type="General" to fsn() as a generalization of the Orwin and Rosenberg methods (that allows for a fail-safe N calculation based on a random-effects model); can now pass an rma object to the fsn() functionsetmfopt(theme="auto"))tabfig to the various forest() functions, for easily setting the annosym argument to an appropriate vector for exactly aligning numbers (when using a matching font)vccon argument to rma.mv() for setting equality constraints on variance/correlation componentsreplace argument in conv.2x2(), conv.delta(), conv.fivenum(), and conv.wald() can now also be a logicalsummary.matreg() and print.summary.matreg() methods for including additional statistics in the output ($R^2$ and the omnibus test) and added coef.matreg() and vcov.matreg() extractor functionsfmtp(), fmtx(), and fmtt() gain a quote argument, which is set to FALSE by default"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)"R2" and "ZR2" to escalc()addpoly.default() and addpoly.rma.predict() gain a constarea argument (for the option to draw the polygons with a constant area)plot.rma.uni.selmodel() gains a shade argument (for shading the confidence interval region)plot.permutest.rma.uni() gains a legend argumentvcalc() gains a sparse argumentaggregate.escalc gains var.names argumentlegend argument more flexible in funnel()append argument more flexible in to.long()par("fg"); as a result, one can now create plots with a dark background and light plotting colorsxlab in the various forest() functions (for adding labels at the ends of the x-axis limits)xlim in the various forest() functions; also, argument ilab.xpos is now optional when using the ilab argumentshade and colshade arguments to the various forest() functionsforest() functions no longer enforce that xlim must be at least as wide as alimlink argument to rma.glmm()rma.glmm() with measure="OR", model="CM.EL", method="ML" now treats tau^2 values below 1e-04 effectively as zero before computing the standard errors of the fixed effects; this helps to avoid numerical problems in approximating the Hessian; similarly, selmodel() now treats tau^2 values below 1e-04 or min(vi/10) effectively as zero before computing the standard errorsSMCC, can now specify d-values, t-test statistics, and p-values via arguments di, ti, and pilevel argumentconv.2x2() function for reconstructing the cell frequencies in 2x2 tables based on other summary statisticsconv.wald() function for converting Wald-type confidence intervals and test statistics to sampling variancesconv.fivenum() function for estimating means and standard deviations from five-number summary valuesconv.delta() function for transforming observed effect sizes or outcomes and their sampling variances using the delta methodemmprep() function to create a reference grid for use with the emmeans() function from the package of the same namefmtp(), fmtx(), and fmtt()numDeriv moved from Suggests to Dependsmodel.matrix.rma() gains asdf argumentvcalc() (values for obs and type were taken directly as indices instead of using them as identifiers)vif() when sim=TRUE by reshuffling only the data needed in the model matrix; due to some edge cases, the simulation approach cannot be used when some redundant predictors were dropped from the original model; and when redundancies occur after reshuffling the data, the simulated (G)VIF value(s) are now set to Inf instead of NAselmodel() gains type='trunc' and type='truncest' models (the latter should be considered experimental)exact="i" option in permutest() (to just return the number of iterations required for an exact permutation test)escalc() now provides more informative error messages when not specifying all required arguments to compute a particular measure"ZPHI", "ZTET", "ZPB", "ZBIS", and "ZSPCOR" to escalc() (but note that Fisher's r-to-z transformation is not a variance-stabilizing transformation for these measures)ZPCOR is now calculated with 1/(ni-mi-3) (instead of 1/(ni-mi-1)), which provides a better approximation in small samples (and analogous to how the variance of ZCOR is calculated with 1/(ni-3))measure="SMD", one can now also use arguments di and ti to specify d-values and t-test statistics for measures RPB, RBIS, D2ORN, and D2ORL in escalc()COR, UCOR, and ZCOR, can now use argument ti to specify t-test statistics in escalc()PCOR, ZPCOR, SPCOR, and ZSPCOR) via argument pi (the sign of the p-value is taken to be the sign of the measure)ri for measures PCOR, ZPCOR, SPCOR, and ZSPCORrcalc(), it now orders the elements (columnwise) based on the lower triangular part of the matrix, not the upper one (which is more consistent with what matreg() expects as input when using the V argument)Rcgmin and Rvmmin are now available in rma.uni(), rma.mv(), rma.glmm(), and selmodel()funnel.default(), funnel.rma(), and regplot.rma() gain slab argumentvif() was completely refactored and gains reestimate, sim, and parallel arguments; added as.data.frame.vif.rma() and plot.vif.rma() methodsplot.permutest.rma.uni() function sets the y-axis limits automatically and in a smarter way when also drawing the reference/null distribution and the density estimatebtt in anova.rma(); added print.list.anova.rma() to print the resulting objectas.data.frame.anova.rma() and as.data.frame.list.anova.rma() methodslink="identity") in rma.uni() when fitting location-scale models (although this will often lead to estimation problems); added solnp() as an additional optimizer for this casenloptr and constrOptim.nl (the latter from the alabama package) are now available in rma.uni() for location-scale models when using an identity linkSMD1H to escalc()measure="SMD", escalc() now also allows the user to specify d-values and t-test statistics via arguments di and ti, respectivelyaggregate.escalc() gains addk argument"RR", "RD", "PLN", and "PR" to rma.glmm() (but using these measures will often lead to estimation problems)replmiss() gains data argumentcumul() functions also store data, so that arguments ilab, col, pch, and psize in the forest.cumul.rma() function can look for variables thereinmetafor output due to the use of a zero-width spacemisc-models, misc-recs, and misc-options help pagesas.data.frame.confint.rma() and as.data.frame.list.confint.rma methodspermutest() can now also do permutation tests for location-scale models; it also always returns the permutation distributions; hence, argument retpermdist was removedplot.permutest.rma.uni() function to plot the permutation distributionsregtest(), ranktest(), and tes() to single functions instead of using generics and methods; this way, a data argument could be addedvcalc() and blsplit() functionsrobust() gains clubSandwich argument; if set to TRUE, the methods from the clubSandwich package (https://cran.r-project.org/package=clubSandwich) are used to obtain the cluster-robust results; anova.rma() and predict.rma() updated to work appropriately in this caserobust() are no longer printed with print.robust.rma() but with the print methods print.rma.uni() and print.rma.mv()anova.rma() now gives a warning when running LRTs not based on ML/REML estimation and gains rhs argument; it also now has a refit argument (to refit REML fits with ML in case the fixed effects of the models differ)dfs="contain" in rma.mv() automatically sets test="t" for conveniencerho and phi in rma.mv() are now based on the lower triangular part of the respective correlation matrix (instead of the upper triangular part) for consistency with other functions; note that this is in principle a backwards incompatible change, although this should only be a concern in very special circumstancesrma.mv() gains cvvc argument (for calculating the var-cov matrix of the variance/correlation/covariance components)"MPORM" to escalc() for computing marginal log odds ratios based on marginal 2x2 tables directly (which requires specification of the correlation coefficients in the paired tables for the calculation of the sampling variances via the ri argument)"REH" to escalc() for computing the (log transformed) relative excess heterozygosity (to assess deviations from the Hardy-Weinberg equilibrium)aggregate.escalc() gains checkpd argument and struct="CS+CAR"rma.glmm() now has entire array of optimizers available for model="CM.EL" and measure="OR"; switched the default from optim() with method BFGS to nlminb() for consistency with rma.mv(), rma.uni(), and selmodel.rma.uni()rma.glmm() gains coding and cor arguments and hence more flexibility how the group variable should be coded in the random effects structure and whether the random study effects should be allowed to be correlated with the random group effectsrma.uni() now also provides R^2 for fixed-effects modelsmatreg() can now also analyze a covariance matrix with a corresponding V matrix; can also specify variable names (instead of indices) for arguments x and ynearPD to nearpd in matreg() (but nearPD continues to work)plot.profile.rma() gains refline argumentaddpoly.rma.predict() methodaddpoly.default() and addpoly.rma() gain lty and annosym arguments; if unspecified, arguments annotate, digits, width, transf, atransf, targs, efac, fonts, cex, and annosym are now automatically set equal to the same values that were used when creating the forest plottextpos and rowadj arguments for the various forest functions and moved the top and annosym arguments to 'additional arguments'level argument in addpoly.rma() did not affect the CI widthpoints.regplot() function now also redraws the labels (if there were any to begin with)lbfgsb3c, subplex, and BBoptim as possible optimizer in rma.mv(), rma.glmm(), rma.uni(), and selmodel.rma.uni()data argument; various method functions now automatically look for specified variables within this data frame firstOlder updates are archived here.