Computes:
log_cortisol_wake (log-transformed waking cortisol)
CAR_AUC (Cortisol Awakening Response, trapezoidal AUC over 0-60 min by default)
log_amylase (log-transformed salivary alpha-amylase)
saliva_glucose (raw salivary glucose)
Arguments
- data
A data.frame or tibble with salivary markers.
- col_map
Named list mapping required inputs. Defaults assume same names:
cort1 -> "saliva_cort1" (nmol/L at wake)
cort2 -> "saliva_cort2" (nmol/L ~30 min)
cort3 -> "saliva_cort3" (nmol/L ~60 min)
amylase -> "saliva_amylase" (U/mL)
glucose -> "saliva_glucose" (mg/dL)
- verbose
Logical; if
TRUE(default), prints column mapping, input availability, physiological range information (informational only, values not altered), the list of markers being computed with their inputs, and a per-column results summary.- na_action
One of
c("keep","omit","error")for required-input NA handling. Default "keep".- na_warn_prop
Proportion \([0,1]\) to trigger high-missingness diagnostics (debug). Default 0.2.
- times
Numeric vector of sampling times (minutes) for CAR AUC. Must align with cort1/2/3. Default c(0,30,60).
Value
A tibble with columns:
log_cortisol_wakeCAR_AUClog_amylasesaliva_glucose
If an ID column is detected in data (e.g. id, IID, participant_id),
it is prepended as the first output column.
Details
Inputs are validated, missingness handled via na_action, logs made safe
(<= 0 -> NA), and optional extremes scan/cap is available.
Note
log_cortisol_wake and log_amylase use the natural logarithm (log()).
CAR_AUC is the trapezoidal area under the cortisol-time curve (Pruessner
et al. 2003, AUC with respect to ground). saliva_glucose is a
pass-through column; no formula is applied.
References
Pruessner JC, Kirschbaum C, Meinlschmid G, Hellhammer DH (2003). “Two formulas for computation of the area under the curve represent measures of total hormone concentration versus time-dependent change.” Psychoneuroendocrinology, 28(7), 916–931. doi:10.1016/S0306-4530(02)00108-7 . Kirschbaum C, Hellhammer DH (1994). “Salivary cortisol in psychoneuroendocrine research: recent developments and applications.” Psychoneuroendocrinology, 19(4), 313–333. doi:10.1016/0306-4530(94)90013-2 . (salivary cortisol methods; background) Clow A, Thorn L, Evans P, Hucklebridge F (2004). “The awakening cortisol response: methodological issues and significance.” Stress, 7(1), 29–37. doi:10.1080/10253890410001667205 . (CAR methodological review; background) Nater UM, Rohleder N (2009). “Salivary alpha-amylase as a non-invasive biomarker for the sympathetic nervous system: current state of research.” Psychoneuroendocrinology, 34(4), 486–496. doi:10.1016/j.psyneuen.2009.01.014 . (salivary alpha-amylase SNS biomarker; background) Scales WE, Freeman EW, McCoy NL, Klerman EB (1987). “Salivary glucose as a measure of blood glucose: correlations and applications.” Diabetes Care, 10(4), 414–418. doi:10.2337/diacare.10.4.414 . (salivary glucose application; pass-through, no formula)
Examples
df <- tibble::tibble(
saliva_cort1 = 12.5,
saliva_cort2 = 18.0,
saliva_cort3 = 16.2,
saliva_amylase = 85,
saliva_glucose = 4.2
)
saliva_markers(df) # uses default col_map
#> saliva_markers(): reading input 'df' — 1 rows × 5 variables
#> saliva_markers(): col_map (5 columns — 5 inferred from data)
#> cort1 -> 'saliva_cort1' (inferred)
#> cort2 -> 'saliva_cort2' (inferred)
#> cort3 -> 'saliva_cort3' (inferred)
#> amylase -> 'saliva_amylase' (inferred)
#> glucose -> 'saliva_glucose' (inferred)
#> saliva_markers(): optional inputs
#> present: cort1, cort2, cort3, amylase, glucose
#> saliva_markers(): computing markers:
#> log_cortisol_wake [cort1]
#> CAR_AUC [cort1, cort2, cort3]
#> log_amylase [amylase]
#> saliva_glucose [glucose]
#> saliva_markers(): results: log_cortisol_wake 1/1, CAR_AUC 1/1, log_amylase 1/1, saliva_glucose 1/1
#> # A tibble: 1 × 4
#> log_cortisol_wake CAR_AUC log_amylase saliva_glucose
#> <dbl> <dbl> <dbl> <dbl>
#> 1 2.53 970. 4.44 4.2