PUBH-310 · Lesson 12 of 12 · 22 min

Writing an epidemiological study protocol

▶ Video coming soon A video version of this lesson is on the way.

Eleven months after the occupational health nurse’s email, the Brannock Valley team sat down to assemble the full study protocol. Every decision they had made, from the wording of the question to the handling of recall bias, now had to be written down in a document that an ethics board, three hospital privacy offices, a funder and, eventually, journal reviewers would read. “A protocol is a promise,” Dr. Arkwright said. “It says what we will do before we know what we will find. If we keep the promise, readers can trust the answer, whatever it turns out to be.”

This capstone lesson walks through that protocol section by section. Each section draws on one or more earlier lessons, so the lesson doubles as a review of the course. Read it as a worked example: for each section, ask what decision was made, which lesson justified it, and what could go wrong if the section were missing.

Why write a protocol?

A protocol serves several purposes at once. It forces the team to think through the whole study before starting, when changes are cheap. It is the basis for ethics and data access approval and for funding. It coordinates a team that may change over a multi-year study. And, when registered or published before analysis, it protects against the forking paths described in lesson 1, letting readers distinguish pre-specified analyses from those added later. Trials follow SPIRIT 2025 for protocol content. Observational studies have no single mandatory template, but the team used the structure of SPIRIT where it applied, the HARPER template (a joint protocol template for studies using real-world data developed by international pharmacoepidemiology and outcomes research societies) for the data and analysis sections, and the STROBE checklist (Strengthening the Reporting of Observational Studies in Epidemiology) and its RECORD extension for routinely collected health data to make sure the eventual report could be complete.

Section 1: Title, background and rationale

The title names the design, population, exposure and outcome: “Rotating night-shift work and incident type 2 diabetes among hospital employees: a retrospective cohort study emulating a target trial, with a nested case-control substudy.” The background summarizes the burden of type 2 diabetes, the biological rationale (circadian disruption of glucose metabolism, sleep loss, meal timing), and the existing evidence from the team’s systematic review (lesson 11), including its certainty rating and the main gaps: few studies with new-user designs, inconsistent control for socioeconomic position and little information on absolute risk. The rationale states what this study adds, which is the honest test of the FINER criteria from lesson 1.

Section 2: Objectives and estimands

The primary objective is to estimate the effect of rotating night-shift work, compared with day work only, on the eight-year cumulative incidence of type 2 diabetes among hospital employees aged 25 to 60 without diabetes. The primary estimand is the risk difference and risk ratio comparing those schedules as assigned at the start of follow-up, regardless of later changes (lesson 1). Secondary objectives are to estimate a dose-response relationship with cumulative night shifts, lagged one year (lesson 4); effect modification by sex and age on additive and multiplicative scales (lesson 7); and the proportion of the effect mediated by weight gain, using methods suited to mediation analysis. Each secondary objective is labeled as such, with the warning that subgroup and mediation findings will be interpreted as exploratory.

Section 3: Design and target trial specification

The protocol presents the target trial and its emulation side by side, as in lesson 2: eligibility, treatment strategies, assignment, time zero, follow-up, outcome and causal contrast. It justifies the retrospective cohort design (causal question, exposure not assignable, outcome not rare over eight years, existing records) and the new-schedule design that avoids prevalent-user and healthy worker survivor bias. It explains how time zero is set at the date of a new schedule assignment for each eligible employee, aligning eligibility, exposure assignment and the start of follow-up to prevent immortal time bias. It also describes the nested case-control substudy that collects diet, sleep and second-job information by interview from cases and four risk-set-sampled controls per case.

Section 4: Setting, participants and data sources

This section names the three hospitals, the study window and the data sources: payroll schedule records, human resources records, occupational health check results including annual HbA1c, baseline health questionnaires and linked physician billing records held by a regional health information exchange, accessed under a data use agreement. It lists inclusion and exclusion criteria in operational terms: for example, employees with any diabetes diagnosis or an HbA1c of 6.5 percent or higher before time zero are excluded, and those with gestational diabetes in the year before time zero are excluded because of the high risk of misclassification.

Section 5: Variables and measurement

The measurement plan from lesson 4 becomes a table listing every variable, its definition, source, timing relative to time zero and known validity.

