Skip to contents

Determines the direction of trends in HRV metrics using linear regression. The function fits a linear model to the values and categorizes the slope into descriptive trend categories.

Usage

calculate_trend_direction(values)

Arguments

values

Numeric vector of values to analyze for trend. Should contain at least 2 values.

Value

Character string describing the trend direction and magnitude:

  • "Stable" (abs(slope) < 0.1)

  • "Slight Increase" (0.1 <= slope <= 0.5)

  • "Strong Increase" (slope > 0.5)

  • "Slight Decrease" (-0.5 <= slope < -0.1)

  • "Strong Decrease" (slope < -0.5)