R Metafor Tutorial PDF: A Practical Starting Guide

Published 2026-10-21 · 10 min read

If you searched for an r metafor tutorial pdf, a practical place to start is Viechtbauer’s 2010 paper, “Conducting Meta-Analyses in R with the metafor Package.” This guide shows you how to move from extracted study data to effect-size calculations, model fitting, and interpretation, while also helping you identify which parts of the tutorial need checking against current documentation. [1][4]

The aim is not just to run code. You will build a reproducible workflow, check that your inputs represent the intended effects, choose a model that reflects how the evidence was collected, and report the analysis decisions that matter. The metafor package supports many meta-analysis methods, but it does not decide whether studies belong together or replace review planning, risk-of-bias assessment, or human interpretation. [2]

What do you need before starting?

Before opening R, have a review question and protocol, an extraction table, and a clear definition of the effect measure and its direction. Confirm that the studies are sufficiently comparable for the planned synthesis; software availability does not establish methodological or clinical comparability. [2]

For a conventional univariate analysis, your data will usually include one effect estimate and its sampling variance per independent study effect. If a study contributes several outcomes, comparisons, or time points, record their shared study identifiers and consider whether the effects are correlated before choosing a model. [2][3]

Step 1: Which metafor tutorial PDF should you start with?

Start with Viechtbauer’s 2010 tutorial, “Conducting Meta-Analyses in R with the metafor Package.” It is a useful introductory PDF because it combines explanations with worked R code and demonstrates a broad analysis workflow. The paper is available through the resources listed on the metafor project help page and the journal article page. [1][4]

Use the paper as a learning guide, not as the final authority for every command. Its examples cover effect-size calculations, model fitting, meta-regression, plots, diagnostics, and publication-bias methods, but it is not a complete guide to current package functionality. When an example’s function arguments or defaults matter, check the current online help or CRAN reference manual. [1][6]

A useful approach is to follow one example from beginning to end before adapting it to your own review. Note the structure of the input data, the effect measure being calculated, the model specification, and how results are summarized. Then map each step to your own protocol and extraction decisions rather than copying the example’s assumptions automatically.

Common mistake: treating a tutorial PDF as current package documentation. The paper is valuable for learning the workflow; current function help and the reference manual are better places to verify present-day arguments and behavior. [1][6]

Step 2: How should you prepare and check the effect-size data?

Make the effect measure match the outcome and the review question. The escalc() function calculates effect estimates and sampling variances from summary data for measures that include mean differences, standardized mean differences, log risk ratios, and log odds ratios. [5]

For a continuous outcome, inspect the measure, group summaries, and direction of the contrast before calculating effects. If you are calculating a standardized mean difference from group summaries, provide standard deviations, not standard errors. Using standard errors in place of standard deviations changes the input quantities and can produce an invalid effect estimate. [5]

For a basic univariate workflow, the effect estimates are commonly stored as yi and the corresponding sampling variances as vi. The variance is not the standard error: it is the squared standard error. Keep the distinction explicit in your extraction and analysis code, and verify that the values supplied to the model are sampling variances. [3]

library(metafor)

dat_es <- escalc(
  measure = "SMD",
  m1i = treatment_mean, sd1i = treatment_sd, n1i = treatment_n,
  m2i = control_mean,   sd2i = control_sd,   n2i = control_n,
  data = dat
)

fit <- rma(yi, vi, data = dat_es)

This example assumes that the selected SMD definition and group ordering match the review’s intended contrast. Before interpreting the output, check that effect directions are consistent across studies, the scale is the one you intended, and the calculated variances are plausible for the extracted data. Those checks are part of analysis quality control, not optional cosmetic steps.

Common mistake: passing a standard error into vi, or passing a standard error where escalc() requires a group standard deviation. Check the function’s input definitions and your extraction table before fitting a model. [3][5]

Step 3: How do you fit and report a basic meta-analysis?

