Skip to contents

Adjusts a raw baseline estimate according to global sleep-period glucose metrics (median, nadir, maximum), applying diabetic-status-dependent tolerances.

Usage

correct_baseline(baseline, sleep_stats, diabetic = FALSE)

Arguments

baseline

A baseline list as returned by compute_baseline().

sleep_stats

A list with elements median, nadir, max for the sleep period.

diabetic

Logical, whether the participant has diabetes. Diabetic participants use a tolerance of ±10 mg/dL and an upper cap of 180 mg/dL; non-diabetic participants use ±5 mg/dL and no cap.

Value

A corrected baseline value (numeric scalar, mg/dL).