Compute the standard CARWatch saliva response feature set
Usage
compute_features(
data,
saliva_type = "cortisol",
group_levels = NULL,
sample_level = NULL,
sample_times = NULL,
slope_pairs = NULL,
remove_s0 = FALSE
)Examples
curve <- tibble::tibble(
participant = "P01", sample = paste0("S", 1:4),
time_min = c(0, 30, 45, 60), cortisol = c(5, 9, 8, 7)
)
compute_features(
curve,
group_levels = "participant",
sample_level = "sample",
sample_times = "time_min"
)
#> # A tibble: 1 × 7
#> participant cortisol_auc_g cortisol_auc_i cortisol_ini_val cortisol_max_val
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 P01 450 150 5 9
#> # ℹ 2 more variables: cortisol_max_inc <dbl>, cortisol_slope14 <dbl>