Skip to content

RWE Tools

Protocol Generator

Nine pharmacoepidemiology study designs, each with a guided form that drafts a multi-country protocol — a phenotype library that flags which definitions carry a validation study, feasibility checks across Asian databases, consistency checks that flag design errors as you type, and one-click Word / Markdown export. Everything runs in your browser; nothing is uploaded.

Help me choose a design ↓ I know what I want — go to the nine designs ↓

Templates curated from OCEAN, the Open Causal Effect Analysis Network operated by the PHDc, NCKU. Maintained by Daniel Tsai.

← All RWE tools

Which design does my question need?

If study design is new to you, start here

A study design is the recipe for three things: who gets counted, when each person's clock starts, and what they are compared with. In pharmacoepidemiology, most serious errors are design errors rather than statistical ones — people already taking the drug get counted as new starters, follow-up during which an event could not yet have been recorded gets credited to one arm, or two groups turn out to differ by how sick they were rather than by the drug. Each design below arranges the data so that one particular error cannot happen, and pays for it with an assumption you then have to defend. The six questions below narrow the nine designs to the few worth considering. They are not a decision tree: more than one design is often defensible, and when two questions point different ways that is a real feature of your research question rather than a defect in these six.

A good protocol names the design it did not choose, and says why.

  1. 1

    Do you have an active comparator — another drug, not 'nobody'?

    That means a drug used for the same indication, at the same point in the treatment pathway, with no a-priori link to your outcome. If one exists, a cohort design is available and is usually the better choice: people who get drug A and people who get drug B are far more alike than people who get a drug and people who get nothing, so confounding by indication is much smaller to begin with. If no such comparator exists, a self-controlled or calendar-time design is the usual destination — but not the only one, because a comparator arm need not be a comparator drug.

    If yes → ACNUCCWST

    If no → SCCSCCOITSTIT and questions 2 and 6 still apply. Two of the cohort designs can run against an untreated arm rather than a comparator drug: cloning, where the strategies only declare themselves later — “start within 90 days” — which is question 2; and sequential trial emulation, where eligibility itself varies over time and the not-yet-treated at each origin form the control arm. A rare outcome or a purely descriptive aim does not need a comparator either.

  2. 2

    Can you tell the two strategies apart on day one?

    If your strategies are 'start within 90 days', 'stay on treatment', or 'treat to target', then on day one nobody has yet declared which arm they are in. Sorting patients by what they later did credits one arm with follow-up during which they could not yet have had the event — immortal time — and that alone can manufacture a protective effect. Cloning every patient into both strategies, or emulating a fresh trial at each eligible date, is what prevents it.

    If yes — each arm is declared at time zero → this question does not narrow anything on its own: an ordinary new-user cohort is available, but only if question 1 found you a comparator. A sequential trial emulation is also available here, and does not need one — it is triggered by eligibility varying over time rather than by the arms being indistinguishable on day one, and at each origin the initiators and the not-yet-treated are perfectly distinguishable.

    If no — they only diverge later → CCWST

  3. 3

    Is the exposure short-lived and the outcome sudden?

    A transient exposure plus an acute, datable onset is what makes a self-controlled design work: exposed and unexposed time both exist within the same person, so the comparison can be made inside them. Choose SCCS if you can lay out each case's whole observation period as exposed and unexposed person-time; choose case-crossover if you can only look back a short way from the event.

    If yes, and you can lay out the whole observation period → SCCS but only if the event neither ends observation nor changes later exposure — a fatal outcome, or a drug that gets stopped once the event happens, rules out the standard SCCS however complete your data are. Extensions exist for both, and the SCCS template here offers the Farrington one; neither is the model you get by default.

    If yes, but you can only look back a short way → CCO

    If no → no self-controlled design applies — the other questions are the ones that route you.

  4. 4

    Is the confounding you are worried about fixed, or does it change over time?

    Genetics, lifelong habits, stable frailty — self-controlled designs remove all of these by construction, and trend-in-trend removes them through the trend contrast, in both cases without your ever having to measure them. That is a genuinely strong property. It does not extend to time-varying confounding: ageing, season, worsening disease and calendar trends in prescribing all survive, and must still be modelled explicitly.

    If it is fixed → SCCSCCOTIT and this branch is about confounding you cannot measure — removing it unmeasured is what these three do. A fixed confounder you did record is ordinary work for any of the cohort designs, so answering “fixed” is not on its own a reason to leave them.

    If it changes over time → ACNUCCWST and you must have measured it — none of these removes a time-varying confounder you did not record. Where the confounder is itself affected by earlier treatment, a baseline propensity score is not enough and a g-method is needed.

  5. 5

    Was there a date — or a gradual change over the years?

    A policy, reimbursement or label change with a clear start date makes interrupted time series available: the outcome's own pre-intervention trend, extrapolated forward, becomes the counterfactual. If the change was gradual rather than a step, there is no date to interrupt at, and trend-in-trend uses the gradient instead — a drug's use falling away after a safety warning serves as well as one climbing.

    If there was a date → ITS

    If use rose or fell gradually → TIT

    If neither — no date, and no marked trend either way → this question does not route you: both calendar-time designs read the effect off a change over calendar time, and with neither there is nothing for either to read. Almost every drug's use moves over a decade, so answer this on whether that movement is the contrast you mean to rely on — not on whether it happened.

  6. 6

    Is the outcome rare — or are you not really comparing anything?

    These are two separate questions that happen to point the same way. For a rare outcome, following an entire cohort spends most of its effort on people who never have the event; sampling controls from the source population instead is far more efficient for the same precision. And if what you want is a rate, a trend or a utilisation pattern rather than an effect, that is a descriptive analysis — legitimate and often the most useful output, provided it is not written up as though it were causal.

    If the outcome is rare → CC though a rare outcome with a good active comparator is often still a cohort study, with case-control sampling inside it for efficiency.

    If no causal contrast is intended → DA

    If the outcome is common and you do intend a causal contrast → neither half of this question applies, which is the ordinary case rather than a problem — questions 1 to 5 are the ones that route you.

