← 返回 Tessera
模拟21 行 × 41 KB无缺失数据 2026-09-02

trial_participant_flow

A synthetic randomized-trial cohort moving through screening, allocation, follow-up and complete-case analysis.

One row represents one participant flow between two trial-stage nodes.

Tessera · 收录于 2026-09-02

下载 CSV · 1 KB
数据预览6
sourcetargetnstage
AssessedRandomized900Screening
AssessedExcluded300Screening
ExcludedIneligible180Screening
ExcludedDeclined90Screening
ExcludedOther reasons30Screening
RandomizedIntervention450Allocation
变量4
字符型3整数1
类型
#变量类型缺失统计
1sourceTrial-state node from which participants move.字符型不同值 9Excluded · Treated · Received control · Assessed · Randomized · Intervention · Control · Intervention follow-up
2targetTrial-state node receiving the participants.字符型不同值 21Randomized · Excluded · Ineligible · Declined · Other reasons · Intervention · Control · Treated
3nkeyNumber of participants in the flow.整数min 3q1 中位 180.0均值 233.3q3 max 900.0
4stageScreening, Allocation, Follow-up or Analysis.字符型不同值 4Allocation · Follow-up · Screening · Analysis
载入已写好列类型
library(readr)

trial_participant_flow <- read_csv(
  "https://assets.evanzhou.org/tessera/csv/trial_participant_flow.csv",
  col_types = cols(
    source = col_character(),
    target = col_character(),
    n      = col_integer(),
    stage  = col_character()
  )
)
URLhttps://assets.evanzhou.org/tessera/csv/trial_participant_flow.csv

Source

A deterministic synthetic cohort created for the Tessera Sankey recipe. Of 1,200 people assessed for eligibility, 900 are randomized equally to intervention and control; subsequent branches represent non-receipt, loss to follow-up, discontinuation and exclusion from complete-case analysis.

The values do not describe a real trial. Every internal node is balanced exactly, and intervention and control remain separate through the analysis stage.

Use cases

  • Participant-flow Sankey diagrams
  • Demonstrating attrition at several trial stages
  • Checking conservation at internal nodes
  • Contrasting Sankey quantity flow with a formal CONSORT diagram
生成脚本R · 50
# Generate the synthetic edge table used by the trial-participant Sankey recipe.
script_dir <- local({
  arg <- grep("^--file=", commandArgs(trailingOnly = FALSE), value = TRUE)
  path <- if (length(arg)) sub("^--file=", "", arg[[1L]]) else sys.frame(1)$ofile
  dirname(normalizePath(path, mustWork = TRUE))
})
out_csv <- file.path(script_dir, "..", "csv", "trial_participant_flow.csv")
dir.create(dirname(out_csv), recursive = TRUE, showWarnings = FALSE)

trial_participant_flow <- data.frame(
  source = c(
    "Assessed", "Assessed",
    "Excluded", "Excluded", "Excluded",
    "Randomized", "Randomized",
    "Intervention", "Intervention", "Control", "Control",
    "Treated", "Treated", "Treated",
    "Received control", "Received control", "Received control",
    "Intervention follow-up", "Intervention follow-up",
    "Control follow-up", "Control follow-up"
  ),
  target = c(
    "Randomized", "Excluded",
    "Ineligible", "Declined", "Other reasons",
    "Intervention", "Control",
    "Treated", "Not treated", "Received control", "No control",
    "Intervention follow-up", "Intervention lost", "Intervention stopped",
    "Control follow-up", "Control lost", "Control stopped",
    "Intervention analyzed", "Intervention excluded",
    "Control analyzed", "Control excluded"
  ),
  n = c(
    900, 300, 180, 90, 30, 450, 450, 430, 20, 425, 25,
    375, 35, 20, 370, 40, 15, 372, 3, 366, 4
  ),
  stage = c(
    rep("Screening", 5), rep("Allocation", 6),
    rep("Follow-up", 6), rep("Analysis", 4)
  ),
  stringsAsFactors = FALSE
)

internal_nodes <- intersect(trial_participant_flow$source, trial_participant_flow$target)
for (node in internal_nodes) {
  stopifnot(
    sum(trial_participant_flow$n[trial_participant_flow$target == node]) ==
      sum(trial_participant_flow$n[trial_participant_flow$source == node])
  )
}

write.csv(trial_participant_flow, out_csv, row.names = FALSE)

表中统计由 scripts/profile_dataset.py 于 2026-09-02 数出。