Analyze event impact
analyze_event_impactEstimate how a health metric changes before and after a discrete event. Splits data into before/after groups, reports descriptive statistics, and calculates the difference in means with a Welch t-test.
Instructions
Estimate a signal's before/after change around a discrete event.
Splits one signal at an anchor date (e.g. a medication start, procedure, or regimen change) into 'before' and 'after' groups, reports descriptive stats for each, and adds the difference in means plus a Welch t-test.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | the signal name, e.g. 'resting_heart_rate' or 'a1c_percent'. | |
| user | No | which person; defaults to the primary user. | |
| source | No | 'metric' | 'wearable' | 'lab' | 'biomarker' | 'substance'. | metric |
| event_date | Yes | the anchor date (ISO8601 or 'YYYY-MM-DD'). | |
| event_label | No | optional description of the event, echoed in the response. | |
| window_days | No | if set, only include readings within this many days on each side of the event; omit to use all available history. | |
| washout_days | No | exclude readings within this many days of the event on both sides (a washout gap) to skip transition-period noise. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||