One caution. Every design here removes some confounding and leaves the rest. The self-controlled designs remove time-invariant confounding without measuring it, but that does not make the two interchangeable: SCCS uses the whole observation period, so it is unusable if the event changes later exposure, while a case-crossover looking only backwards never samples post-event exposure and is untouched by it — the bidirectional referent offered as a sensitivity analysis gives that immunity up. What breaks the case-crossover is a trend in exposure prevalence, and chronic exposure or insidious onset breaks it outright. The cohort designs handle time-varying confounding, but only for what you actually measured — and measuring it is not always enough: where a confounder is itself affected by earlier treatment, the estimate a baseline propensity score gives is biased however well that confounder was recorded, and a g-method is needed — clone-censor-weight's inverse-probability-of-censoring weighting is the one on this page. Choose on the assumption you can defend, not on the estimate you would prefer — and pre-specify the analysis that would show you were wrong.

Cohort designs with a comparator

Follow two groups of patients forward in time from a starting point that is defined the same way for both groups.

You can define a common time zero and follow comparable groups forward. Strongest when a genuine active comparator exists; all three are framed as target-trial emulations, which forces you to state the trial you would have run.

ACNU

Runs in Studio

Active-Comparator New-User Design

Two drugs for the same condition, compared from the day each patient starts.

Use when

The comparator behaves as an 'emulated placebo' drawn from the same therapeutic context, so confounding by indication is minimised. Aligning eligibility, treatment assignment and follow-up at time zero is what avoids immortal-time bias; requiring a washout with no prior use of either drug is what avoids prevalent-user bias.

Assumes

The comparator shares the indication and has no a-priori association with the outcome; no unmeasured confounding remains after propensity-score adjustment; and, under an on-treatment analysis, censoring at switch or discontinuation is uninformative — which it is not if the reasons for stopping are associated with the outcome, and it then needs IPCW.

