Appendix D — Glossary

Terms are defined as this book uses them. Where a term has a broader meaning elsewhere, the definition here is the working one, and the chapter cross-reference is where it is developed. Entries are alphabetical within each heading. A term set in bold in a chapter links to its entry here.

D.1 Reproducibility and compendia

Five Pillars. The layered stack this book treats as the minimum for a reproducible project: Dockerfile, renv.lock, .Rprofile, source code, and data. See Chapter 11.

Methods reproducibility. The property that another analyst, given your code, data, and environment, obtains your numbers. Distinct from replication, which asks whether the finding holds in new data. See Chapter 2.

Provenance. The record of where a data object came from and what was done to it. A query, a script, and a dated extraction note are provenance; a file named final_v3.csv is not.

Replication. Repeating a study with new data to see whether the finding recurs. A reproducible analysis can be replicated; an irreproducible one cannot even be checked. See Chapter 2.

Research compendium. A single directory holding the code, data, environment specification, and narrative for one study, organized by convention so that a stranger can navigate it. See Section 11.1.

D.2 Environment and dependencies

Apptainer. A container runtime (formerly Singularity) used on shared HPC systems, where Docker is usually unavailable because it requires root. It runs unprivileged and can build its image from a Docker image. See Section 25.2.

Docker image. A built, immutable filesystem containing an operating system, system libraries, and R. A container is a running instance of an image. See Chapter 10.

Layer caching. Docker’s reuse of unchanged build steps. Slow, stable layers belong early in a Dockerfile and fast-changing source late, so that editing the manuscript does not trigger a package reinstall. See Chapter 10.

Library path. The ordered list of directories R searches for installed packages, returned by .libPaths(). R takes the first match and installs into the first entry. See Chapter 6.

Lockfile. renv.lock, the file recording every package version a project uses. It is the artifact committed to version control; the library itself is not. See Chapter 9.

renv. A package that gives a project its own library and records exact package versions in a lockfile. See Chapter 9.

snapshot() and restore(). The two halves of the renv cycle. snapshot() writes the current library state into the lockfile; restore() rebuilds a library to match a lockfile.

D.3 Version control

Branch. A named line of development that can diverge from main and later be merged back. See Chapter 7.

Commit. A recorded snapshot of the project with a message explaining why the change was made. See Chapter 7.

Continuous integration (CI). Automated rebuilding and testing of the project on a fresh machine at every push, which proves the analysis runs from what is in the repository rather than from the state of anyone’s laptop. See Section 27.9.

Git. The distributed version-control system this book uses. It records the project’s history as a sequence of commits, each recoverable, and GitHub hosts a shared copy. See Chapter 7.

Merge conflict. The state where two branches changed the same lines and Git cannot decide which to keep. Resolved by editing the marked region and committing. See Chapter 8.

Pull request. A proposal to merge a branch, reviewed by a colleague and checked by CI before it is merged. See Chapter 8.

Tag. A permanent, human-readable name for a specific commit, used here to mark submission and analysis-plan versions. See Section 7.5.

D.4 Reporting

Chunk. A block of executable code in a Quarto or R Markdown document. A fenced block without braces is displayed but not executed. See Chapter 23.

Cross-reference. A link such as @fig-name that resolves to a numbered figure, table, or section. An unresolved cross-reference is a build warning, not a silent failure.

Float. A figure or table that LaTeX may move away from where it is declared, to avoid awkward white space and bad page breaks. See Section 23.8.

freeze. A Quarto setting that caches computed output and re-executes only when the source changes. See Section 23.3.

Parameterized report. A document taking parameters at render time, so that one source produces a report per cohort or site. See Section 23.5.

Quarto. The publishing system this book uses to weave prose and executed code into HTML, PDF, and Word documents, websites, and books. The successor to R Markdown. See Chapter 23.

spin and purl. Complementary knitr functions. spin() turns an annotated R script into a document; purl() extracts the code from a document back into a script. See Section G.1.

D.5 Data wrangling

Anti-join audit. Using anti_join() to list the rows that failed to match, as a check on a join rather than a step in the pipeline. See Chapter 18.

Byte-order mark (BOM). Invisible bytes at the start of a text file marking its encoding. Whether it survives into the first column’s name depends on the reader and the locale, so a script can work on a laptop and fail in a container. See Section 13.2.3.