The rma() / rma.uni() workflow fits a meta-analysis using study effect estimates and their sampling variances. The package supports equal-effects, fixed-effects, random-effects, and mixed-effects models; the model should follow the review question and assumptions rather than be selected simply because it is available in software. [2][3]

For example, the code above fits a univariate model with yi and vi. In the documented rma.uni() function, the default estimator for between-study variance is REML. Do not let that default become an unreported decision: state the estimator you used and the confidence-interval or test method used for inference. [3][6]

A transparent report should identify the effect measure, model, estimator for between-study variance (τ²), and method used to calculate confidence intervals or conduct tests. It should also make clear how the data were prepared and which effects were included. These details let readers understand what was estimated and assess whether the analysis follows the protocol. [3][6]

Keep software output separate from methodological judgment. A model can return a pooled estimate even when the studies are not appropriate to combine. The protocol, eligibility decisions, study characteristics, and risk-of-bias assessment remain necessary inputs to deciding whether pooling is defensible. [2]

Common mistake: reporting a model label while omitting the inference choices that shape its results. State the estimator and interval or test method actually used, and do not present a software default as universally appropriate. [3][6]

Step 4: When do you need a multilevel model instead of rma.uni()?

A standard univariate model assumes that the observed effects entered into it are independent. That assumption can be inappropriate when one study contributes multiple correlated outcomes, comparisons, or time points. [2]

If a study contributes several effects, first identify why they are related and how they will be handled. A multilevel or multivariate approach, such as rma.mv(), can represent dependence in the data. By contrast, entering correlated effects as though they were independent can understate uncertainty. [2]

The choice is not merely a coding preference. It concerns the structure of the evidence and the estimand your review intends to summarize. Keep study identifiers and outcome or time-point labels in the dataset so that the dependence structure can be described and modeled where appropriate. Check the relevant current function documentation before implementing a model, because model specification depends on the structure of the data. [1][2]

Common mistake: treating every row in an extraction table as an independent study. Rows can represent multiple results from the same study; establish whether the effects are independent before using a univariate model. [2][3]

Step 5: How should you check heterogeneity and robustness?

Heterogeneity describes variation among study effects beyond the sampling variation represented by their variances. Consider it alongside the pooled estimate, uncertainty, study characteristics, and review question. Do not use a single I² threshold as a universal rule for deciding whether to pool or which model to choose; report the model and inference choices you actually made. [3][6]

Check whether the results are sensitive to defensible analysis decisions. Depending on the review, this may involve examining the effect direction and scale, the variance inputs, the model specification, or the influence of particular studies. The aim is to understand how conclusions respond to assumptions, not to search for a specification that produces a preferred result.

Use plots and diagnostics as aids to investigation, not as substitutes for judgment. A visible pattern can prompt questions about study differences or data quality, but it does not by itself explain why effects vary. Describe what was examined and how the findings informed interpretation.

Common mistake: treating a heterogeneity statistic or cutoff as a verdict. Interpret model results in context, show the choices that produced them, and explain whether plausible alternatives change the conclusions. [3][6]

Step 6: How should you interpret funnel-plot tests?

Funnel plots and tests for funnel asymmetry can help investigate patterns in the observed evidence, but asymmetry does not by itself establish publication bias. Other features of the evidence can also contribute to an asymmetric pattern, so interpret the result cautiously and in light of study methods and the review context. [7]

Cochrane gives at least 10 studies as a rule of thumb for considering funnel-asymmetry tests because these tests have low power with fewer studies. This is not a guarantee that a test will have adequate power, nor does meeting the rule establish that asymmetry is caused by missing evidence. [7]

Report the test as an assessment with limitations, not as a definitive diagnosis. Explain what evidence was examined, why the method was considered appropriate, and how the result affected interpretation. A non-significant result should not be presented as proof that missing evidence is absent, just as an asymmetric plot should not be presented as proof of publication bias. [7]

