get_trend
Test whether a health marker is increasing, decreasing, or stable over time using Mann-Kendall statistics; returns direction, p-value, and slope. Requires 5+ approved values.
Instructions
Statistical trend of one marker over time (Mann-Kendall test + slope) on approved values: direction increasing / decreasing / no_trend with z, p-value and slope per measurement. Needs at least 5 values in the window, otherwise returns no_trend with the reason. Use for "is X going up/down"; for the raw values use query_observations. type_code: catalog code such as ldl, hemoglobin, vitamin_d, resting_hr, hrv (as returned by query_observations / sql_query on v_observations). days: window (default 1825 ≈ 5 years).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| type_code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |