baseline
Whitepaper

Causal inference on a single person's health record

v1.022 JUL 202610 sections
Abstract

Population trials answer what a treatment does on average. They do not tell you what it does to you. This paper sets out the data model, estimator, design, and reporting standard behind Baseline: how heterogeneous personal health streams are aligned into one record, how a hierarchical Bayesian model borrows strength across a cohort without flattening the individual, how protocols are designed so that a question can actually be settled, and why every result is reported as an effect size with a credible interval — including the results that do not settle.

01

The problem

A person who wants to know whether something helps them has two unsatisfying options. They can read a randomised trial, which reports an average over people unlike them on an outcome they may not have chosen. Or they can try it and watch a dashboard, which shows correlations between everything and everything else.

Consider the evidence base for a supplement taken by millions. The most-cited synthesis of magnesium for insomnia pools three randomised trials covering 151 people, and grades the resulting evidence low to very low, with all three trials at moderate-to-high risk of bias [1]. It finds sleep onset latency falls by 17.36 minutes (95% CI −27.27 to −7.44) and that total sleep time changes by 16.06 minutes with an interval of −5.99 to +38.12 — consistent with a loss and with a substantial gain.

Suppose that estimate were solid. It would still be an average over a population defined by a diagnosis and an age band. Heterogeneity of treatment effect is not a caveat to that estimate; it is the entire question a person is asking when they wonder whether to keep taking something.

Why the dashboard fails

The second option fails structurally rather than for lack of data. A single person's history is short, serially correlated, and confounded by everything that varies alongside the intervention. Ordinary summaries over that history recover the confounders as readily as the effect.

More sensors do not fix this. They add dimensions to search, which makes spurious findings more likely rather than less. A system that reports every correlation it can compute will, given enough streams, always have something to show you.

02

One record

Streams arrive at incompatible resolutions. Wearables emit near-continuous signals; blood panels are drawn every few weeks; meals and symptoms are logged irregularly and incompletely; a supplement is a protocol rather than a measurement. The first step is alignment onto a common nightly index.

Each stream carries its own observation model rather than being interpolated into a shape it does not have. Sparse streams stay sparse: a panel drawn on night 3 informs neighbouring nights through the model, not through forward-filling, which would fabricate precision the measurement never had.

Measurement error is not a footnote

Consumer wearables report sleep stages as though they were measurements. They are inferences, typically from movement and cardiac signals, trained to approximate what a sleep laboratory would score from EEG. A 2025 validation of six wrist-worn devices against simultaneous polysomnography found overall stage agreement between κ = 0.53 and κ = 0.21, and deep-sleep bias ranging from −25.20 minutes to +44.44 minutes per night depending on the device [2].

That error is larger than most effects worth detecting. The reason n-of-1 estimation survives it is that a personal trial does not ask what your deep sleep is; it asks whether your deep sleep changed. Accuracy — closeness to truth — matters for the first question. Reliability — an error that stays put — matters for the second. A device that overstates deep sleep by half an hour every night contributes that offset to both arms of a within-person contrast, where it largely cancels.

03

The model

The estimator is a hierarchical Bayesian time-series model fitted to each person's own record, with parameters partially pooled across a cohort.

y[i,t]   = outcome for person i on night t
x[i,t]   = 1 if on protocol that night, else 0
z[i,t]   = observed confounders (travel, alcohol, late meals, illness)

y[i,t]   ~ Normal( mu[i,t], sigma[i] )
mu[i,t]  = a[i] + b[i]*x[i,t] + g'z[i,t] + s[i,t]

a[i]     ~ Normal( mu_a, tau_a )        person-level intercept
b[i]     ~ Normal( mu_b, tau_b )        person-level effect  <- the answer
s[i,t]   = AR(1) term, rho[i]           serial dependence

mu_b     ~ Normal( 0, .. )              cohort mean effect
tau_b    ~ Half-Normal( .. )            between-person spread
sigma[i] ~ Half-Normal( .. )            within-person noise

The quantity reported to a person is the posterior for b[i] — their own effect — not mu_b, the cohort mean. The cohort enters only as the distribution b[i] is drawn from.

Partial pooling