Table 1. Extract from the measurement table of the fictional Brannock protocol.
VariableRoleDefinition and sourceTiming
Rotating night workExposureAt least three shifts ending after 02:00 per month in the assigned schedule (payroll); validated against rosters in a random sample of 200At time zero
Type 2 diabetesOutcomePhysician diagnosis in billing records (validated algorithm) or HbA1c of 6.5 percent or higher confirmed by repeat test at routine annual checkDuring follow-up
Age, sexConfounder / modifierHuman resources recordsAt time zero
Job typeConfounderNurse, care aide, clerical, other (human resources)At time zero
Body mass indexConfounderMost recent measurement before time zero (occupational health)Before time zero only
Family historyOutcome predictor (precision)Baseline questionnaireBefore time zero
Weight gainMediator (secondary analysis only)Change in body mass index at annual checksAfter time zero
Testing frequencyBias checkNumber of HbA1c tests per year (occupational health)During follow-up

Notice the column on timing. It encodes the distinction from lesson 5 between pre-exposure confounders, which are adjusted for, and post-exposure variables such as weight gain, which are reserved for the mediation analysis and must not enter the primary adjustment set. The testing frequency variable addresses the detection bias that Tomás found in lesson 4.

Section 6: Confounding and the causal diagram

The protocol includes the DAG from lesson 5, reproduced here, and states the adjustment set that follows from it.

The Brannock causal diagram. Age has arrows to rotating night shifts, to type 2 diabetes and to job type. Job type has arrows to rotating night shifts and to type 2 diabetes. Family history affects only type 2 diabetes. Rotating night shifts affects weight gain, which affects type 2 diabetes. Both night shifts and diabetes affect the sick leave record after diagnosis. The heading gives the minimal adjustment set for the total effect: age and job type.
Figure 1. The protocol’s causal diagram (from lesson 5), with body mass index before time zero added to the adjustment set as a pre-exposure common cause.

The primary adjustment set is age, sex, job type and pre-exposure body mass index; family history is included for precision. The protocol explains why weight gain and post-diagnosis records are excluded, names socioeconomic factors not captured by job type (household income, second jobs) as plausible unmeasured confounders, and describes how the nested case-control substudy will collect second-job information to examine their influence.

Section 7: Study size

Following lesson 3, the protocol reports the precision and power available from the fixed number of eligible employees, rather than pretending the study size was chosen. With about 900 exposed and 1,500 unexposed employees and an expected eight-year risk of 8 percent among day workers, power is about 87 percent for a risk ratio of 1.5 and about 37 percent for 1.25. The protocol therefore commits to emphasizing estimation with confidence intervals, and states the plan to contribute data to future meta-analyses. For the nested substudy, it calculates that interviewing all cases and four controls per case retains about 80 percent of the efficiency of interviewing the whole cohort, at a fraction of the cost.

Section 8: Statistical analysis plan

The analysis plan is the heart of the protocol and the section most often written too vaguely. The team specified each step:

  • Descriptive analysis: characteristics of exposed and unexposed employees at time zero, with standardized differences to show balance before and after weighting.
  • Primary analysis: eight-year cumulative incidence in each group, estimated with methods that account for censoring at loss to follow-up; standardized risks, risk differences and risk ratios adjusted for the primary adjustment set by standardization over the confounder distribution (the g-formula approach of lesson 6), with confidence intervals by bootstrapping.
  • Stratified check: Mantel-Haenszel risk ratios across job type strata, to show transparently what adjustment does.
  • Effect modification: stratum-specific risk differences and ratios by sex and age group, joint effects against a common reference, and RERI with confidence intervals (lesson 7).
  • Missing data: multiple imputation for missing covariates under a stated missing-at-random assumption, with a complete-case sensitivity analysis.
  • Loss to follow-up: inverse probability of censoring weights based on baseline and time-updated predictors of leaving employment (lesson 8).

Rehearsing the interpretation with mock results

Many protocols include shell tables: the exact tables that will be reported, with empty cells. The team went one step further and filled the shells with mock numbers, invented for rehearsal only, so that everyone agreed in advance how results would be interpreted. The rehearsal below uses those mock numbers; they are not study findings.

Worked problem

Interpreting mock results for the primary analysis

