Session 6 · Analyse: from sample to answer

Foundations of Clinical Research: From Clinical Question to Publication

Vương Mỹ Lượng & Bernard Osang’ir

Neudata Consulting Ltd

Session 6 · Analyse: from sample to answer

Part 1

Week 6 · Saturday

  • Recap quiz on Session 5 (10 min)
  • 6.1 From sample to population: CI, p-value, one- or two-sided, power, sample size, choosing a test
  • 6.2 Compare groups in the course dataset (live R demo)
  • 6.3 Relationships and models: regression, Kaplan-Meier and Cox
  • 6.4 Model the course dataset: adjusted OR, Cox HR, missing data, the SAP
  • Proposal builder 6: sample size, analysis plan, missing-data plan

Recap quiz: Session 5 in three questions

QUICK QUIZ · 10 min

  • Q1. ICU length of stay in 300 patients is right-skewed. Which summary goes in Table 1?
  • Q2. A CRF item reads ‘Lactate: ____’. Name two things missing.
  • Q3. In the raw FLUID-ICU data, one age was 210. Which check catches it, and what goes in the cleaning log?

Recap quiz: answers

Q1. ICU stay

  • Median (IQR)
  • The data are skewed

Q2. Lactate item

  • The unit (mmol/L)
  • The time point
  • A ‘not done’ option

Q3. Age 210

  • A range check
  • Log: ID, value, correction, reason, who and when

KEY MESSAGE Skewed: median (IQR). Every CRF item needs a unit and a time. Every correction goes in the log.

6.1 From sample to population, without fear

We study a few patients to learn about many.

6.1 From sample to population | 40 minutes

Sample and population

Population: all adults with septic shock
(true mortality unknown)
Sample: our 40 patients
12 died = 30%
we study
a sample
Estimate
30%
95% CI 17% to 47%
...and infer back to
the population, with
honest uncertainty

KEY MESSAGE A sample gives an estimate. The CI says how precise it is.

The dance of the confidence intervals

