Small-study effects and publication bias
Read a funnel plot, run Egger and Begg, and see how far trim-and-fill and PET-PEESE move an estimate, without treating any of them as a verdict on publication bias.
What runs in CodeSplash
- STAT281Egger regression asymmetry test Runs in CodeSplash
- STAT282Begg–Mazumdar rank asymmetry test Runs in CodeSplash
- Small-study effects and publication bias Verified in Python and R
You will be able to
- Read asymmetry in a funnel plot and list reasons for it besides publication bias
- Run and interpret Egger's and Begg's tests
- Use trim-and-fill and PET-PEESE as sensitivity analyses, not corrections
Read first
Do small studies say something different?
ReadIf only "positive" results get published, small studies need large effects to reach publication. A plot of effect against precision then looks lopsided: a funnel plotFunnel plotEach study's effect against its standard error; without small-study effects the points scatter symmetrically in an inverted funnel. with a bite missing.
Hide some studies
ExploreSlide the selection and see what disappears.
BExplorable · The funnel and publication bias
What does a literature look like when non-significant studies go missing?
What effect does the published literature estimate?
Dashed: the 95% funnel around the truth. Colored: published. Faded: hidden. The bold line is the estimate you would read in the literature.
Commit your prediction above to see the result
Make your prediction to see the result.
Notice that the pooled estimate moves away from the truth even though every published study is honest.
Passive smoking and lung cancer
PredictPredict first
Hackshaw's 37 studies of passive smoking have a lopsided funnel. Trim-and-fill estimates how many studies would need to be "missing" for it to balance.
How many does it impute?
Reveal
7 studies, on the left (smaller effects) side. The log ratio moves from 0.219 to 0.174. Those imputed studies are a modeling device, not evidence that real studies exist.
Read the card
ReadEgger's test p = .023; Begg's τ = 0.14, p = .216; trim-and-fill k₀ = 7
- p (Egger)
- .023
- p (Begg)
- .216
- Studies imputed
- 7
Plots
View data
| log ratio | study | study | standard error |
|---|---|---|---|
| 0.1655 | observed | Garfinkel 1981 | 0.1370 |
| 0.3716 | observed | Hirayama 1984 | 0.1818 |
| 0.7031 | observed | Butler 1988 | 0.7350 |
| 0.1823 | observed | Cardenas 1997 | 0.1768 |
| −0.2877 | observed | Chan 1982 | 0.2822 |
| 0.7275 | observed | Correa 1983 | 0.4768 |
| 0.7561 | observed | Trichopolous 1983 | 0.2982 |
| −0.2231 | observed | Buffler 1984 | 0.4390 |
| −0.2357 | observed | Kabat 1984 | 0.5823 |
| 0.6981 | observed | Lam 1985 | 0.3132 |
| 0.2070 | observed | Garfinkel 1985 | 0.2134 |
| 0.1823 | observed | Wu 1985 | 0.4814 |
| 0.4187 | observed | Akiba 1986 | 0.2822 |
| 0.0296 | observed | Lee 1986 | 0.4663 |
| 0.4383 | observed | Koo 1987 | 0.2774 |
| 0.0296 | observed | Pershagen 1987 | 0.2674 |
| 0.8502 | observed | Humble 1987 | 0.5409 |
| 0.5008 | observed | Lam 1987 | 0.1801 |
| 0.1740 | observed | Gao 1987 | 0.1905 |
| 0.4187 | observed | Brownson 1987 | 0.6956 |
| 0.7701 | observed | Geng 1988 | 0.3519 |
| 0.0770 | observed | Shimizu 1988 | 0.2666 |
| 0.9361 | observed | Inoue 1988 | 0.6310 |
| 0.4824 | observed | Kalandidi 1990 | 0.2994 |
| 0.0583 | observed | Sobue 1990 | 0.1836 |
| −0.2357 | observed | Wu-Williams 1990 | 0.1270 |
| −0.3011 | observed | Liu 1991 | 0.4245 |
| 0.8198 | observed | Jockel 1991 | 0.5632 |
| −0.0305 | observed | Brownson 1992 | 0.1120 |
| 0.4700 | observed | Stockwell 1992 | 0.3372 |
| 0.1740 | observed | Du 1993 | 0.2989 |
| 0.5068 | observed | Liu 1993 | 0.4195 |
| 0.2311 | observed | Fontham 1994 | 0.1001 |
| 0.0953 | observed | Kabat 1995 | 0.2936 |
| 0.5068 | observed | Zaridze 1995 | 0.1997 |
| 0.1484 | observed | Sun 1996 | 0.1908 |
| 0.1044 | observed | Wang 1996 | 0.2577 |
| −0.3601 | imputed | imputed 1 | 0.7350 |
| −0.3845 | imputed | imputed 2 | 0.4768 |
| −0.4131 | imputed | imputed 3 | 0.2982 |
| −0.4271 | imputed | imputed 4 | 0.3519 |
| −0.4768 | imputed | imputed 5 | 0.5632 |
| −0.5072 | imputed | imputed 6 | 0.5409 |
| −0.5931 | imputed | imputed 7 | 0.6310 |
Assumptions
- Enough studies — 37 studies.
- Low heterogeneity — I² = 29.6%.
Small-study diagnostics (ratio)
| Test | Statistic | p | |
|---|---|---|---|
| Egger (classic) | 2.382 | 0.0228 | limit effect 1.01 [0.844, 1.2] |
| Begg–Mazumdar | 0.1441 | 0.2157 | exact Kendall null |
| Trim-and-fill (R0) | 7 | — | 7 imputed on the left (smaller effects); adjusted 1.19 [1.08, 1.31] |
| PET-PEESE | 0.0050 | 0.9536 | PET estimate 1.01 [0.844, 1.2] |
| Fail-safe N (Rosenthal) | 392.71 | — | robust if above 5k + 10 = 195 |
- Asymmetry can come from publication bias, heterogeneity, chance or differences in study quality; these tests cannot tell which.
The exact R script · R R version 4.5.1 (2025-06-13)
# Small-study effects and publication bias
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method meta.bias 1.0.1 · spec 8d1d4739f433156a
# Dataset: m1_hackshaw (version 1)
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
library(codesplashr) # cs_meta_* (twins of codesplash.stats.meta)
# %% Data
df <- as.data.frame(nanoparquet::read_parquet("tests/parity/fixtures/m1_hackshaw.parquet", col_select = c("study", "or", "or_low", "or_high")))
n_input <- nrow(df)
df[["study"]] <- factor(df[["study"]], levels = c("Garfinkel 1981", "Hirayama 1984", "Butler 1988", "Cardenas 1997", "Chan 1982", "Correa 1983", "Trichopolous 1983", "Buffler 1984", "Kabat 1984", "Lam 1985", "Garfinkel 1985", "Wu 1985", "Akiba 1986", "Lee 1986", "Koo 1987", "Pershagen 1987", "Humble 1987", "Lam 1987", "Gao 1987", "Brownson 1987", "Geng 1988", "Shimizu 1988", "Inoue 1988", "Kalandidi 1990", "Sobue 1990", "Wu-Williams 1990", "Liu 1991", "Jockel 1991", "Brownson 1992", "Stockwell 1992", "Du 1993", "Liu 1993", "Fontham 1994", "Kabat 1995", "Zaridze 1995", "Sun 1996", "Wang 1996")) # stored level order
df <- df[stats::complete.cases(df[c("study", "or", "or_low", "or_high")]), , drop = FALSE] # listwise deletion
df[] <- lapply(df, function(x) if (is.factor(x)) droplevels(x) else x)
n_dropped <- n_input - nrow(df)
warnings <- list()
if (n_dropped > 0) {
warnings <- c(warnings, cs_warning("CS_W_ROWS_DROPPED", dropped = n_dropped, total = n_input))
}
if (n_input > 0 && nrow(df) == 0) cs_error("CS_E_NO_ROWS")
cs_check_finite_columns(df, c("study", "or", "or_low", "or_high")) # infinite values stop the run (registry/errors.yaml)
# %% Studies
design <- "ratio_ci" # inferred from the bound columns
measure <- "GEN"
cols <- list(
effect = as.numeric(df[["or"]]),
ci_low = as.numeric(df[["or_low"]]),
ci_high = as.numeric(df[["or_high"]]),
NULL
)
cols <- Filter(Negate(is.null), cols)
es <- cs_meta_escalc(design, measure, cols, zero_cells = "only0", drop00 = TRUE, ci_level = 0.95)
measure <- es$measure
labels_all <- as.character(df[["study"]])
keep <- es$keep
left_out <- labels_all[!keep]
idx <- which(keep)
y <- es$yi[idx]; v <- es$vi[idx]
labels <- labels_all[idx]
k <- length(y)
if (k < 2) cs_error("CS_E_TOO_FEW_ROWS", what = "A meta-analysis", min = 2, n = k) # one usable study can't be pooled
if (length(left_out)) {
warnings <- c(warnings, paste0(sprintf("Left out (%d): ", length(left_out)), paste(left_out, collapse = ", "),
if (design == "binary") " — no events (or only events) in both arms." else " — effect or variance not computable."))
}
bt <- cs_meta_back(measure)
MEASURE_LABEL <- c(GEN = "effect", LOG = "log ratio", OR = "log odds ratio", RR = "log risk ratio", RD = "risk difference",
MD = "mean difference", SMD = "Hedges' g", ZCOR = "Fisher's z", COR = "correlation")[[measure]]
RATIO <- measure %in% c("OR", "RR", "LOG")
# What a back-transformed number is: a ratio, not a log ratio; a correlation, not Fisher's z.
DISPLAY_LABEL <- if (measure %in% c("OR", "RR", "LOG", "ZCOR")) c(OR = "odds ratio", RR = "risk ratio", LOG = "ratio", ZCOR = "correlation")[[measure]] else MEASURE_LABEL
if (k < 3) cs_error("CS_E_TOO_FEW_ROWS", what = "Testing for small-study effects", min = 3, n = k) # Egger's regression and PET-PEESE fit two coefficients
if (all(y == y[1])) {
# Identical effects: Begg's rank correlation and the Egger / PET-PEESE regressions are undefined (an exact fit).
cs_error("CS_E_CONSTANT", column = "or")
}
# %% Small-study tests
conf <- 0.95
tau2_method <- "REML"
re <- cs_meta_rma(y, v, method = tau2_method, level = conf)
est <- re$beta[1]
eg <- cs_meta_egger(y, v, variant = "classic", method = tau2_method, level = conf)
bg <- cs_meta_begg(y, v)
tf <- cs_meta_trimfill(y, v, method = tau2_method, side = "auto", estimator = "R0")
pp <- cs_meta_pet_peese(y, v, alpha = 0.05, level = conf)
fs <- cs_meta_failsafe(y, v)
tff <- tf$filled
# %% Assumptions
assumptions <- list(
list(key = "k_studies", label = "Enough studies", status = if (k < 10) "warn" else "pass",
detail = paste0(sprintf("%d studies", k), if (k < 10) "; asymmetry tests have little power — a non-significant result says little." else ".")),
list(key = "heterogeneity", label = "Low heterogeneity", status = if (re$i2 > 50) "warn" else "pass",
detail = paste0(sprintf("I² = %.1f%%", re$i2), if (re$i2 > 50) "; heterogeneity alone can produce asymmetry and makes trim-and-fill unreliable." else "."))
)
# %% Result
disp <- if (RATIO) sub("log ", "", MEASURE_LABEL) else MEASURE_LABEL
side_word <- if (tf$side == "left") "left (smaller effects)" else "right (larger effects)"
g3 <- function(x) format(signif(x, 3))
rows <- list(
list(test = paste0("Egger", if (eg$variant == "classic") " (classic)" else " (meta-regression on SE)"), statistic = eg$stat, p = eg$p,
detail = sprintf("limit effect %s [%s, %s]", g3(bt(eg$limit)), g3(bt(eg$limit_ci_low)), g3(bt(eg$limit_ci_high)))),
list(test = "Begg–Mazumdar", statistic = bg$tau, p = bg$p, detail = if (bg$exact) "exact Kendall null" else "normal approximation"),
list(test = sprintf("Trim-and-fill (%s)", tf$estimator), statistic = tf$k0, p = NULL,
detail = sprintf("%d imputed on the %s; adjusted %s [%s, %s]", tf$k0, side_word, g3(bt(tff$beta[1])), g3(bt(tff$ci_low[1])), g3(bt(tff$ci_high[1])))),
list(test = "PET-PEESE", statistic = pp$est, p = pp$pet_p, detail = sprintf("%s estimate %s [%s, %s]", toupper(pp$use), g3(bt(pp$est)), g3(bt(pp$ci_low)), g3(bt(pp$ci_high)))),
list(test = "Fail-safe N (Rosenthal)", statistic = fs$fsn, p = NULL, detail = sprintf("robust if above 5k + 10 = %.0f", fs$threshold))
)
all_y <- c(y, tf$fill_y)
all_se <- sqrt(c(v, tf$fill_v))
cs_publish(list(
method = "meta.bias",
methodVersion = "1.0.1",
title = sprintf("Small-study effects in %d studies", k),
engine = cs_engine_info("stats", "nanoparquet"),
n = k,
summary = sprintf("Egger %s; Begg τ = %.3f, %s; trim-and-fill adds %d (pooled %s → %s).", cs_fmt_p(eg$p), bg$tau, cs_fmt_p(bg$p), tf$k0, g3(bt(est)), g3(bt(tff$beta[1]))),
apa = sprintf("Egger's test %s; Begg's τ = %s, %s; trim-and-fill k₀ = %d", cs_fmt_p(eg$p), cs_fmt_num(bg$tau), cs_fmt_p(bg$p), tf$k0),
statistics = list(list(key = "egger_p", label = "p (Egger)", value = eg$p, format = "p"), list(key = "begg_p", label = "p (Begg)", value = bg$p, format = "p"),
list(key = "tf_k0", label = "Studies imputed", value = tf$k0, format = "integer")),
tables = list(list(key = "tests", title = sprintf("Small-study diagnostics (%s)", disp),
columns = list(list(key = "test", label = "Test", type = "string"), list(key = "statistic", label = "Statistic", type = "number"),
list(key = "p", label = "p", type = "number"), list(key = "detail", label = "", type = "string")),
rows = rows)),
assumptions = assumptions,
warnings = warnings,
notes = list("Asymmetry can come from publication bias, heterogeneity, chance or differences in study quality; these tests cannot tell which."),
charts = list(cs_chart("funnel", "meta-funnel", "Funnel plot with imputed studies",
list(estimate = cs_col(MEASURE_LABEL, all_y), se = cs_col("standard error", all_se),
label = cs_col("study", c(labels, if (tf$k0 > 0) sprintf("imputed %d", seq_len(tf$k0)) else character(0))),
kind = cs_col("study", c(rep("observed", k), rep("imputed", tf$k0)))),
controls = list(center = est, adjusted = tff$beta[1], contours = TRUE, eggerIntercept = eg$limit, eggerSlope = eg$bias))),
values = list(
k = k, est = est, egger_stat = eg$stat, egger_p = eg$p, egger_bias = eg$bias, limit = eg$limit, limit_ci_low = eg$limit_ci_low,
limit_ci_high = eg$limit_ci_high, begg_tau = bg$tau, begg_p = bg$p, tf_k0 = tf$k0, tf_est = tff$beta[1], tf_ci_low = tff$ci_low[1],
tf_ci_high = tff$ci_high[1], pet = pp$pet, pet_p = pp$pet_p, peese = pp$peese, peese_p = pp$peese_p, pet_peese_est = pp$est, fsn = fs$fsn,
measure = measure, measure_label = MEASURE_LABEL, tf_side = side_word, pet_peese_use = pp$use
)
))
Egger's test p = .023; Begg's τ = 0.14, p = .216; trim-and-fill k₀ = 7
- p (Egger)
- .023
- p (Begg)
- .216
- Studies imputed
- 7
To keep this page light, the plots are shown once, under the R tab.
Assumptions
- Enough studies — 37 studies.
- Low heterogeneity — I² = 29.6%.
Small-study diagnostics (ratio)
| Test | Statistic | p | |
|---|---|---|---|
| Egger (classic) | 2.382 | 0.0228 | limit effect 1.01 [0.844, 1.2] |
| Begg–Mazumdar | 0.1441 | 0.2157 | exact Kendall null |
| Trim-and-fill (R0) | 7 | — | 7 imputed on the left (smaller effects); adjusted 1.19 [1.08, 1.31] |
| PET-PEESE | 0.0050 | 0.9536 | PET estimate 1.01 [0.844, 1.2] |
| Fail-safe N (Rosenthal) | 392.71 | — | robust if above 5k + 10 = 195 |
- Asymmetry can come from publication bias, heterogeneity, chance or differences in study quality; these tests cannot tell which.
The exact Python script · Python Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0
# Small-study effects and publication bias
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method meta.bias 1.0.1 · spec 8d1d4739f433156a
# Dataset: m1_hackshaw (version 1)
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
import numpy as np
import pandas as pd
import codesplash as cs
from codesplash.stats import meta # twins of codesplashr::cs_meta_*
# %% Data
df = pd.read_parquet("tests/parity/fixtures/m1_hackshaw.parquet", columns=["study", "or", "or_low", "or_high"])
n_input = len(df)
df["study"] = pd.Categorical(df["study"], categories=["Garfinkel 1981", "Hirayama 1984", "Butler 1988", "Cardenas 1997", "Chan 1982", "Correa 1983", "Trichopolous 1983", "Buffler 1984", "Kabat 1984", "Lam 1985", "Garfinkel 1985", "Wu 1985", "Akiba 1986", "Lee 1986", "Koo 1987", "Pershagen 1987", "Humble 1987", "Lam 1987", "Gao 1987", "Brownson 1987", "Geng 1988", "Shimizu 1988", "Inoue 1988", "Kalandidi 1990", "Sobue 1990", "Wu-Williams 1990", "Liu 1991", "Jockel 1991", "Brownson 1992", "Stockwell 1992", "Du 1993", "Liu 1993", "Fontham 1994", "Kabat 1995", "Zaridze 1995", "Sun 1996", "Wang 1996"]) # stored level order
df = df.dropna(subset=["study", "or", "or_low", "or_high"]) # listwise deletion over the analysis columns
df["study"] = df["study"].cat.remove_unused_categories()
n_dropped = n_input - len(df)
warnings = []
if n_dropped:
warnings.append(cs.cs_warning("CS_W_ROWS_DROPPED", dropped=n_dropped, total=n_input))
if n_input and not len(df):
cs.cs_error("CS_E_NO_ROWS")
cs.check_finite_columns(df, ["study", "or", "or_low", "or_high"]) # infinite values stop the run (registry/errors.yaml)
# %% Studies
design = "ratio_ci" # inferred from the bound columns
measure = "GEN"
cols = {
"effect": df["or"].to_numpy(dtype=float),
"ci_low": df["or_low"].to_numpy(dtype=float),
"ci_high": df["or_high"].to_numpy(dtype=float),
}
es = meta.escalc(design, measure, cols, zero_cells="only0", drop00=True, ci_level=0.95)
measure = es["measure"]
labels_all = df["study"].astype(str).tolist()
keep = es["keep"]
left_out = [labels_all[i] for i in np.flatnonzero(~keep)]
idx = np.flatnonzero(keep)
y, v = es["yi"][idx], es["vi"][idx]
labels = [labels_all[i] for i in idx]
k = len(y)
if k < 2:
cs.cs_error("CS_E_TOO_FEW_ROWS", what="A meta-analysis", min=2, n=k) # one usable study can't be pooled
if left_out:
warnings.append(f"Left out ({len(left_out)}): " + ", ".join(left_out) + (" — no events (or only events) in both arms." if design == "binary" else " — effect or variance not computable."))
bt = meta.back_transform(measure)
MEASURE_LABEL = {"GEN": "effect", "LOG": "log ratio", "OR": "log odds ratio", "RR": "log risk ratio", "RD": "risk difference",
"MD": "mean difference", "SMD": "Hedges' g", "ZCOR": "Fisher's z", "COR": "correlation"}[measure]
RATIO = measure in ("OR", "RR", "LOG")
# What a back-transformed number is: a ratio, not a log ratio; a correlation, not Fisher's z.
DISPLAY_LABEL = {"OR": "odds ratio", "RR": "risk ratio", "LOG": "ratio", "ZCOR": "correlation"}.get(measure, MEASURE_LABEL)
if k < 3:
cs.cs_error("CS_E_TOO_FEW_ROWS", what="Testing for small-study effects", min=3, n=k) # Egger's regression and PET-PEESE fit two coefficients
if np.all(y == y[0]):
# Identical effects: Begg's rank correlation and the Egger / PET-PEESE regressions are undefined (an exact fit).
cs.cs_error("CS_E_CONSTANT", column="or")
# %% Small-study tests
conf = 0.95
tau2_method = "REML"
re = meta.rma(y, v, method=tau2_method, level=conf)
est = float(re["beta"][0])
eg = meta.egger(y, v, variant="classic", method=tau2_method, level=conf)
bg = meta.begg(y, v)
tf = meta.trimfill(y, v, method=tau2_method, side="auto", estimator="R0")
pp = meta.pet_peese(y, v, alpha=0.05, level=conf)
fs = meta.failsafe_n(y, v)
tff = tf["filled"]
# %% Assumptions
assumptions = [
{"key": "k_studies", "label": "Enough studies", "status": "warn" if k < 10 else "pass",
"detail": f"{k} studies" + ("; asymmetry tests have little power — a non-significant result says little." if k < 10 else ".")},
{"key": "heterogeneity", "label": "Low heterogeneity", "status": "warn" if re["i2"] > 50 else "pass",
"detail": f"I² = {re['i2']:.1f}%" + ("; heterogeneity alone can produce asymmetry and makes trim-and-fill unreliable." if re["i2"] > 50 else ".")},
]
# %% Result
disp = MEASURE_LABEL.replace("log ", "") if RATIO else MEASURE_LABEL
side_word = "left (smaller effects)" if tf["side"] == "left" else "right (larger effects)"
rows = [
{"test": "Egger" + (" (classic)" if eg["variant"] == "classic" else " (meta-regression on SE)"), "statistic": eg["stat"], "p": eg["p"],
"detail": f"limit effect {bt(eg['limit']):.3g} [{bt(eg['limit_ci_low']):.3g}, {bt(eg['limit_ci_high']):.3g}]"},
{"test": "Begg–Mazumdar", "statistic": bg["tau"], "p": bg["p"], "detail": "exact Kendall null" if bg["exact"] else "normal approximation"},
{"test": f"Trim-and-fill ({tf['estimator']})", "statistic": float(tf["k0"]), "p": None,
"detail": f"{tf['k0']} imputed on the {side_word}; adjusted {bt(float(tff['beta'][0])):.3g} [{bt(float(tff['ci_low'][0])):.3g}, {bt(float(tff['ci_high'][0])):.3g}]"},
{"test": "PET-PEESE", "statistic": pp["est"], "p": pp["pet_p"], "detail": f"{pp['use'].upper()} estimate {bt(pp['est']):.3g} [{bt(pp['ci_low']):.3g}, {bt(pp['ci_high']):.3g}]"},
{"test": "Fail-safe N (Rosenthal)", "statistic": fs["fsn"], "p": None, "detail": f"robust if above 5k + 10 = {fs['threshold']:.0f}"},
]
all_y = np.concatenate([y, tf["fill_y"]])
all_se = np.sqrt(np.concatenate([v, tf["fill_v"]]))
cs.publish({
"method": "meta.bias",
"methodVersion": "1.0.1",
"title": f"Small-study effects in {k} studies",
"engine": cs.engine_info("numpy", "scipy"),
"n": k,
"summary": f"Egger {cs.fmt_p(eg['p'])}; Begg τ = {bg['tau']:.3f}, {cs.fmt_p(bg['p'])}; trim-and-fill adds {tf['k0']} (pooled {bt(est):.3g} → {bt(float(tff['beta'][0])):.3g}).",
"apa": f"Egger's test {cs.fmt_p(eg['p'])}; Begg's τ = {cs.fmt_num(bg['tau'])}, {cs.fmt_p(bg['p'])}; trim-and-fill k₀ = {tf['k0']}",
"statistics": [{"key": "egger_p", "label": "p (Egger)", "value": eg["p"], "format": "p"}, {"key": "begg_p", "label": "p (Begg)", "value": bg["p"], "format": "p"},
{"key": "tf_k0", "label": "Studies imputed", "value": tf["k0"], "format": "integer"}],
"tables": [{"key": "tests", "title": f"Small-study diagnostics ({disp})",
"columns": [{"key": "test", "label": "Test", "type": "string"}, {"key": "statistic", "label": "Statistic", "type": "number"},
{"key": "p", "label": "p", "type": "number"}, {"key": "detail", "label": "", "type": "string"}],
"rows": rows}],
"assumptions": assumptions,
"warnings": warnings,
"notes": ["Asymmetry can come from publication bias, heterogeneity, chance or differences in study quality; these tests cannot tell which."],
"charts": [cs.chart("funnel", "meta-funnel", "Funnel plot with imputed studies",
{"estimate": cs.col(MEASURE_LABEL, [float(t) for t in all_y]), "se": cs.col("standard error", [float(t) for t in all_se]),
"label": cs.col("study", labels + [f"imputed {j + 1}" for j in range(tf["k0"])]),
"kind": cs.col("study", ["observed"] * k + ["imputed"] * tf["k0"])},
controls={"center": est, "adjusted": float(tff["beta"][0]), "contours": True, "eggerIntercept": eg["limit"], "eggerSlope": eg["bias"]})],
"values": {
"k": k, "est": est, "egger_stat": eg["stat"], "egger_p": eg["p"], "egger_bias": eg["bias"], "limit": eg["limit"], "limit_ci_low": eg["limit_ci_low"],
"limit_ci_high": eg["limit_ci_high"], "begg_tau": bg["tau"], "begg_p": bg["p"], "tf_k0": tf["k0"], "tf_est": float(tff["beta"][0]),
"tf_ci_low": float(tff["ci_low"][0]), "tf_ci_high": float(tff["ci_high"][0]), "pet": pp["pet"], "pet_p": pp["pet_p"], "peese": pp["peese"],
"peese_p": pp["peese_p"], "pet_peese_est": pp["est"], "fsn": fs["fsn"], "measure": measure, "measure_label": MEASURE_LABEL,
"tf_side": side_word, "pet_peese_use": pp["use"],
},
})
- Egger's testEgger's regression testTests funnel-plot asymmetry by regressing the standardized effect on precision; a non-zero intercept means small studies differ. regresses the standardized effect on precision: p = .023.
- Begg and MazumdarBegg's rank correlation testKendall's τ between standardized effects and their variances; a funnel-asymmetry test with lower power than Egger's. is a rank correlation between effect and variance: p = .216.
- PET extrapolates to a study with no sampling error: 0.005.
- PEESE does so with a curve: 0.120.
The tests disagree, and the sensitivity estimates range from nearly nothing to a substantial effect. That spread is the finding.
Asymmetry is not bias
ReadSmall studies may really differ: sicker patients, stronger doses, tighter protocols. Heterogeneity can create asymmetry on its own. These tests detect that small studies differ, not why.
Rule of thumb: Egger's test needs about ten studies, and it loses power when heterogeneity is large.
Fail-safe N
ReadRosenthal's fail-safe N asks how many null studies would be needed to make the result non-significant. Here it is 393, which sounds reassuring.
It tests only "is anything there?", assumes the missing studies average exactly zero, and ignores effect size. Report it if you must, but never as the answer.
A funnel without bias signals
ReflectThe BCG trials give p = .189 on Egger's test, with 1 imputed study. But PET gives −0.191 against a pooled −0.715.
With I² above 90%, how much weight would you put on any of these? Write down what you would say in a report.
Check your understanding
CheckpointCheck yourself
Egger's test gives p = 0.01. What is the most defensible statement?
Show the answer
Answer: b
The test detects small-study effects. Bias, real effect modification, and chance differences in design are all compatible with it.
Check yourself
How many studies did trim-and-fill impute for the passive-smoking data?
Show the answer
Answer: 7
The card reports the imputed count as k0. It estimates missing studies under a symmetry assumption and is a sensitivity analysis.
Check yourself
Why is a large fail-safe N weak reassurance?
Show the answer
Answer: a
Missing studies could easily have negative effects, and a smaller but still significant effect may change the decision.
Do it in CodeSplash
In the appIn the Meta-analysis studio, the Small-study effects step shows the contour-enhanced funnel and every estimate together. Contours mark where results would be significant: if studies cluster right inside a contour, selection on significance becomes more plausible.
Recap
Recap- A lopsided funnel means small studies differ. It does not say why.
- Egger and Begg detect that difference; both are weak with few studies.
- Trim-and-fill and PET-PEESE show how far the answer could move. Report the range.
Concepts in this lesson