Mock data: 900 night workers with 81 incident cases and 1,500 day workers with 90 cases. By job type, care aides: 500 night workers with 55 cases and 300 day workers with 27 cases; nurses and other staff: 400 night workers with 26 cases and 1,200 day workers with 63 cases. Calculate the crude risk ratio, the stratum-specific risk ratios, the Mantel-Haenszel risk ratio, and the risks standardized to the whole cohort’s job distribution.

Show solution
  1. Crude risks: 81 ÷ 900 = 0.090 and 90 ÷ 1,500 = 0.060. Crude RR = 1.50; crude RD = 3.0 percentage points.
  2. Care aides: 55 ÷ 500 = 0.110 versus 27 ÷ 300 = 0.090, RR = 1.22. Nurses and others: 26 ÷ 400 = 0.065 versus 63 ÷ 1,200 = 0.0525, RR = 1.24. The stratum estimates agree, so pooling is reasonable.
  3. MH RR numerator: (55 × 300 ÷ 800) + (26 × 1,200 ÷ 1,600) = 20.6 + 19.5 = 40.1. Denominator: (27 × 500 ÷ 800) + (63 × 400 ÷ 1,600) = 16.9 + 15.8 = 32.6. RR(MH) = 1.23.
  4. Standardized risks (aides are 800 of 2,400 employees, one third): all night = (1/3 × 0.110) + (2/3 × 0.065) = 0.080; all day = (1/3 × 0.090) + (2/3 × 0.0525) = 0.065. Standardized RR = 1.23; RD = 1.5 percentage points.
  5. E-value for RR 1.23 = 1.23 + √(1.23 × 0.23) = 1.23 + 0.53 = 1.76.

Answer: In this mock scenario, job type confounds the crude association: care aides are both more often on nights and at higher baseline risk. Adjusted, night work is associated with a 23 percent relative increase and 1.5 extra cases per 100 workers over eight years. An unmeasured confounder associated with both night work and diabetes by risk ratios of about 1.8 could explain the estimate away, so the report would discuss whether household income or second jobs plausibly reach that strength. Rehearsing like this shows the team which sentences they will write before they see any real data.

Section 9: Sensitivity analyses and bias analysis

The protocol lists pre-specified sensitivity analyses, each tied to a named threat: restricting the outcome to HbA1c-confirmed cases at routine checks (detection bias, lesson 4); varying the exposure definition to two or five nights per month (exposure misclassification); excluding the first year of follow-up (protopathic bias); probabilistic bias analysis of exposure misclassification using the roster validation substudy (lesson 8); a negative control outcome, injuries from falls on ice on the way to work, which night work should not affect except through commuting at different times and which shares socioeconomic confounders (lesson 5); and E-values for the primary estimates. Listing these in advance means that a reader can see that inconvenient sensitivity analyses were not quietly dropped.

Section 10: Ethics, privacy and governance

The study uses identifiable employment and health records, so it requires approval from an institutional review board operating under the Common Rule (45 CFR 46). Both frameworks permit an ethics board to waive individual consent for secondary use of records when specified conditions are met, such as the research being impracticable without the waiver, appropriate privacy safeguards being in place and the risk to participants being minimal. The protocol argues that these conditions are met for the records component and describes consent procedures for the interview substudy. It describes data minimization, de-identification and secure analysis environments in line with HIPAA and state privacy laws.

Because the study involves employees and their employers, the protocol addresses a specific ethical risk: individual results must never reach managers. The hospitals receive only aggregate findings. The staff association and occupational health committee, engaged since lesson 1, are named as advisers, and the protocol describes how they will review plain-language summaries before release. The team also considered equity: in the Brannock hospitals, night work is more common among care aides, who are paid less than most other clinical staff and include many newcomer workers, so findings could affect workers who already face disadvantage. Results would be reported by job type to inform targeted action.

Section 11: Registration, reporting and dissemination

The protocol will be registered on a public platform before data analysis begins, with a date-stamped analysis plan. Deviations from the protocol will be reported with reasons. The final report will follow STROBE and RECORD and include absolute as well as relative effects, all pre-specified analyses whatever their results, and the summary of findings in plain language for staff. The team committed to sharing analysis code descriptions and aggregate data tables, and to providing study-level data for future meta-analyses.

Section 12: Limitations, timeline and resources

