Artificial Intelligence Doctor

Question

Wearable-derived activity signatures vs disease activity in elderly rheumatoid arthritis (RA): In adults ≥70 years with RA, how strongly do continuous, real‑world wearable metrics (gait speed, step‑count variability, activity fragmentation, circadian rhythm stability, sleep continuity, HRV/PPG if available) associate with clinical disease activity (DAS28‑CRP, SDAI, RAPID3), and can these metrics anticipate RA flares by ≥7 days?

Answer (protocol‑grade plan + expected benchmarks)

1) What to measure (domains & instruments)

DomainInstrument / ProtocolPrimary metricsNotes
AmbulationWrist/hip accelerometer (24/7, 60–100 Hz; 1‑min epochs)Daily steps; gait speed proxy (cadence×stride length model); peak 30‑min cadence; sit‑to‑stand transitionsDevice‑agnostic feature set; non‑wear auto‑detect
Variability & fragmentationFrom minute‑level activityCoefficient of variation (CV) of steps/day; bout distribution α; transition probability (active↔sedentary); activity fragmentation indexHigher fragmentation = worse endurance/flare risk
Circadian rhythmActigraphyInterdaily stability (IS), intradaily variability (IV), relative amplitude (RA) of rest–activity rhythmLower IS / higher IV suggests disruption
SleepActigraphy or PPGTotal sleep time, wake after sleep onset (WASO), sleep efficiencyMorning stiffness proxy: low activity in first 90 min post‑wake
AutonomicPPG (if available)Nighttime HRV (RMSSD), resting HR trendArtifacts filtered; use nightly medians
Clinical activityMonthly clinicDAS28‑CRP, SDAI; RAPID3 monthly; daily eDiary: pain (0–10), stiffness minutesFlare defined a priori (e.g., OMERACT + ΔDAS28≥1.2 or ≥0.6 if high baseline)
InflammationLabsCRP, ESRDrawn monthly; optional home micro‑sampling
ContextQuestionnaires & logsMedication changes, glucocorticoid bursts, infections, weather/seasonalityTime‑varying covariates

2) Study design

3) Feature engineering (daily → weekly)

4) Statistical analysis plan (SAP)

5) Benchmarks to claim success (pre‑specified)

PropertyTarget
Association (same‑week)|β| ≥ 0.25 for fragmentation or IS/IV vs DAS28; partial R² ≥ 0.07
Prediction (t−7 → flare)AUC ≥ 0.78 (95% CI lower bound ≥ 0.72); PPV ≥ 0.35 at 20% alert rate
Lead timeMedian correct‑alert lead ≥ 7 days
CalibrationCalibration slope 0.9–1.1; Brier score improvement vs symptoms‑only
External validityStable performance across device brands and gait‑aid users (∆AUC < 0.03)

6) Power & sample size (sketch)

7) Expected findings & interpretation

8) Practical alert policy (example)

9) Pseudocode (model skeleton)

# Weekly dataset with person_id, week, DAS28, flare (0/1), features_{t}, features_{t-1}, covariates
# Fit lagged mixed model for t-1 (≈7 days back) predicting flare at t

from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
import numpy as np

X = weekly[["frag_t-1","IS_t-1","IV_t-1","morningIdx_t-1","peak30_t-1","HRV_t-1","restHR_t-1","pain_t-1","stiffmin_t-1","weather","weekend"]]
y = weekly["flare_t"]

# Person-level cross-validation
aucs = []
for train_ids, test_ids in person_group_kfold(weekly.person_id, n_splits=5):
    model = LogisticRegression(max_iter=200, penalty="l2", class_weight="balanced")
    model.fit(X.iloc[train_ids], y.iloc[train_ids])
    p = model.predict_proba(X.iloc[test_ids])[:,1]
    aucs.append(roc_auc_score(y.iloc[test_ids], p))

print("AUC:", np.mean(aucs))

Abbreviations — DAS28: Disease Activity Score in 28 joints; SDAI: Simplified Disease Activity Index; RAPID3: Routine Assessment of Patient Index Data 3; IS/IV: interdaily stability / intradaily variability; PPG: photoplethysmography; HRV: heart‑rate variability; RMSSD: root‑mean‑square of successive differences; DMARD: disease‑modifying antirheumatic drug.