Breaks when

No genuine comparator exists and the honest question is 'drug vs nothing'; the comparator is chosen by disease severity; or the washout is too short, so prevalent users leak in and bring their already-survived early risk with them.

Typical example

SGLT2 inhibitors vs DPP-4 inhibitors and risk of MACE

Lund JL, Richardson DB, Stürmer T. Curr Epidemiol Rep 2015;2:221–228. doi:10.1007/s40471-015-0053-5

Open this template →

CCW

Clone-Censor-Weight

The strategies differ only in what happens after follow-up starts, so everyone is counted in both — then dropped when they stop matching.

Use when

Use when the strategies cannot be distinguished at time zero: grace periods ('start within X days'), sustained use, or treat-to-target. Each patient is cloned into every strategy at time zero, censored when their data stop matching the assigned strategy, and reweighted by inverse-probability-of-censoring weights to recover the per-protocol effect.

Assumes

Exchangeability, positivity and consistency — plus, because the artificial censoring is informative by design, no unmeasured predictors of deviation. It also requires you to give up the hazard ratio as a causal contrast: the arms hold the same patients at time zero by construction and separate only as patients act, so the contrast begins at no difference and emerges over follow-up; proportional hazards is violated by design, and Maringe et al. advise reporting an absolute contrast — a difference in survival at the end of follow-up, or in restricted mean survival time — rather than reading a Cox hazard ratio causally. And because every patient is cloned into both arms, the dataset holds twice as many rows as it does patients, so model-based standard errors are too small: the interval has to come from a non-parametric bootstrap that re-runs cloning, censoring and weighting inside each replicate.

Breaks when

The grace period is zero — the strategies are then already distinguishable at time zero, which is the situation cloning exists to avoid: each patient's two clones split at once, no person-time is shared between the arms, and an active-comparator new-user cohort is the design you want instead. It also fails if the grace period swallows most of the follow-up, or if deviation is driven by something you never measured, in which case the weights cannot repair it.

Typical example

Statin vs no statin within 90 days of MI (90-day grace period)

Maringe C, Benitez Majano S, Exarchakou A, et al. Int J Epidemiol 2020;49:1719–1729. doi:10.1093/ije/dyaa057

Open this template →

ST

Sequential Trial Emulation

Run the same small trial again and again — once at every date a patient becomes eligible — then pool the results.

Use when

Use when eligibility is time-varying and a single index date discards everyone who qualifies later. Whether a patient can appear in more than one trial depends on which version you are running: where the control arm is those not yet treated, a patient who stays eligible enters a trial at every origin until they initiate or have the outcome, so no eligible person-time is wasted; where both arms initiate at the origin, each patient sits in the single trial they initiate in. Either way the prevalent-user problem is handled trial by trial.

Assumes

Exchangeability, positivity and consistency within each nested trial — the last two assessed trial by trial, not only in the pooled data. Where a patient can appear in more than one trial — the not-yet-treated control arm described above — those trials are not independent samples, and the uncertainty must account for the re-use; where each patient sits in a single trial, it does not arise. The correction for re-use is an analysis requirement rather than an identifying assumption, and the builder will not guess which version you mean.

Breaks when

Eligibility does not actually vary over time, so every patient has one possible origin and the design collapses back to a single-origin new-user study; positivity fails within trial, because at some origins there are too few initiators for the propensity score to have support; or the confounders are themselves affected by earlier treatment, in which case a baseline propensity score fitted at each origin is not enough and a g-method is needed.

Typical example

Benzodiazepine vs no use in pregnancy, a trial at each gestational week

Hernán MA, Alonso A, Logan R, et al. Epidemiology 2008;19:766–779. doi:10.1097/EDE.0b013e3181875e61

Open this template →

Self-controlled designs

No comparison group at all — each patient is compared with themselves at a different time.