A protocol’s limitations section anticipates the main threats and states what has been done about each, rather than listing generic weaknesses. The team named four: residual confounding by socioeconomic position, partially addressed by the substudy and the E-value; exposure misclassification from payroll codes, addressed by validation and bias analysis; limited power for effect modification, addressed by labeling those analyses exploratory; and generalizability beyond three hospitals in one region, addressed by planned pooling with other cohorts. A timeline (data access in months 1 to 4, cleaning and validation in months 5 to 8, analysis in months 9 to 14, reporting in months 15 to 18) and a budget completed the document.

Reflection: what the protocol shows

Looking back over the protocol, every lesson of the course is visible in it. The question and estimand come from lesson 1; the design and time zero from lesson 2; the precision statement from lesson 3; the measurement table from lesson 4; the DAG and adjustment set from lesson 5; the stratified and standardized analyses from lesson 6; the effect modification plan from lesson 7; the bias analyses from lesson 8; the trial thinking from lesson 9; the warning against launching a screening program without evidence from lesson 10; and the place of the study within the wider evidence from lesson 11. Epidemiologic methods are not a set of separate techniques but a single way of reasoning: define the question, design a fair comparison, measure well, analyze transparently, quantify uncertainty and bias, and report honestly.

Common mistakes

  • MistakeThe analysis plan can say “appropriate statistical methods will be used.”

    InsteadSpecify estimands, models, adjustment sets, missing data methods and sensitivity analyses in enough detail to be reproduced.

  • MistakeClaim that the sample size was chosen to give 80 percent power when it was fixed by available records.

    InsteadReport honestly the precision or power the available sample provides.

  • MistakeList generic limitations such as “possible confounding.”

    InsteadName specific threats and state how each will be addressed or quantified.

  • MistakeDrop sensitivity analyses that give inconvenient results.

    InsteadPre-specify them and report all of them, explaining any deviations from the protocol.

  • MistakeWorkplace studies need only standard privacy protections.

    InsteadProtect employees from disclosure to employers and consider equity effects on disadvantaged groups of workers.

Summary and key terms

  • A protocol commits in advance to the question, design, measurement, analysis and reporting, protecting against selective analysis.
  • SPIRIT 2025 guides trial protocols; observational protocols can draw on templates such as HARPER and plan reporting to STROBE and RECORD.
  • Objectives are stated as estimands; the design specifies the target trial and its emulation with an aligned time zero.
  • Measurement tables record definition, source, timing and validity; the DAG determines the adjustment set.
  • The analysis plan specifies primary, stratified, effect modification, missing data and censoring methods; mock results rehearse interpretation.
  • Sensitivity and bias analyses are tied to named threats and pre-specified.
  • Ethics, privacy, worker protection, equity, registration and dissemination are integral parts of the protocol.
Study protocol
A document specifying a study’s objectives, design, methods, analysis and governance before it begins.
Statistical analysis plan
A detailed, pre-specified description of all planned analyses.
Shell table
A table laid out as it will appear in the report, prepared before results are available.
STROBE
A reporting guideline for observational studies in epidemiology.
RECORD
An extension of STROBE for studies using routinely collected health data.
Sensitivity analysis
A repeated analysis under different assumptions or definitions to test the robustness of results.
Protocol deviation
A change from the registered protocol, which should be reported with reasons.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which earlier lesson justifies excluding weight gain from the primary adjustment set, and why?

    Show answer

    Lesson 5: weight gain after time zero is a mediator on the causal path from night work to diabetes; adjusting for it would remove part of the total effect.

  2. In the mock results, why is the Mantel-Haenszel RR (1.23) lower than the crude RR (1.50)?

    Show answer

    Job type confounds the crude association: care aides are more often on nights and have higher baseline risk. Within job types the association is weaker.

  3. Write a specific limitation statement about exposure misclassification for the Brannock protocol.

    Show answer

    For example: payroll shift codes may misclassify some schedules; we will estimate sensitivity and specificity against detailed rosters in a random sample of 200 employees and use probabilistic bias analysis to correct the primary estimate.

  4. Why is a negative control outcome included in the sensitivity analyses?

    Show answer

    If night work appears to affect an outcome it should not cause but which shares its confounders, residual confounding (for example, by socioeconomic position) is likely affecting the main result too.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz