Analysis
From analysis-ready dataset to results
Once you have assembled your analysis dataset (Phase 12), you are ready to analyse. This section stays register-specific and practical: when to use what, which packages, and a minimal example - it does not teach statistical theory. For depth, see the Epidemiologist R Handbook, R for Data Science and DDEA’s R course (see Learning resources).
Pages in this section
Pick the pages that fit your study - not every study uses all of them.
| Page | Packages |
|---|---|
| Choosing a statistical analysis | stats (base R; choose test and model) |
| Descriptive tables (Table 1) | gtsummary, finalfit |
| Figures for publication | ggplot2 |
| Regression | glm/lm, survival::clogit (matched case-control) |
| Time-to-event | survival, survminer, tidycmprsk (Cox, competing risks) |
| Rates and rate ratios (Poisson) | glm (Poisson), MASS::glm.nb, Epi/popEpi (incidence rate ratio, person-time) |
| IP weighting (IPTW and IPCW) | WeightIt, cobalt (confounding + censoring/missing outcomes) |
| Sensitivity analyses | survival (robustness checks, negative control outcome, active comparator) |
Output control decides what you can compute, not just what you can send. Only aggregated results leave DST, and cells below the threshold (3 or 5 observations, depending on your project) may not be repatriated at all. That shapes the analysis itself: how finely you may stratify a table, whether a subgroup is worth running, whether a figure can show what you want. Plan for it here rather than discovering it at the end. The rules and the threshold are on Phase 14 - Export and repatriation.