Cases only. Every time-invariant between-person confounder is removed by construction, measured or not. The price is a strong assumption about how exposure and the event relate in time.

SCCS

Runs in Studio

Self-Controlled Case Series

Only people who had the event; compare their risk during exposed and unexposed stretches of their own lives.

Use when

Use for transient exposures and acute outcomes, especially where cases are far easier to identify than the source population. Each case's observation period is split into exposed and unexposed person-time and the incidence-rate ratio is estimated within the person, so all time-invariant between-person confounding disappears.

Assumes

The event does not alter the probability of subsequent exposure, and does not end observation; repeat events within a person are independent, which fails for clustered outcomes such as recurrent falls or repeat admissions for one episode and makes the confidence intervals too narrow — restrict to the first event per person, or justify independence explicitly; and time-varying confounders such as age and season are modelled explicitly. A pre-exposure window is conventionally separated out and its incidence-rate ratio reported as a parameter in its own right — a raised one is a finding about confounding by indication, not a nuisance to be absorbed.

Breaks when

The outcome is fatal or otherwise censors follow-up; the event itself changes prescribing (event-dependent exposure — e.g. the drug is stopped after the event); or the exposure is chronic and continuous, leaving no unexposed person-time to contrast.

Typical example

Antipsychotic dispensing and risk of falls in older adults

Petersen I, Douglas I, Whitaker H. BMJ 2016;354:i4515. doi:10.1136/bmj.i4515

Open this template →

CCO

Runs in Studio

Case-crossover

Only people who had the event; ask whether they were exposed just before it more often than at earlier moments.

Use when

Outcome-anchored: enrol patients on the acute event itself, then look back and compare exposure prevalence in a short hazard window immediately before onset with prevalence in matched control windows further back. Because each case is their own control, the matched analysis removes time-invariant between-person confounding automatically; what it cannot remove is anything that changes within the person across the look-back.

Assumes

Exposure is transient and its prevalence does not trend over time — within the person, not only across the calendar; the outcome has abrupt onset; and there is no carry-over from the control windows into the hazard window.

Breaks when

Exposure prevalence trends over time, because the hazard window is always more recent than the control windows. A time-stratified referent removes the calendar-time part of that, and a case-time-control or case-case-time-control subtracts the part shared with a comparison series; none of them removes a trend specific to the individual, such as a dose escalated as that person deteriorates. Chronic exposure or insidious onset breaks the design outright.

Typical example

Triggers of acute MI in the 24 hours before onset

Maclure M. Am J Epidemiol 1991;133:144–153. doi:10.1093/oxfordjournals.aje.a115853

Open this template →

Outcome-sampled designs

Start from the people who already had the outcome, and work backwards.

Enrol on the outcome, sample a comparison group from the population that produced the cases, then look back for exposure. Efficient when the outcome is rare.

CC

Case-Control

Take the people who had the outcome and similar people who did not, then look back at who was exposed.

Use when

Use when the outcome is rare and following a whole cohort is wasteful. Enrol on the outcome, sample controls from the source population — risk-set, cumulative, or case-cohort — optionally match, and ascertain exposure before the index date.

Assumes

Controls come from the same source population that produced the cases, and exposure is ascertained identically in both. Under risk-set (incidence-density) sampling the odds ratio estimates the incidence-rate ratio with no rare-disease assumption; under cumulative sampling it approximates the risk ratio only if the outcome is rare; under case-cohort sampling it estimates the risk ratio over a fixed cohort with complete follow-up, whereas the Prentice-weighted analysis used when follow-up is censored estimates a hazard ratio instead.

Breaks when

Controls are drawn from a different population (selection bias), or exposure is measured differently in cases and controls. Individually matched sets must be analysed by conditional logistic regression — and the matching factors must not then also be adjusted as covariates; frequency matching reverses both halves of that rule.

Typical example

NSAIDs and hospitalised upper-GI bleeding, 4:1 risk-set-matched controls

