correlate_metrics
Calculate Pearson correlation between two health metrics' daily values, with optional lag from 0 to 3. Returns aligned pairs, r-value, and means, noting association not causation.
Instructions
Pearson correlation between two metrics' daily values: {metricA, metricB, lag (0 to 3, default 0), start, end}. lag pairs metricA on day d with metricB on day d+lag, so lag 1 compares against the FOLLOWING day. Returns alignedPairs, r (withheld below 10 aligned pairs), and both means. The answer always carries the association-not-causation caveat; treat every r as alignment in this file, not mechanism.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | YYYY-MM-DD | |
| lag | No | 0 to 3 days. lag 1 pairs metricA on day d with metricB on the following day. | |
| start | No | YYYY-MM-DD | |
| metricA | Yes | ||
| metricB | Yes |