Factor. R’s type for a categorical variable, storing a fixed set of levels. Character is the safer type through reading, cleaning, and joining; factor is correct at modeling and plotting. See Chapter 16.

Join. Combining tables on a key. inner_join keeps matched rows only; left_join keeps all rows of the left table; full_join keeps all rows of both. semi_join and anti_join filter the left table by presence in the right without adding columns. See Chapter 18.

Key. The column or columns identifying a row uniquely in a table. Verifying key uniqueness before a join is the single most useful check in this book. See Chapter 18.

Level and reference level. The permitted values of a factor, and the one against which model coefficients are contrasted. The reference level should be chosen deliberately, not inherited from alphabetical order. See Chapter 16.

Long and wide format. Wide holds one row per subject with repeated measures across columns; long holds one row per subject-visit. Plotting and mixed models generally want long; within-subject differences are easier wide. See Chapter 15.

Many-to-many relationship. A join in which the key repeats on both sides, producing the product of the matches. Usually a key error rather than an intention, which is why dplyr warns. See Chapter 18.

Pipe. An operator that passes the result of one step to the next, so a transformation reads left to right. R’s native pipe |> sends the value on its left as the first argument of the function on its right; the shell’s | sends one command’s output to the next command’s input. See Section 5.3.

Pivot. The reshaping operation between long and wide format, pivot_longer() and pivot_wider(). See Section 15.3.

Tidy data. A layout in which each variable is a column, each observation a row, and each type of observational unit a table. See Chapter 15.

Tidy evaluation. The mechanism letting a function accept a bare column name. { col } embraces an argument; .data[[name]] takes a column name as a string. See Chapter 15.

D.6 Missing data

Complete-case analysis. Dropping rows with any missing value in the model variables. Its regression coefficients are unbiased when missingness does not depend on the outcome given the covariates, whatever the mechanism label, and it always discards information. See Section 21.3.

Delta adjustment. A sensitivity analysis shifting imputed values by a stated amount to probe departures from MAR. See Section 21.6.

Fraction of missing information (FMI). The share of the variance of an estimate attributable to missingness, reported alongside pooled results.

Last observation carried forward (LOCF). Single imputation that holds a dropout at the last observed value. The assumption is biologically implausible for most diseases, and this book treats it as an antipattern. See Section 21.4.

MCAR, MAR, MNAR. Missing completely at random, missing at random given observed variables, and missing not at random. The third cannot be tested from the data and requires sensitivity analysis. See Section 21.1.

Mean imputation. Replacing missing values with the column mean. It understates the spread of the filled variable and can bias coefficients, and this book treats it as an antipattern. See Section 21.4.

MMRM. Mixed model for repeated measures: a likelihood analysis of all observed visits with an unstructured covariance across visits. It imputes nothing and is valid under MAR. It is the standard primary analysis for a repeated continuous outcome in a trial. See Section 21.6.

Multiple imputation. Generating several completed datasets, fitting the model in each, and pooling. The between-dataset variation is the uncertainty single imputation discards. See Section 21.5.

Rubin’s rules. The formulas combining within- and between-imputation variance into one standard error. See Section 21.5.

Tipping-point analysis. A sensitivity analysis that increases a delta adjustment until the conclusion changes, and asks whether that departure from MAR is clinically plausible. With a shift per arm, the tipping point is a boundary in two dimensions. See Section 21.6.

D.7 Trials and analysis plans

Analysis set. The subjects an analysis includes, such as the intention-to-treat (full analysis) set or the per-protocol set. Pre-specified in the SAP and implemented as ADSL flags. See Section 28.3.

CONSORT. Consolidated Standards of Reporting Trials, the reporting guideline for randomized trials. Its flow diagram reports every exclusion and loss with a count. See Section 21.7.

Data lock and unblinding. The point after which the dataset does not change and treatment assignment becomes known. Only analyses pre-specified before it count as confirmatory. See Chapter 26.

Estimand. A precise statement of what is being estimated, given by the five ICH E9(R1) attributes: population, treatment conditions, variable, intercurrent events with their strategies, and population-level summary. See Section 26.2.

Intercurrent event. An event after treatment starts that changes the interpretation or the existence of the outcome, such as nonadherence or death. Each needs a stated strategy (treatment policy, composite, hypothetical, while on treatment, or principal stratum). See Section 26.2.