Because b[i] is modelled as drawn from a population distribution rather than estimated in isolation, the estimate adapts to how much a person's own data can support. Where their record is short or noisy, the estimate shrinks toward the cohort; where it is long and clean, it stays close to what their record says. This is the component that does the most work, and removing it costs more accuracy than removing any single data stream.

The approach is established for aggregating series of n-of-1 trials rather than invented for consumer health. Zucker, Ruthazer and Schmid worked through the modelling choices on n-of-1 trials of amitriptyline and a combination therapy, and found the best-fitting specification paired a random intercept — each patient's own baseline response — with a fixed treatment effect [3].

Where it breaks

The same work is direct about the failure mode: hierarchical Bayesian models improved precision, but were highly sensitive to the priors placed on within-patient variance [3]. That sensitivity is not a technicality. The within-patient variance prior governs how much of a person's night-to-night variation the model attributes to noise, and therefore how hard it pulls their estimate toward the cohort. Choose it carelessly and you can manufacture a confident personal result that is largely an echo of the population.

The response is unglamorous: state the priors, refit under alternatives, and report when the posterior moves. A result that survives only under one convenient prior is not reported as a result.

04

Confounding and carryover

Known time-varying confounders enter the model explicitly as covariates rather than being filtered out of the data:

  • ·Travel and time-zone displacement
  • ·Alcohol, dose and timing
  • ·Meal timing relative to sleep onset
  • ·Acute illness
  • ·Menstrual phase, where applicable

Modelling them rather than excluding them means a night on protocol that also involved a late meal contributes what it can, instead of being discarded and shrinking an already short series.

Carryover

An intervention whose effect persists after it stops will contaminate the following off-protocol period and bias the contrast toward zero. The conventional remedy is a washout period between treatment periods, long enough for the person to return to baseline [4].

Washout is not always available or ethical, and it costs time in a design that is already short of it. The alternative is analytic: discard or downweight observations taken at the start of a new period, which achieves the same end without withholding anything [4]. Baseline downweights rather than discards, on a decay whose length is set per intervention class.

05

Design

How a trial is arranged matters as much as how it is analysed, because serial correlation destroys power. In simulations of n-of-1 crossover designs, power to detect a 0.3 SD difference fell from 0.851 with independent observations to 0.126 once serial correlation reached ρ = 0.75 [5].

More cycles, not more nights

The same work shows the remedy, and it is counter-intuitive: holding the total number of observations fixed at 400 and simply breaking them into more, shorter alternating periods recovered most of the lost power. At ρ = 0.75, a single-period design achieved 0.126; a forty-period design achieved 0.681 [5]. Same data, same duration, five-fold difference — purely from how the periods were arranged.

This is why protocols are specified as repeated short cycles with randomised start rather than one long on-block followed by one long off-block. The second arrangement is easier to adhere to and much worse at answering the question.

Sizing

A protocol is sized to a target interval width rather than to a significance threshold. The person sets how precise an answer would have to be to change what they do; the design is then chosen so the expected posterior width at completion falls below it. This gives a completion date instead of an open-ended commitment, and it makes the trade-off explicit: a narrower interval costs more nights.

06

Reporting

Every result is reported as three numbers: the effect size, a 95% credible interval, and the posterior probability that the effect is beneficial. There is no significance threshold.

The American Statistical Association's 2016 statement is unusually direct about why a threshold cannot carry the weight placed on it: “a p-value, or statistical significance, does not measure the size of an effect or the importance of a result”, and “smaller p-values do not necessarily imply the presence of larger or more important effects, and larger p-values do not imply a lack of importance or even lack of effect” [6].

Return to the magnesium result in section 01. Total sleep time changed by 16.06 minutes, interval −5.99 to +38.12, p = 0.15. Under a threshold rule that becomes four words — no significant effect — which is compatible with the data and discards what the reader needed. The interval says the evidence spans a small loss and a substantial gain. Someone deciding whether to keep taking a capsule every night is entitled to know the range is that wide.

Credible, not confidence

A confidence interval is a statement about a procedure: intervals constructed this way would contain the true value 95% of the time across repeated experiments. A credible interval is a statement about the parameter: given this data and these priors, there is a 95% probability the effect lies in this range. The second is what people already assume the first means, and it is the question being asked about one's own body.

The cost is the headline. We cannot report that something works. We report that the estimate is +18 minutes a night, that the plausible range runs +6 to +31, and that the posterior probability of benefit is 97%.