-10
0
10
20
30
40
50
60
95% CI contains the truth (19)
95% CI misses it (1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
20 repeats of the same study (25 patients each, simulated)
Fluid balance (ml/kg)
true value
(unknown in
real life)

KEY MESSAGE About 95 of 100 such intervals capture the truth. We never know which ones.

The p-value in one picture

Your test statistic
(from your data)
Test statistics you
would get by chance
if H0 is true
(no difference)
orange area = p = 0.04:
at least as extreme
as yours, either side
A better
0 = no difference
B better
1
Assume H0 is true: no
difference between the groups
2
Compute the test statistic
from your data (e.g. t or
chi-square)
3
p = probability of a test
statistic at least as extreme
as yours, if H0 is true

KEY MESSAGE p = the probability of a test statistic at least as extreme as yours, if H0 is true (no difference).

One-sided or two-sided test?

H0 (null hypothesis): no difference. H1 (alternative hypothesis): there is a difference. The direction of H1 decides which tails count.

Two-sided (the default)
H1: the groups differ, either way
p = 0.02 + 0.02 = 0.04
One-sided (planned in advance)
H1: B is better (one direction only)
p = 0.02
Same data, same test statistic (red line). Orange = the p-value.
What changes
With the same data, the one-sided p is half the two-sided p
So a one-sided test has more power
Use it when there is a good reason to expect only one direction, and say so in the protocol or SAP before the data are seen
Two-sided is the default in most trials and journals

KEY MESSAGE Same data: the one-sided p is half the two-sided p. Use one-sided only when planned in advance, with a reason.

Five common p-value mistakes

Each of these sentences appears in published papers. All are wrong. (H0 = the null hypothesis: no difference.)

‘Chance of H0’

  • p is not the chance that the intervention has no effect

‘Big effect’

  • A small p is not a big or important effect

‘Not effective’

  • p > 0.05 does not prove the intervention is not effective

‘A trend’

  • p = 0.08 is not ‘almost significant’

‘Only p’

  • p alone is not enough
  • Give the effect and its 95% CI

KEY MESSAGE Report the effect size with its 95% confidence interval. The p-value is a supporting actor.

Check your understanding: CI and p-value

QUICK QUIZ · 3 min

  • ‘Hazard ratio (HR) 2.13, 95% confidence interval (CI) 1.48 to 3.06’: the data are compatible with a true HR from about 1.5 to 3.1. True or false?
  • ‘p = 0.42, so the two strategies are equivalent.’ True or false?
  • ‘p = 0.03 means a 3% chance that there is no effect.’ True or false?
  • ‘A larger study usually gives a narrower CI.’ True or false?

Answers: CI and p-value

Statement 1: true

  • The 95% CI is the range of plausible values for the true HR

Statement 2: false

  • Absence of evidence is not evidence of absence: we do not know

Statement 3: false

  • p assumes there is no effect, so it cannot be the chance of no effect

Statement 4: true

  • More patients give a more precise estimate, a narrower CI

KEY MESSAGE Read the 95% confidence interval first. p never tells you the chance that there is no effect.

Type I and type II errors: the fire alarm

There is a fire (real effect) No fire (no real effect)
Alarm rings (p < 0.05, ‘significant’) Correct alarm: power (aim for 80-90%)
Alarm silent (p of 0.05 or more) Missed fire: type II error (beta)

Alpha = risk of a false alarm. Power = chance of detecting a real effect. A less sensitive alarm (smaller alpha) gives fewer false alarms but more missed fires, unless you buy a better alarm: more patients.

Alpha, beta and sample size in one picture

A. Usual design:
alpha 5%
no effect
real effect
alpha 5% (two-sided)
beta 20%, power 80%
B. Smaller alpha (1%):
the line moves right
no effect
real effect
alpha 1% (two-sided)
beta 41%, power 59%
C. Twice the patients:
narrower curves, alpha 5%
no effect
real effect
alpha 5% (two-sided)
beta 2%, power 98%
Orange = alpha (right tail shown): a false alarm when there is no effect. Red = beta: a real effect missed. Dashed line: where a result becomes 'significant'.

KEY MESSAGE A smaller alpha costs power. More patients buy it back.

Sample size: bigger effect, less variability = fewer patients

0
50
100
150
200
250
10
20
30
40
50
60
Difference we want to detect (ml/kg)
SD (standard deviation) = how much patients vary around the average
Patients needed
per group
high variability (SD 50)
medium variability (SD 35)
low variability (SD 20)
Trial example: 70 vs 40 ml/kg (difference 30),
SD 35: 22 patients per group
power 80%, alpha 5% (two-sided)

KEY MESSAGE Sample size depends on the effect you hope to detect and on how much patients vary (SD).

Three questions choose the test

What kind of outcome?
A number: what shape?
Separate groups or paired?
A number
e.g. ICU days
Yes or no
e.g. died
Number: t-test or Wilcoxon
Yes/no: Chi-square or Fisher
Roughly
symmetric
Skewed
(long tail)
Symmetric: t-test
Skewed or small sample: Wilcoxon
Two different
groups of
patients
before
after
The same
patients,
measured twice
Separate: the usual tests
Paired: paired t-test, signed-rank, McNemar

KEY MESSAGE Outcome type, then shape (or counts), then separate or paired: these three answers give the test.

Choosing a test: the decision tree

Two separate groups
Paired (reference)
Outcome
A number
Yes / no
Roughly symmetric
t-test
Paired t-test
Skewed, or small sample
Wilcoxon rank-sum
(Mann-Whitney U)
Wilcoxon signed-rank
Expected counts 5 or more
Chi-square
McNemar
Small counts (under 5)
Fisher's exact test
McNemar

KEY MESSAGE We use the ‘two separate groups’ column in this course. The paired tests are for reference.

Paired or unpaired? Same patients or different patients

0
2
4
6
8
10
Admission
6 hours
Lactate, mmol/L
0
2
4
6
8
10
Admission
6 hours
Lactate, mmol/L
Seen as two separate groups
Seen as the same patients
Unpaired t-test: p = 0.20
Looks like no clear change
Paired t-test: p < 0.001
Lactate fell in 20 of 20 patients

KEY MESSAGE Same patients measured twice = paired test. Different patients = unpaired.

Multiple comparisons: the jelly-bean problem

What to do

  • Follow the analysis plan (SAP) written before seeing the data
  • Pre-specify one primary outcome
  • Label the rest as exploratory
  • Adjust, e.g. Bonferroni: 0.05 / number of tests
  • Report every test you ran
0.0
0.2
0.4
0.6
0.8
1.0
p = 0.05
1
5
10
15
20
20 jelly-bean colours tested (no real effect, simulated)
p-value
Colour 10: p = 0.03
'Green jelly beans cause acne!'

KEY MESSAGE Test 20 things and one will be ‘significant’ by chance alone.

Check your understanding: which test?

QUICK QUIZ · 3 min

  • Compare ICU stay (skewed) between two different groups: patients with a positive and with a negative fluid balance
  • Compare 28-day death (yes/no) between two different groups of 300 patients each
  • Compare lactate at admission and 6 hours later in the same 40 patients
  • Compare dialysis (yes/no) between two different groups: 2 of 24 vs 5 of 24 patients

Choose

  • t-test
  • Paired t-test
  • Wilcoxon rank-sum (Mann-Whitney U)
  • Chi-square
  • Fisher’s exact test

Answers: which test?

Scenario 1: Wilcoxon rank-sum

  • (Mann-Whitney U)
  • ICU stay is skewed
  • Two independent groups

Scenario 2: chi-square

  • Yes/no outcome
  • Two independent groups
  • Large counts

Scenario 3: paired t-test

  • The same 40 patients measured twice
  • Lactate roughly symmetric

Scenario 4: Fisher’s exact

  • Yes/no outcome
  • Two independent groups
  • Expected count 24 x 7 / 48 = 3.5, under 5

KEY MESSAGE Outcome type, shape or counts, paired or not: three questions choose the test.

6.2 Compare groups in the course dataset

Choose the test from the outcome, then report the effect size and its 95% confidence interval.

6.2 Compare groups in the course dataset | 20 minutes

Live demo: comparing two groups in R

LIVE DEMO · 6 min

  • Open 03_compare.R
  • Age (symmetric): t-test
  • SOFA and lactate (skewed): Wilcoxon rank-sum (Mann-Whitney)
  • 28-day death (yes/no): 2x2 table and chi-square
  • The common mistake: a t-test on skewed ICU stay

Decision tree

  • Number or category?
  • Symmetric or skewed?
  • Paired or not?
  • Effect + 95% CI

FLUID-ICU: four outcomes, four comparisons

Outcome (type) Negative balance (n = 245) Positive balance (n = 373) Test Result
28-day death (yes/no) 45 (18.4%) 134 (35.9%) Chi-square Risk difference 17.6 points (95% CI 10.7 to 24.4), p < 0.001
Acute kidney injury (yes/no) 71 (29.0%) 230 (61.7%) Chi-square Risk difference 32.7 points (95% CI 25.2 to 40.2), p < 0.001
Ventilator-free days (0-28, skewed) Median 28 (22 to 28) Median 20 (0 to 28) Wilcoxon rank-sum Difference* -3.0 days (95% CI -5.0 to 0.0), p < 0.001
ICU stay in survivors (days, skewed) 4.8 (3.3 to 7.1), n = 200 7.5 (5.2 to 11.2), n = 239 Wilcoxon rank-sum Difference* 2.5 days (95% CI 1.8 to 3.2), p < 0.001

n (%) or median (IQR). Positive minus negative group. *Hodges-Lehmann difference: the median of all differences between a patient of one group and a patient of the other, not the difference between the two medians. All from 03_compare.R.

Worked example: reading the mortality comparison

Question 1 (Q1) of the five FLUID-ICU questions: positive vs negative fluid balance by day 3, before adjusting for confounders.

Risks

  • Positive: 134/373 = 35.9%
  • Negative: 45/245 = 18.4%

Difference

  • 17.6 percentage points
  • 95% CI 10.7 to 24.4

Ratio

  • Risk ratio (RR) 1.96
  • About twice the risk

Test

  • Chi-square, p < 0.001

But…

  • Not adjusted for confounders: the positive group was sicker

KEY MESSAGE Report the effect and its CI. Then ask what else could explain it.

Exercise 4: interpret the comparison (Q1)

WHOLE-CLASS TASK · 7 min

  • Q1, 28-day death: Table 2 of the Q1 results pack (exercise sheet, Exercise 4)
  • Which test, the effect with its 95% CI, and one reason the comparison could be biased

Avoid

  • p-value alone
  • ‘proves’, ‘causes’
  • ‘trend’ for p > 0.05
  • Forgetting the n

OUTPUT Work alone (3 min): fill in Exercise 4 for Q1 and write one Results sentence

Exercise 4: answers (Q1)

Test

  • Chi-square
  • Yes/no outcome
  • Two independent groups

Effect with 95% CI

  • Risk difference 17.6 points (95% CI 10.7 to 24.4)
  • Risk ratio 1.96, p < 0.001

Why it may be biased

  • Confounding by indication: sicker patients got more fluid and died more

KEY MESSAGE ‘Mortality was 35.9% with a positive and 18.4% with a negative balance (risk difference 17.6 points, 95% CI 10.7 to 24.4).’

Break

15 min

6.3 Relationships and models (concepts)

You do not need to run a model to read one.

6.3 Relationships and models | 35 minutes

Correlation: how closely two numbers move together

r = 0.89
strong positive
r = 0.49
moderate positive
r = -0.01
no linear link
r = -0.71
negative
r = 0.03
curved: r near 0,
but a strong link!
r goes from -1 (perfect negative line) through 0 (no straight-line link) to +1 (perfect positive line)

KEY MESSAGE r measures linear association, from -1 to +1. Always look at the plot.

Linear regression: the model and how to read it

You do not need to fit it. You need to know what each number means.

When to use it

  • The outcome is a number, e.g. PaO2/FiO2 ratio, ICU days
  • Exposure: a number or a group

What the model looks like

  • Outcome = a + B x exposure
  • Adjusted: + B2 x confounder 2 …
  • A straight line through the data

Its parameters

  • a (intercept): outcome when exposure = 0
  • B (slope): change in outcome per 1 unit of exposure

How to read B

  • B = -15 per litre: each extra litre, the ratio is 15 points lower
  • No effect: B = 0. Does the CI include 0?

KEY MESSAGE Linear regression gives a difference (B) per unit of exposure, with its 95% CI. No effect = 0.

Linear regression: the best straight line

50
100
150
200
250
300
350
400
-2
0
2
4
6
8
Cumulative fluid balance on day 3 (L), simulated
PaO2/FiO2 ratio
intercept = 292
expected value when
fluid balance = 0
+2 L
slope = -15 per litre
(the coefficient B in the table)
R² = 0.59: the line explains
about 59% of the variation

KEY MESSAGE Slope = change in the outcome per unit of exposure. R² = how much the line explains.

Logistic regression: the model and how to read it

Odds = probability / (1 - probability). A 20% risk is odds of 0.25.

When to use it

  • The outcome is yes or no, e.g. died by day 28, AKI
  • Exposure: a number or a group

What the model looks like

  • log(odds) = a + B x exposure
  • Adjusted: + B2 x confounder 2 …
  • Gives an S-shaped curve of risk

Its parameters

  • B: change in log-odds per unit
  • OR = e to the power B
  • Papers report the OR, not B

How to read the OR

  • OR 1.42 per mmol/L: odds of death 1.42 times higher per extra mmol/L
  • No effect: OR = 1. Does the CI include 1?

KEY MESSAGE Logistic regression gives an odds ratio (OR) per unit of exposure, with its 95% CI. No effect = 1.

Logistic regression: an S-curve for yes/no outcomes

0%
25%
50%
75%
100%
0
2
4
6
8
10
12
14
Lactate at ICU admission (mmol/L), simulated
Probability of
death by day 28
9%
29%
62%
died
survived
OR 1.42: each extra 1 mmol/L
multiplies the odds of death by 1.42
Odds = probability / (1 - probability)
2 mmol/L: 9%, odds 0.10
6 mmol/L: odds 0.10 x 1.42⁴ = 0.40, so 29%

KEY MESSAGE Logistic regression turns a yes/no outcome into an odds ratio per unit of exposure.

Which model? It depends on the outcome

Your outcome is… Model The paper reports ‘No effect’ value
A number, e.g. fluid balance (ml/kg) Linear regression Coefficient (B): how much the outcome changes per unit of exposure (or the difference between groups) 0
Yes / no, e.g. died by day 28 Logistic regression Odds ratio (OR) 1
Time to event, e.g. time to death Cox regression Hazard ratio (HR) 1

The outcome type tells you the model and the number to read.

What ‘adjusted’ means: compare like with like

Death at day 28 (simulated numbers)
Adjusted = compare like with like
All patients (crude)
33%
n=200
High fluid
18%
n=200
Low fluid
Less sick
10%
n=50
High fluid
10%
n=150
Low fluid
Sicker
40%
n=150
High fluid
40%
n=50
Low fluid
Death 33% vs 18%: fluid looks harmful
Within each severity level: NO difference

KEY MESSAGE Adjusting = comparing patients who are alike on the confounders.

Reading a regression table, row by row

Mock study of 600 ICU patients. One logistic regression model for death by day 28 with all five variables in it at once.

Variable Adjusted OR 95% CI p-value Does the CI include 1?
Positive fluid balance (yes vs no) 1.80 1.20 to 2.70 0.004 No
Age (per 10 years) 1.25 1.10 to 1.42 < 0.001 No
SOFA score (per 1 point) 1.15 1.08 to 1.23 < 0.001 No
Female (vs male) 0.92 0.65 to 1.30 0.64 Yes: compatible with no effect
Lactate (per 1 mmol/L) 1.10 0.98 to 1.24 0.11 Yes: compatible with no effect

Row 1 is the exposure of interest. Rows 2 to 5 are the confounders it is adjusted for. Each OR is adjusted for all the other rows. Read each row: comparison, effect, 95% CI, does the CI include 1?

Check your understanding: read the regression table

QUICK QUIZ · 4 min

  • Go back to the regression table on the previous slide
  • What does ‘OR 1.15 per SOFA point’ mean?
  • Interpret the result for positive fluid balance
  • Extra practice at home: Exercises 5 and 6 of the exercise sheet

The 4-step reading

  • What is compared?
  • How big is the effect?
  • How wide is the CI?
  • Does it cross 1 (or 0)?

Answers: read the regression table

OR 1.15 per SOFA point

  • Each extra point: odds of death 1.15 times higher, adjusted
  • Not ‘15% more deaths’

Positive fluid balance

  • After adjustment, about 1.8 times the odds of death by day 28 (OR 1.80, 95% CI 1.20 to 2.70)

KEY MESSAGE Say ‘odds’, say ‘associated with’, and always give the 95% CI.

Overfitting: too many variables for too few events

Why it matters

  • The model learns the noise of these patients
  • It takes chance patterns for real effects: effects look bigger, and CIs narrower, than they are
  • It fails on new patients
  • Flexible models, such as AI, overfit most easily
your 10 patients
new patients
overfitted model
simple model
Rule of thumb: about 10 events per variable
80 deaths: no more than about 8 variables in the model

KEY MESSAGE Plan about 10 events per variable. Choose variables in advance for clinical and biological reasons.

Survival analysis starts with censoring

0
7
14
21
28
Days since ICU admission
Patient
1
2
3
4
5
6
7
8
9
10
died on day 5 = event
lost to follow-up on day 12:
alive until then = censored
alive at day 28, study ends:
censored

KEY MESSAGE Censored patients still count: they tell us they survived up to that day.

Kaplan-Meier and the log-rank test: what they are

Kaplan-Meier is not a model. It describes survival over time, using every patient, censored ones included.

How the curve is built

  • At 100% on day 0
  • At each death it drops by the share who died among those still followed

Censored patients

  • Leave the count on their last day
  • They are not deaths
  • Shown as small ticks

What you read

  • Probability of being alive on any day, e.g. day 28
  • Median survival if it falls below 50%

Log-rank test

  • H0: the two groups have the same survival over time
  • Gives a p-value only, no effect size

KEY MESSAGE Kaplan-Meier shows survival over time. The log-rank test asks whether two curves differ. Neither adjusts for confounders.

How to read a Kaplan-Meier curve

0%
25%
50%
75%
100%
0
7
14
21
28
Days since ICU admission
Probability of being alive
Simulated cohort
(150 per group)
Negative balance
Positive balance
log-rank test: p = 0.040
(are the two curves different?)
Number at risk
Negative balance
150
137
119
100
88
Positive balance
150
127
107
85
73
1
Each step down = one
or more deaths that day
2
Each tick = a
censored patient
3
Gap between curves
= difference in survival
4
Numbers at risk shrink:
the right end is less certain

KEY MESSAGE Read the steps, the ticks, the gap, and always the numbers at risk.

Cox regression: the model and how to read it

Hazard = the chance of the event at a given moment, among patients still at risk.

When to use it

  • Time-to-event outcome, e.g. time to death, with censoring
  • To compare groups and adjust

What the model looks like

  • hazard(t) = baseline hazard(t) x e to the power (B x exposure + …)
  • The baseline need not be specified

Its parameters

  • B per variable
  • HR = e to the power B
  • Papers report the HR

How to read the HR

  • HR 1.46: the death rate is about 1.5 times higher at any moment
  • No effect: HR = 1. Does the CI include 1?

KEY MESSAGE Cox regression gives a hazard ratio (HR), adjusted if confounders are added. It assumes the HR stays the same over time.

6.4 Model the course dataset

Adjust for what you planned, read the 95% confidence interval, and be honest about missing data.

6.4 Model the course dataset | 25 minutes

The SAP came first

The statistical analysis plan (SAP) was signed before the database was locked, i.e. before anyone looked at the data.

Primary outcome and analysis

  • 28-day death
  • Logistic regression, odds ratio (OR)

Confounders

  • Age, SOFA, lactate
  • Vasopressor, ventilation
  • Chronic kidney disease

Supportive

  • Kaplan-Meier and log-rank test
  • Cox hazard ratio (HR)

Subgroup

  • One pre-specified: heart failure (yes/no)

Missing data

  • Complete-case analysis
  • Multiple imputation

KEY MESSAGE All these choices were written down before anyone saw the results.

Confounding by indication, made visible

Confounding by indication: sicker patients are given more fluid (their illness is the reason, the ‘indication’, for the fluid), and sicker patients also die more.

0.8
1
1.5
2
3
4
Odds ratio for 28-day death, positive vs negative balance (log scale)
Crude, all 618 patients
with a day-3 balance
2.49 (1.70 to 3.70)
Crude, only the 527 with
complete data on confounders
2.22 (1.48 to 3.39)
Adjusted for the 6 SAP
confounders (same 527)
1.62 (1.02 to 2.59)
confounding
by indication

KEY MESSAGE Crude OR 2.49 shrinks to 1.62 after adjusting for the six confounders: still above 1.

The adjusted model, as a forest plot (one model, all rows together)

0.5
1
2
4
Adjusted odds ratio for 28-day death (log scale)
Positive fluid balance
1.62 (1.02 to 2.59)
Age (per year)
1.02 (1.01 to 1.04)
SOFA (per point)
1.10 (1.01 to 1.21)
Lactate (per mmol/L)
1.15 (1.00 to 1.32)
Vasopressor
1.86 (1.20 to 2.88)
Mechanical ventilation
1.69 (1.11 to 2.60)
Chronic kidney disease
1.85 (1.00 to 3.44)

KEY MESSAGE Read each row: comparison, OR, 95% CI, does it cross 1?

Kaplan-Meier: survival to day 28 by fluid balance

50%
60%
70%
80%
90%
100%
0
7
14
21
28
Days since ICU admission
Probability of being alive
82%
64%
Negative balance
Positive balance
Log-rank test: p < 0.001
Shaded band = 95% CI of each curve. No ticks: nobody was lost before day 28,
so all survivors are censored at day 28
Number at risk
Negative balance
245
218
209
205
200
Positive balance
373
297
259
251
239

KEY MESSAGE Day-28 survival 81.6% vs 64.1%, log-rank p < 0.001: unadjusted.

Cox model: the same story in hazard ratios

The Cox model (6.3) applied to Q1, as a supportive analysis (04_models.R). HR = hazard ratio. OR = odds ratio.

Crude HR

  • 2.17
  • 95% CI 1.55 to 3.05

Adjusted HR

  • 1.46
  • 95% CI 1.00 to 2.13
  • p = 0.053

Compare

  • Adjusted OR 1.62, p = 0.044
  • Adjusted HR 1.46, p = 0.053
  • Same direction and size

KEY MESSAGE OR 1.62 and HR 1.46 point the same way with similar CIs. One p is just below 0.05, one just above: same conclusion.

RR, OR and HR: what each means and when you meet it

All three compare two groups. 1 = no difference. Above 1: more events. Below 1: fewer.

Risk ratio (RR)

  • Risk in one group / risk in the other
  • Design: trials and cohorts
  • Analysis: a 2x2 table

Odds ratio (OR)

  • Odds in one group / odds in the other
  • Design: case-control studies. Analysis: logistic regression
  • Close to the RR when the outcome is rare

Hazard ratio (HR)

  • Event rate over time, one group vs the other
  • Design: trials and cohorts with follow-up
  • Analysis: Cox regression

KEY MESSAGE The outcome and the design decide the ratio: risk (RR), odds (OR) or rate over time (HR).

Missing data: three reasons values go missing (MCAR, MAR, MNAR)

MCAR: Missing Completely At Random
Night
adm.
Lactate
Died
no
2.1
no
yes
?
no
no
6.8
yes
no
?
no
yes
4.2
no
no
9.1
yes
yes
2.6
no
no
7.5
yes
Tube dropped, analyser down:
unrelated to anything
Complete-case analysis is
unbiased (just less precise)
MAR: Missing At Random
Night
adm.
Lactate
Died
no
2.1
no
yes
?
no
no
6.8
yes
no
1.8
no
yes
?
no
no
9.1
yes
yes
?
no
no
7.5
yes
Night admissions skipped: missing
depends on a variable we recorded
Fixable: multiple imputation
using the recorded variable
MNAR: Missing Not At Random
Night
adm.
Lactate
Died
no
2.1
no
yes
3.4
no
no
?
(6.8)
yes
no
1.8
no
yes
4.2
no
no
?
(9.1)
yes
yes
2.6
no
no
?
(7.5)
yes
Highest values missing (sickest
patients, off-scale results)
No guaranteed fix:
sensitivity analysis

KEY MESSAGE The reason data are missing decides how dangerous the gaps are.

Who is missing lactate? Not a random 15%

0
10
20
30
40
36%
(n = 112)
18%
(n = 223)
6%
(n = 204)
1%
(n = 81)
0-4
5-7
8-10
11+
SOFA score on admission (less sick → sicker)
Lactate missing (%)

KEY MESSAGE Lactate was missing mostly in less sick patients: not MCAR, but MAR is plausible.

Complete case vs multiple imputation (Q4)

1
1.2
1.4
1.6
OR for 28-day death per 1 mmol/L lactate
Unadjusted: complete case (n = 527)
1.38 (1.23 to 1.55)
Unadjusted: multiple imputation (n = 620)
1.44 (1.28 to 1.61)
Age, sex, comorbidity: complete case (n = 527)
1.39 (1.24 to 1.57)
Age, sex, comorbidity: multiple imputation (n = 620)
1.45 (1.29 to 1.64)
Same + SOFA: complete case (n = 527)
1.21 (1.05 to 1.39)
Same + SOFA: multiple imputation (n = 620)
1.23 (1.07 to 1.42)

KEY MESSAGE Multiple imputation keeps all 620 patients. The answer changes only modestly.

Exercise 8: interpret the model (Q1)

WHOLE-CLASS TASK · 7 min

  • Q1, 28-day death: crude and adjusted OR, 95% CI and n in Table 6 of the Q1 results pack (Table 3 has the same ORs). Exercise sheet, Exercise 8
  • How much did adjustment change the estimate, and does the adjusted 95% CI include 1?

Words to use

  • ‘associated with’
  • ‘after adjustment for’
  • ‘95% CI’
  • not ‘caused’

OUTPUT Work alone (3 min): fill in Exercise 8, Part A for Q1 and write two Results sentences

Exercise 8: answers (Q1)

Crude

  • OR 2.49 (95% CI 1.70 to 3.70)
  • n = 618
  • Table 6 of the Q1 pack

Adjusted for the 6 SAP confounders

  • OR 1.62 (95% CI 1.02 to 2.59)
  • n = 527 complete cases
  • The CI does not include 1

Why it shrank

  • Confounding by indication: sicker patients got more fluid and died more

Part B

  • Multiple imputation
  • OR 1.70 (95% CI 1.09 to 2.64)
  • n = 620, same conclusion

KEY MESSAGE ‘After adjustment, a positive balance was associated with higher odds of death by day 28 (OR 1.62, 95% CI 1.02 to 2.59).’

Proposal builder 6: what a good one contains

Modelled on the running example (a restrictive fluids trial).

Sample size

  • Mortality 40% vs 30%
  • Power 80%, alpha 5% two-sided
  • 356 per group, 396 allowing for 10% loss

Analysis plan

  • Describe: n (%), median (IQR)
  • Compare: chi-square
  • Report: RR with 95% CI

Confounders

  • Chosen in advance
  • About 10 events per variable

Missing data

  • Expected gaps and why
  • Prevention
  • How it will be reported

KEY MESSAGE Today: how many patients, which analysis, and what if data are missing.

Proposal builder 6: sample size and analysis plan

PROPOSAL BUILDER · 30 min

  • Proposal Part 3: sample size, analysis plan, confounders, missing-data plan (exercise sheet, Exercise 9)

Use these tools

  • Sample-size spreadsheet
  • Test decision tree (6.1)
  • FLUID-ICU SAP as a model
  • Exercise sheet: Exercise 9

OUTPUT Work alone (10 min): write the sample-size inputs for your own study and their sources (finish Part 3 at home)

Key words of the day

Twelve words you should now be able to explain to a colleague.

Uncertainty

  • 95% CI
  • p-value (two-sided)
  • Power

Comparing

  • t-test / Wilcoxon rank-sum
  • Chi-square
  • Paired

Models

  • Adjusted OR
  • Hazard ratio
  • Censoring

Honesty

  • SAP
  • MCAR / MAR / MNAR
  • Multiple imputation

KEY MESSAGE If one word is unclear, ask now or look it up in the glossary.

Session 6 recap

Three messages to take home.

Read the CI

  • Effect + 95% CI
  • Where is the null?
  • p is a supporting actor

Adjust honestly

  • Crude vs adjusted
  • Confounders chosen in advance

Plan first

  • SAP before the data
  • Two-sided tests
  • Missing data: report, handle, test

KEY MESSAGE A good analysis is planned before, adjusted honestly and read through its CI.

Your second product: the Results section

You received the manuscript brief before this session. Tell us now which FLUID-ICU question (Q1 to Q5) you have chosen.

Required

  • The Results section for your question
  • All the results in your pack: every table and figure
  • A working title

Taught, not written

  • Methods, Introduction
  • Discussion, Abstract
  • Taught in Sessions 7 and 8 for reading and later papers

When

  • Session 7: write your Results in class
  • Session 8: check and complete it
  • Due 23:59, Sunday 20 December

KEY MESSAGE Tell the instructor your question now, in the chat or by email.

Wrap-up and homework

DISCUSSION · 5 min

  • Exit question in the chat: in one sentence, what does ‘95% CI 1.48 to 3.06’ tell you?
  • Homework: finish Part 3 of your own proposal. Start your proposal slides (everyone submits them)
  • Read the results pack of the question you chose

Weeks 7-8

  • Protocol, ethics, registration
  • Research integrity
  • Writing the paper, your Results
  • Getting published
  • Volunteer presentations

OUTPUT Exit answer in the chat. Part 3 complete

Extra slides: Session 6

Extra slides: use if time allows, or for self-study.

Interaction, null values, prediction and machine learning, missing-data details

Extra: the pre-specified interaction with heart failure (Q1)

0.5
1
2
4
8
16
Adjusted OR for 28-day death, positive vs negative balance (log scale)
No heart failure
(n = 437)
1.29 (0.77 to 2.19)
Heart failure
(n = 90)
4.39 (1.65 to 12.38)
p for interaction = 0.031

KEY MESSAGE Stronger association in heart failure (p for interaction 0.031): needs confirmation.

Extra: AKI rises with fluid balance (Q2)

0
20
40
60
80
100
AKI 29%
AKI 54%
AKI 63%
AKI 75%
≤ 0
(n = 245)
> 0 to 20
(n = 166)
> 20 to 40
(n = 130)
> 40
(n = 77)
Cumulative fluid balance at day 3 (ml/kg)
% of patients
AKI (KDIGO)
No AKI
Stage 1
Stage 2
Stage 3

KEY MESSAGE A dose-response gradient: 29%, 54%, 63%, 75% AKI across balance groups.

Extra: ventilator-free days, a tricky outcome (Q3)

0
20
40
60
80
100
120
140
0
7
14
21
28
Negative balance (n = 245)
median 28
0
20
40
60
80
100
120
140
0
7
14
21
28
Positive balance (n = 373)
median 20
Number of patients
Ventilator-free days to day 28
(0 = died or ventilated all 28 days, 28 = never ventilated)

KEY MESSAGE Piled up at 0 and 28: report medians and use non-parametric tests.

Extra: Reading a 95% CI in a real paper

Paper 1 (Boulet 2024, pilot RCT), primary outcome: cumulative fluid balance at day 5.

The result

  • Median 6.9 vs 35.0 ml/kg
  • Mean difference 13.2 ml/kg
  • 95% CI -15.2 to 41.6
  • p = 0.42

Where is 0?

  • 0 = no difference
  • The CI includes 0
  • So ‘no difference’ is compatible with the data

How wide?

  • From 15 ml/kg in one direction to 42 ml/kg in the other
  • Very imprecise: only 48 patients

KEY MESSAGE ‘Not significant’ with a wide CI means ‘we do not know’, not ‘no effect’.

Extra: the running example in one forest plot

0.5
1
2
4
Hazard ratio for 28-day death (log scale)
Positive vs negative
fluid balance by...
HR (95% CI)
p
Left of 1: lower risk
Right of 1: higher risk
Paper 2 (Hyun 2023): positive vs negative cumulative fluid balance, propensity-matched cohorts
Day 1 (483 pairs)
1.17 (0.85-1.60)
0.354
Day 2 (373 pairs)
2.13 (1.48-3.06)
< 0.001
Day 3 (392 pairs)
1.56 (1.10-2.22)
0.012

KEY MESSAGE Day 1: CI crosses 1. Days 2 and 3: CIs above 1, so higher risk.

Extra: Log-rank, Cox and proportional hazards

Three terms you will meet in every survival paper. KM = Kaplan-Meier. HR = hazard ratio.

Log-rank test

  • Compares whole KM curves
  • Gives a p-value
  • No effect size, no adjustment

Cox regression

  • Gives an HR with its 95% CI
  • No effect = 1
  • Can adjust for confounders

Proportional hazards

  • Assumes the HR is constant over time
  • Crossing curves: be careful

KEY MESSAGE Paper 2 (Hyun 2023): Cox HR 2.13 (1.48-3.06), about double the hazard of death.

Extra: Correlation is not agreement, and not causation

0
2
4
6
8
10
0
2
4
6
8
10
perfect
agreement
Lactate, main lab (mmol/L)
Lactate, bedside
device (mmol/L)
r = 0.98: the two methods rise and fall together
No agreement: the device reads ~0.9 lower (check with Bland-Altman)
0
2
4
6
0
5
10
15
Fluid given on day 1 (L)
ICU stay (days)
r = 0.85 overall, ~0 within each group
Correlation is not causation (severity drives both)
less sick
moderate
very sick

KEY MESSAGE High r does not mean two methods agree, nor that one causes the other.

Extra: Interaction in a model: does the effect differ between groups?

0
20
40
60
-2
0
2
4
6
8
Fluid balance (L)
28-day
mortality (%)
No interaction: parallel lines
Same fluid effect in both groups:
one adjusted estimate is enough
no ARDS
ARDS
0
20
40
60
-2
0
2
4
6
8
Fluid balance (L)
28-day
mortality (%)
Interaction: different slopes
Effect depends on ARDS: report it per group
(pre-specified interaction term)
no ARDS
ARDS
Illustrative lines

KEY MESSAGE Parallel lines: adjust. Different slopes: report the effect for each group.

Extra: The ‘no effect’ line: 0 for differences, 1 for ratios

-40
-20
0
20
40
60
0.5
1
2
4
Difference in fluid balance (ml/kg)
Difference: no effect = 0
Paper 1: mean difference 13.2 (95% CI -15.2 to 41.6)
p = 0.42: CI crosses 0, so not significant
Hazard ratio (log scale)
Ratio (OR, RR, HR): no effect = 1
Paper 2 (day 2): HR 2.13 (95% CI 1.48 to 3.06)
CI excludes 1: significant

KEY MESSAGE Find the null value first, then see if the CI crosses it.

Extra: Prediction models: discrimination and calibration

0%
50%
100%
Predicted risk
survived
died
discrimination
c-statistic (AUC) = 0.89
separates who dies from who lives
0
50%
100%
0
50%
100%
Predicted
Observed
Calibration
where it was built
points on the line = good
0
50%
100%
0
50%
100%
Predicted
Observed
Calibration
in a new hospital
over-predicts risk: needs external validation

KEY MESSAGE A good prediction model separates patients and gets the risks right, in new hospitals too.

Extra: Prediction and machine learning: how to judge a model

Machine learning (ML) is a flexible way to build prediction models. The same questions apply.

What is it for?

  • Predict an individual’s risk
  • Not to explain causes
  • Who, when, which decision?

Enough data?

  • ML needs many events
  • Overfitting risk is high
  • Internal validation done?

Does it work?

  • Discrimination (AUC)
  • Calibration plot
  • External validation

Is it reported?

  • TRIPOD+AI checklist
  • Code, data, fairness
  • Impact on patients?

KEY MESSAGE An AI score is a prediction model: ask for calibration and external validation.

Extra: Complete-case analysis vs multiple imputation

Data with gaps
?
?
?
Complete-case: drop rows
with any gap (3 of 5 rows)
fewer patients, biased
unless MCAR
Step 1: impute 5 times
OR 1.62
OR 1.75
OR 1.58
OR 1.81
OR 1.69
Step 2: analyse each completed dataset
Step 3: pool
OR 1.69 (95% CI 1.15 to 2.48)
CI includes the extra uncertainty from the gaps
Illustrative numbers

KEY MESSAGE Multiple imputation keeps every patient and admits the uncertainty of the gaps.

Extra: Report and test your missing data

Four things a reviewer will look for. MI = multiple imputation.

Report

  • n missing per variable
  • Flow diagram: who and why
  • In Table 1 or a footnote

Compare

  • Patients with vs without complete data
  • Are they different?

Sensitivity (Level 3)

  • Complete case vs MI
  • Example script: 05_missing.R
  • Done hands-on in Level 3, Module H

Plan

  • Write it in the SAP before you see the data
  • Part 3 of your proposal

KEY MESSAGE Missing data are a result: report them, handle them, test the answer.