correlate
Measure how two health or context fields move together over a date range, such as stress and pollen or resting heart rate and sleep, with optional lag days.
Instructions
Measure how closely two fields (health or context, any
combination) move together over a date range -- e.g. does stress
correlate with pollen count, or resting heart rate with sleep
duration. lag_days (-7 to +7) shifts field_b relative to field_a:
a positive lag compares field_a on a given day against field_b
lag_days days LATER (useful for "does X today predict Y a few
days from now" questions); 0 (the default) compares same-day
values. Returns both Pearson (linear relationship) and Spearman
(monotonic relationship, more robust to outliers) correlation
coefficients, each in [-1, 1], plus how many overlapping data
points they were computed from.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date_to | Yes | ||
| field_a | Yes | ||
| field_b | Yes | ||
| lag_days | No | ||
| date_from | Yes |