Standardizes an observed value (or waveform) against a
NormativeModel: \(z = (value - mean) / sd\), element-wise. A
scalar model recycles across a vector of observations; a waveform model
returns a per-timepoint z of the same length as the observation.
Usage
normativeZScore(value, model, age = NULL, sex = NULL, task = NULL)
Arguments
- value
Numeric observation. A scalar, a vector of scalars (scored
against a scalar model), or a waveform matching a waveform model's length.
- model
A NormativeModel.
- age, sex, task
Optional strata forwarded to the model to select the
applicable norm.
Value
Numeric z-score(s), matching the length of value (or the
waveform length).
Examples
m <- NormativeModel(mean = 1.30, sd = 0.15)
normativeZScore(c(1.00, 1.30, 1.60), m)
#> [1] -2 0 2