Minimum clinically important difference (MCID). The smallest effect that would matter to patients or clinicians, fixed in the SAP. An interval is read against both zero and the MCID to say what it rules out. See Section 33.2.

SAP. Statistical analysis plan. Drafted without data access, tagged in version control, and amended only with a dated new version. See Chapter 26.

D.8 Clinical data standards

ADaM. Analysis Data Model, the analysis-ready layer the statistician builds from SDTM, each value traceable back to it. See Section 28.3.

ADSL, ADTTE, ADAE. The subject-level, time-to-event, and adverse-event ADaM datasets. See Section 28.4.

CRF. Case report form, the instrument by which site staff record data. See Chapter 28.

Define-XML, aCRF, SDRG, ADRG. The metadata and documentation accompanying a submission: the machine-readable data definition, the annotated CRF, and the study and analysis data reviewer’s guides.

Domain. An SDTM dataset on one topic, such as DM (demographics), AE (adverse events), or LB (laboratory results). See Section 28.2.

Double programming. Industry’s standard validation: a second programmer derives the same output independently from the specification, and the two are compared value by value. See Section 28.5.

Pharmaverse. A cross-company collection of R packages for the clinical reporting pipeline, among them admiral, metacore, metatools, and xportr. See Section 28.5.

SDTM. Study Data Tabulation Model, the CDISC standard for collected data, one row per observation. Immutable once locked; the statistician reads it and does not edit it. See Section 28.2.

TLF. Tables, listings, and figures: the outputs of the statistical analysis, assembled into the clinical study report. See Section 28.5.

Transport file (XPT). The SAS transport format, version 5, required for regulatory submission and the durable interchange format between R and SAS. Each crossing can truncate variable names and lose labels, so each deserves a check. See Chapter 29.

D.9 Prediction and inference

AUC. Area under the receiver operating characteristic curve: the probability that a randomly chosen case receives a higher predicted risk than a randomly chosen non-case. A measure of discrimination, reported with an interval. See Section 31.6.

Cross-validation. Estimating out-of-sample performance by repeatedly fitting on part of the data and evaluating on the held-out rest. When a participant contributes several rows, folds must be assigned by participant. See Section 31.6.

Data leakage. Information from the evaluation data reaching the model during fitting, for example the same participant in training and test folds. It makes performance look better than any new data will confirm. See Section 31.6.

MCI. Mild cognitive impairment, a heterogeneous state between normal cognition and dementia; the ADNI case study predicts conversion from MCI to Alzheimer’s disease. See Section 31.1.

Target trial. The hypothetical randomized trial that would answer a causal question. Target-trial emulation designs an observational analysis to mimic it, above all by aligning eligibility, assignment, and the start of follow-up. See Section 32.4.

D.10 Privacy and data governance

Data use agreement (DUA). A contract under which data are received, commonly forbidding re-identification, contact, and redistribution. Its terms bind even after de-identification. See Section 4.4 and Section 31.2.

Date shifting. Offsetting every date for a patient by a constant, preserving within-patient intervals while destroying calendar time. See Section 4.3.

Expert Determination. The HIPAA de-identification method in which a qualified expert certifies, using accepted methods, that the risk of re-identification is very small. More flexible than Safe Harbor and more involved. See Section 4.2.

HIPAA. The Health Insurance Portability and Accountability Act. Its Privacy Rule governs protected health information and defines the de-identification pathways. See Chapter 4.

IRB. Institutional review board, the committee that approves and oversees research with human subjects. Its protocol, with any DUA, decides whether an analysis may start. See Section 3.2.

k-anonymity. The property that every combination of quasi-identifier values in a dataset is shared by at least \(k\) records. Achieved by generalizing and suppressing; refinements such as l-diversity address weaknesses it leaves. See Section 22.2.

Limited data set. Data with the direct identifiers removed but dates, city, state, and ZIP code kept. It is still PHI and may be disclosed for research only under a DUA. See Section 4.2.

PHI. Protected health information: individually identifiable health information held by a covered entity, as defined by the HIPAA Privacy Rule. See Chapter 4.

Quasi-identifier. A field that is not an identifier alone but becomes one in combination, such as ZIP code with date of birth and sex. See Chapter 4.

