Meta-analysis of Continuous Data

Authors

[Editor] Hu Zheng;

[Contributors]

Modified

2026-01-17

Note

Hiplot website

This page is the tutorial for source code version of the Hiplot Meta-analysis of Continuous Data plugin. You can also use the Hiplot website to achieve no code ploting. For more information please see the following link:

https://hiplot.cn/basic/meta-cont?lang=en

Setup

  • System Requirements: Cross-platform (Linux/MacOS/Windows)

  • Programming language: R

  • Dependent packages: data.table; jsonlite; meta; ggplotify

# Install packages
if (!requireNamespace("data.table", quietly = TRUE)) {
  install.packages("data.table")
}
if (!requireNamespace("jsonlite", quietly = TRUE)) {
  install.packages("jsonlite")
}
if (!requireNamespace("meta", quietly = TRUE)) {
  install.packages("meta")
}
if (!requireNamespace("ggplotify", quietly = TRUE)) {
  install.packages("ggplotify")
}

# Load packages
library(data.table)
library(jsonlite)
library(meta)
library(ggplotify)
sessioninfo::session_info("attached")
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.5.2 (2025-10-31)
 os       Ubuntu 24.04.3 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  C.UTF-8
 ctype    C.UTF-8
 tz       UTC
 date     2026-01-17
 pandoc   3.1.3 @ /usr/bin/ (via rmarkdown)
 quarto   1.8.27 @ /usr/local/bin/quarto

─ Packages ───────────────────────────────────────────────────────────────────
 package    * version date (UTC) lib source
 data.table * 1.18.0  2025-12-24 [1] RSPM
 ggplotify  * 0.1.3   2025-09-20 [1] RSPM
 jsonlite   * 2.0.0   2025-03-27 [1] RSPM
 meta       * 8.2-1   2025-09-01 [1] RSPM
 metadat    * 1.4-0   2025-02-04 [1] RSPM

 [1] /home/runner/work/_temp/Library
 [2] /opt/R/4.5.2/lib/R/site-library
 [3] /opt/R/4.5.2/lib/R/library
 * ── Packages attached to the search path.

──────────────────────────────────────────────────────────────────────────────

Data Preparation

# Load data
data <- data.table::fread(jsonlite::read_json("https://hiplot.cn/ui/basic/meta-cont/data.json")$exampleData$textarea[[1]])
data <- as.data.frame(data)

# Convert data structure
m1 <- metacont(n.e, mean.e, sd.e, n.c, mean.c, sd.c, studlab = Study, data = data,
              sm = "SMD")

# View data
head(data)
  Study n.e mean.e sd.e n.c mean.c  sd.c
1     A  13    5.0 4.70  13   6.50  3.80
2     B  30    4.9 1.71  50   6.10  2.30
3     C  35   22.5 3.44  35  24.90 10.65
4     D  20   12.5 1.47  20  12.30  1.66
5     E   8    6.5 0.76   8   7.38  1.41

Visualization

# Meta-analysis of Continuous Data
p <- as.ggplot(function(){
  meta::forest(m1, layout = "meta")
  })

p
FigureΒ 1: Meta-analysis of Continuous Data