mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
Two new observational surfaces on the mood Insights page, both computed in the single mood-aggregates engine so the charts and the coach snapshot stay in sync. Influence on mood (per tag): for each frequent flat and structured tag, compare the average daily mood on days the tag is present against the counterfactual baseline of days it is absent, with the delta and a confidence band. The band comes from a Welch two-sample t-test reusing the exact Student-t p-value already behind the correlation cards, not a naive approximation. Both groups must clear a five-day floor; rows rank by absolute delta and cap per axis. Sparse tags, single-day tags, all-same-value days, and zero-delta tags are dropped cleanly — never NaN. Better days board: one ranked list folding the tag deltas and the mood x health-metric correlations (sleep, steps, pulse, weight, blood pressure) into a single effect-size-ranked, confidence-gated surface — the headline answer to "what goes with my good days?". Near-zero and under-sampled correlations are excluded; the list is capped and observational only, with the standing "association, not cause" caption. Both surfaces ride the mood-status snapshot too so the assessment prose never contradicts the on-screen relations. New copy in all six locales.