Data
Data and Code
Can he do the analysis himself, or only commission it?
I write the code. R first, Python alongside it, with the analysis plan fixed before the data are opened and the whole pipeline written so someone else can run it and get the same numbers. Large time-series files from monitors and sensors are the normal case, not the exception.
How I work:
- Evidence
- Written standard
- Evaluation
- A specific fix
- Guidance people keep following
Code is where a standard stops being a document and becomes a number somebody can check.
What I work with
Languages
R, used daily, with Python, SQL, SAS and Stata. Analyses are delivered as Quarto documents, so the code, the output and the write-up stay in one file.
Methods
Mixed-effects models for repeated measures, logistic regression, survival analysis, and causal methods: directed acyclic graphs, inverse probability weighting, difference in differences.
Data
Accelerometry and sensor time series, population registries (ARIC, CARDIA, MESA, NHANES, CPASS), and health record and claims data.
Discipline
Pre-specified analysis plans, including CDISC-compliant plans for trials, plus quality control rules, data validation and anomaly detection written before analysis starts.
Sample: the quality rules that run before any model
Illustrative sample
Illustrative sample. Synthetic data, not from any employer or client. The rules are the ones I apply to monitor data; the thresholds are set per study, in advance.
| # | Check | Rule, fixed before the data arrive | If it fails |
|---|---|---|---|
| 1 | Wear time | A day counts only with enough waking wear time, set in advance | The day is dropped, and the number dropped is reported |
| 2 | Implausible values | Readings outside physiological range are flagged, never silently clipped | Flagged rows go to review with their raw values kept |
| 3 | Duplicate records | One record per person per timestamp, enforced by the join key | The join is rejected rather than reconciled by guesswork |
| 4 | Missing data | Pattern described before modelling; mechanism stated, not assumed | Multiple imputation, with complete cases as a sensitivity check |
| 5 | Sentinel codes | Codes such as 999 are mapped to missing in the import script | The import stops if an unmapped code appears |
Sample: repeated measures, as the design intends
Illustrative sample
Illustrative sample. Synthetic data, not from any employer or client. The structure matches a crossover sitting trial: four conditions in the same person.
# R. Each participant does every condition, so person is a random effect.
library(lme4)
library(emmeans)
fit <- lmer(
systolic ~ condition + period + (1 | id),
data = sitting
)
# Pre-specified contrast: each break strategy against uninterrupted sitting
emmeans(fit, trt.vs.ctrl ~ condition, ref = "uninterrupted")
# Report the effect and its interval, never the p value alone.Treating the four readings as independent would overstate precision. The random intercept is not a refinement, it is what the design requires.
Reproducible by default
- Analysis plan before the data
- Fixed random seeds
- Scripts, not spreadsheet edits
- Version control for every change
- Quarto output with code attached
The same habits run my AI work: SciencEye AI, the research assistant I built, is scored by a Python runner over a shared repository with more than 2,100 commits. See how that is evaluated.
More code
Full scripts, including the agreement analysis behind the wearables page and the evaluation scorer, are on Code and Notebooks.