Produces a feature spec that computes the arithmetic mean of a numeric column across all records matching the concept set for each person. Commonly used for averaging repeated lab measurements (e.g. mean systolic blood pressure across visits).
Arguments
- concept_set
Numeric vector of concept IDs, or an
omop_concept_setobject defining the concepts to match.- value_column
Character; name of the numeric column to average (default
"value_as_number").- name
Character; optional custom name for the feature column. If
NULL, auto-generated from the concept and table context.
Examples
if (FALSE) { # \dontrun{
spec <- omop.feature.mean_value(c(3004249),
value_column = "value_as_number")
plan <- ds.omop.plan.features(plan, "vitals",
"measurement", specs = list(mean_sbp = spec))
} # }