Vandenbroucke JP, Pearce N. Int J Epidemiol 2012;41:1480–1489. doi:10.1093/ije/dys147

Open this template →

Calendar-time quasi-experiments

The comparison runs across calendar time rather than between individual patients.

The contrast comes from how an outcome moves over calendar time — around an intervention date, or across groups that took a drug up at different speeds. No individual-level comparator is needed.

ITS

Runs in Studio

Interrupted Time Series

Something changed on a known date — did the outcome jump, or bend away from where it was already heading?

Use when

Use for a population-level intervention or policy with a clear date. Segmented regression separates an immediate change in level from a change in slope, using the extrapolated pre-intervention trend as the counterfactual. A control series turns it into a controlled ITS.

Assumes

The pre-intervention trend would have continued unchanged had the intervention not happened; there are enough points either side to estimate that trend (the ITS template asks for at least 8 on each side of the interruption, ideally 12 — a conventional minimum, not a threshold from the tutorial cited below); and seasonality and autocorrelation are handled rather than ignored.

Breaks when

A co-intervention or secular change coincides with the interruption. A control series differences that out only if the co-intervention affects both series; one that hits the intervention series alone survives the control untouched. Too few pre-period points, or unmodelled seasonality, and the level and slope estimates are not trustworthy even when they look clean.

Typical example

Effect of a 2019 reimbursement policy on monthly SGLT2-inhibitor initiation rates

Lopez Bernal J, Cummins S, Gasparrini A. Int J Epidemiol 2017;46:348–355. doi:10.1093/ije/dyw098

Open this template →

TIT

Trend-in-Trend

A drug's use climbed over the years — did the outcome climb faster in the groups where it caught on faster?

Use when

Use when there is no single intervention date, but the drug's prevalence of use rises or falls markedly over calendar time. Strata are defined by each person's cumulative probability of exposure (CPE) — the probability of being exposed at some point in the study period, predicted from a stage-1 model of covariates that affect exposure and are not themselves affected by it (no mediators, no post-exposure variables), rather than an observed percentage exposed. If the outcome tracks the exposure trend more steeply where uptake was faster, that supports a causal effect, and the estimate is robust to time-invariant unmeasured confounding.

Assumes

Exposure prevalence genuinely trends over calendar time; the unmeasured confounding is time-invariant; and the outcome trend is otherwise stable across CPE strata.

Breaks when

The prevalence trend is flat or weak, so the design has no power; or a differential secular trend or co-intervention tracks faster uptake, which biases it — pre-specify a negative-control outcome or a pseudo-period to check.

Typical example

Statins and incident diabetes, using the rise in statin prevalence 2005–2018

Ji X, Small DS, Leonard CE, Hennessy S. Epidemiology 2017;28:529–536. doi:10.1097/EDE.0000000000000579

Open this template →

Descriptive

Counting and describing, not comparing treatments.

No causal contrast is attempted. Characterise a population — and supply the denominators that causal studies depend on.

DA

Descriptive analysis

How common is it, who gets it, how is the drug used — and is that changing? No treatments are compared.

Use when

Use when you want to characterise a population rather than test a causal hypothesis. Covers incidence, prevalence, mortality, drug utilisation and switching, with age-standardisation and joinpoint trend detection built in. The standard output for multi-country comparisons, and the denominator that causal studies depend on.

Assumes

Case ascertainment and denominator definitions are comparable across the sites and periods you compare, and the denominator is built on the same rule as the numerator. No causal interpretation is intended, and none should be written in.

Breaks when

Coding and capture practices differ between databases and the difference is read as a real one; or the denominator is aggregated by a different rule from the outcome, which manufactures a trend that is not there.

Typical example

DDD/1000/day for anticonvulsants across Asian sites, 2010–2023, with joinpoint break detection

Lai ECC, Stang P, Yang YHK, et al. Curr Epidemiol Rep 2015;2:229–238. doi:10.1007/s40471-015-0059-z

Open this template →