Safe Harbor. The HIPAA de-identification method that removes eighteen specified categories of identifier, with no actual knowledge that the rest could identify anyone. The result is de-identified, not anonymous. See Section 4.2.

D.11 Research ethics

Aggregation harm. Harm from assembling individually innocuous disclosures into a whole that exposes people, the ethical counterpart of quasi-identifiers. See Section 32.3.

HARKing. Hypothesizing after the results are known: presenting a hypothesis formed from the data as if it had been stated in advance. A questionable research practice that a tagged analysis plan prevents. See Section 32.2.

Overlapping-interval fallacy. Concluding that two groups do not differ because their confidence intervals overlap. The interval for the difference is narrower than the two intervals suggest and can exclude zero. See Section 32.6.

Questionable research practices (QRPs). Practices between misconduct and good practice, such as HARKing, undisclosed analytic flexibility, and selective reporting. They are rarely fraud but often decide the result. See Section 32.2.

Research misconduct. Under the federal definition, fabrication, falsification, or plagiarism in proposing, performing, reviewing, or reporting research. Omitting data without disclosure is falsification. See Section 32.2.

D.12 Testing

End-to-end test. A test running raw data through to final outputs. Slow, broad, and the last line of defense.

Integration test. A test running the whole pipeline on a small synthetic dataset. Catches composition bugs and silent filter and join errors, and has the best cost-benefit ratio for analysis code.

Mutation testing. Planting deliberate bugs (mutants) to see whether the test suite fails on them. The share of mutants killed measures how many errors the suite can detect. See Section 27.7.

Snapshot test. A test comparing output against a recorded version, which detects change without asserting correctness.

Structural versus correctness assertion. Checking that a result has the right shape, against checking that it holds the right values. Only the second is a correctness test. See Section 27.3.

Tautological test. A test that passes regardless of whether the code is right, such as comparing a function’s output to itself. See Section 27.5.

Unit test. A test of one function on known input. Fast, narrow, and catches helper bugs. See Chapter 27.

D.13 AI-assisted coding

Prompt injection. Text in a file, web page, or README that an agent reads, written to instruct the model. The agent cannot reliably tell it from your instructions, so what it reads is untrusted. See Section 12.3.

Slopsquatting. Registering a package name that models hallucinate, with malicious code, so that an unchecked install runs it. Confirm a package exists before installing it. See Section 12.3.

D.14 Graphics

Aesthetic mapping. The assignment of a variable to a visual property such as position, color, or shape. The grammar of graphics requires the variable to be a column, which is why plotting usually wants long format. See Chapter 20.

Alt text. A short description of what a figure shows, read by screen readers. Required for informative images; decorative images take an empty description instead.

Faceting. Splitting one plot into small multiples by a grouping variable. See Chapter 20.

Truncated axis. A y-axis not beginning at zero, which exaggerates a difference without containing a false number. See Section 32.5.

D.15 Pipelines

DAG. Directed acyclic graph. In a pipeline, the dependency structure: editing one node makes everything downstream stale and nothing upstream (Section 24.1). In causal inference, a diagram of assumed causal structure from which an adjustment set is read (Section 32.4).

Makefile. The file read by make, listing named targets and the commands that build them. A zzcollab project’s Makefile wraps the routine Docker and render commands. See Section 11.9.

Target. One node of a targets pipeline: a named object with declared dependencies, rebuilt only when those change. See Chapter 24.

D.16 Open publishing

CC BY. The Creative Commons Attribution license, permitting adaptation and commercial use with credit. The standard recommendation for open textbooks.

dbGaP. The NIH Database of Genotypes and Phenotypes, a controlled-access repository for studies that pair genotype with phenotype. The wrong home for general clinical data. See Section 34.2.

Deposition. Placing data or code in a repository that guarantees persistence, as distinct from hosting it on a personal page or a lab server. See Chapter 34.

DMSP. Data Management and Sharing Plan, required by NIH with each application that will generate scientific data and approved as a term of the award. It states what will be shared, where, and when. See Section 26.17.

DOI. Digital object identifier, a permanent citable handle for a deposited artifact. See Chapter 34.

Open educational resource (OER). A teaching work licensed to permit reuse, revision, and redistribution. Licenses forbidding derivative works do not qualify.