Common mistake: using a funnel-asymmetry test as a binary publication-bias detector. The test has limited power, and asymmetry alone does not identify its cause. [7]

Step 7: Where can you find current documentation and practice materials?

Use the 2010 paper to learn the overall workflow, then consult current resources as you practice. The metafor help page links to package information and documentation; the online function help is useful for checking specific functions, while the CRAN reference manual provides a broader reference. [1][3][5][6]

For structured practice, reproduce the paper’s examples and then work through the author’s 2022 workshop slides and scripts. This sequence gives you a worked introduction, guided exercises, and a route to checking current function details. Keep a record of software versions and analysis choices so that you can distinguish what the tutorial demonstrates from what your own review requires. [1][6][8]

A reproducible learning sequence is: reproduce an example; verify the inputs and effect direction; check current function arguments; adapt the analysis to your protocol; and document the model and inference choices. The package can support calculations, models, plots, diagnostics, dependent-effect analyses, and network meta-analysis, but human review decisions still govern eligibility, risk of bias, comparability, and interpretation. [2]

Common mistake: searching only for a downloadable PDF and stopping there. Pair introductory examples with current documentation and practice materials, then make and document review-specific decisions under human oversight. [1][6][8]

Key takeaways

  • Viechtbauer’s 2010 paper is a useful introductory metafor PDF, but it is not a complete guide to current package functionality. [1][4]
  • In the univariate workflow, yi represents effect estimates and vi represents sampling variances, not standard errors. [3]
  • Use group standard deviations, rather than standard errors, when calculating standardized mean differences from group summaries. [5]
  • Correlated effects from one study may require a multilevel or multivariate model rather than a univariate independence assumption. [2]
  • Funnel asymmetry does not establish publication bias, and tests have limited power, particularly with few studies. [7]
  • Report the estimator for τ² and the confidence-interval or test method actually used. [3][6]

FAQ

How do you use the R metafor package for meta-analysis?

Prepare effect estimates and sampling variances that match the review’s planned measure, then fit a model suited to the independence structure and analysis question. Check effect direction, data inputs, and current function documentation, and report the model and inference choices used. [3][5][6]

Where can I find a tutorial for the R metafor package?

Viechtbauer’s 2010 “Conducting Meta-Analyses in R with the metafor Package” is a useful introductory PDF with worked examples. For current functions and arguments, use the package help page, online function documentation, or CRAN reference manual. [1][4][6]

What are the best resources for learning R metafor?

A practical sequence is to reproduce the 2010 paper’s examples, use the author’s workshop slides and scripts for structured practice, and check current online help or the CRAN manual when adapting code. Each resource has a different role: introduction, practice, and current reference. [1][6][8]

Is there a step-by-step tutorial for R metafor?

The 2010 paper provides a worked introduction to common meta-analysis tasks, including effect-size calculation, model fitting, meta-regression, plots, diagnostics, and publication-bias methods. Treat it as a learning path rather than a substitute for current documentation or review-specific methodological decisions. [1][4]

What examples are available for using R metafor in meta-analysis?

The introductory paper includes worked code, and the author’s 2022 workshop provides slides and scripts for structured practice. The package documentation also describes functions for effect-size calculations and meta-analytic models; choose examples that match your data structure and verify their assumptions before adapting them. [1][2][8]

Sources

  1. Documentation and Help [The metafor Package]
  2. metafor: A Meta-Analysis Package for R — metafor-package • metafor:
  3. Meta-Analysis via Linear (Mixed-Effects) Models — rma.uni • metafor:
  4. www.jstatsoft.org:
  5. Calculate Effect Sizes and Outcome Measures — escalc • metafor
  6. metafor: Meta-Analysis Package for R
  7. Chapter 13: Assessing risk of bias due to missing evidence in a meta-analysis | Cochrane
  8. GitHub - wviechtb/workshop_2022_ma_esmarconf: Meta-Analysis with R Workshop · GitHub

Related articles