07

Abstention

When the posterior is too wide to act on, the system reports that the question has not settled rather than selecting the nearest verdict. An interval spanning zero is a result: it says the data are consistent with no effect and with a meaningful one, and quantifies how much of each remains plausible.

Abstention is only useful if it comes with a route forward. Each unsettled result is paired with the protocol that would settle it — cycle structure, randomised start, expected interval width at completion, and the confounders to be held — so that an inconclusive answer becomes a plan with a date rather than an open question.

08

Validation

The estimator is scored on N1Bench, an open benchmark of held-out records with planted ground truth. Three things are measured:

  • ·Effect recovery — how close the recovered effect size is to truth, normalised by the outcome's own night-to-night variation.
  • ·Calibration — whether a stated 95% interval contains the truth 95% of the time, penalising overconfidence and uselessly wide intervals equally.
  • ·Abstention — on records with no detectable effect, how often the system declines to conclude instead of inventing something.

Abstention is the metric most systems fail, and the reason the benchmark is published rather than kept internal. A system that tells you what is working should be able to demonstrate that it does not tell you things that are not.

Individual write-ups follow CENT 2015, the CONSORT extension for n-of-1 trials, which provides additional guidance for 14 of the 25 items on the CONSORT 2010 checklist [7]. It exists because n-of-1 designs have historically been reported too thinly for readers to judge validity or reproduce what worked, which is why our results carry period structure, randomisation detail, and washout alongside the effect size.

09

Limitations

The following are properties of the method, not defects awaiting a patch. They are listed because a result is only as useful as the reader's ability to discount it appropriately.

  • ·Unmeasured confounding cannot be removed from observational records. Randomised protocols address it; passive history does not.
  • ·Instrument-mediated confounding, where an intervention changes the signal a device uses to infer the outcome, survives within-person contrast (section 02).
  • ·Prior sensitivity on within-person variance is real and documented in the literature this method builds on [3].
  • ·Cohort composition bounds transportability. Partial pooling borrows from the people we have, and a person unlike any of them gets little benefit from it.
  • ·Adherence is itself a variable. A protocol followed unevenly produces a different estimand from the one specified.
  • ·Slow outcomes are out of reach. An intervention whose effect takes a year to appear cannot be settled by a design measured in weeks.
10

Data handling

Personal health records are processed to answer that person's own questions. Cohort-level parameters are estimated from pooled statistics rather than by exposing one person's record to another. Retention, access, and deletion are set out in the privacy policy.

References

  1. 1.Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis. BMC Complement Med Ther. 2021;21:125. doi:10.1186/s12906-021-03297-z. Link ↗
  2. 2.Schyvens A-M, Peters B, Van Oost NC, et al. A performance validation of six commercial wrist-worn wearable sleep-tracking devices for sleep stage scoring compared to polysomnography. SLEEP Advances. 2025;6(2):zpaf021. doi:10.1093/sleepadvances/zpaf021. Link ↗
  3. 3.Zucker DR, Ruthazer R, Schmid CH. Individual (N-of-1) trials can be combined to give population comparative treatment effect estimates: methodologic considerations. J Clin Epidemiol. 2010;63(12):1312-1323. doi:10.1016/j.jclinepi.2010.04.020. Link ↗
  4. 4.Agency for Healthcare Research and Quality. Design and Implementation of N-of-1 Trials: A User's Guide. AHRQ; 2014. Link ↗
  5. 5.Wang Y, Schork NJ. Power and Design Issues in Crossover-Based N-Of-1 Clinical Trials with Fixed Data Collection Periods. Healthcare (Basel). 2019;7(3):84. doi:10.3390/healthcare7030084. Link ↗
  6. 6.Wasserstein RL, Lazar NA. The ASA's Statement on p-Values: Context, Process, and Purpose. The American Statistician. 2016;70(2):129-133. doi:10.1080/00031305.2016.1154108. Link ↗
  7. 7.Vohra S, Shamseer L, Sampson M, et al. CONSORT extension for reporting N-of-1 trials (CENT) 2015 Statement. J Clin Epidemiol. 2016;76:9-17. doi:10.1016/j.jclinepi.2015.05.004. Link ↗
See the benchmark →