Skip to contents

WHY THE DISTINCTION DECIDES THE UNIT OF ANALYSIS, AND SO THE RESULT.

Usage

clin_variable_unit(v, patient_of = NULL)

Arguments

v

named vector sample_id -> value for one clinical variable.

patient_of

named vector sample_id -> patient, or NULL.

Value

"patient" or "sample".

Details

A cohort sampled at several timepoints carries two kinds of clinical column, and they are different questions that happen to look identical in the sheet:

CONSTANT WITHIN A PATIENT – 28-day survival, BMI, age, sex. This is a BETWEEN-SUBJECT question: do patients who died differ from patients who lived? Three samples from one patient are three measurements of one person. Testing them as three observations is pseudoreplication: it inflates the apparent sample size, narrows the interval and makes significance more likely, with no additional patient recruited. On a cohort of six patients sampled at three timepoints it turns n = 6 into n = 18. The standard remedy for a between-subject question is to collapse to one value per subject before testing, which is what this function's verdict triggers.

VARYING WITHIN A PATIENT – a severity score recorded at each draw. This is a WITHIN-SUBJECT question: as this patient's score moved, did the population move with it? Collapsing to a patient median would delete exactly the variation being asked about. The per-sample test is kept, and n_patients and repeated_measures are reported beside it so a reader can see that the observations are not independent. The correct dedicated method is a repeated-measures correlation (Bland & Altman 1995; Bakdash & Marusich 2017, rmcorr), which is named in the statistics vignette rather than implemented here, for the same reason the mixed models there are not.

With no patient mapping every sample is treated as its own subject, which is correct for a cross-sectional cohort and is the only thing that can be assumed when the sheet does not say otherwise.