Validates a set of item responses against a ClinicalInstrument, aggregates them into the total and subscale scores under the chosen missing-data policy, and assigns the interpretation stratum.
Usage
scoreInstrument(
instrument,
items,
missing = c("error", "prorate", "na"),
subject_id = NA_character_,
timestamp = NA_character_
)Arguments
- instrument
A ClinicalInstrument, or an instrument id resolved via
getInstrument().- items
A named numeric vector (item id -> response), a one-row data.frame, or an unnamed vector in the instrument's item order.
- missing
Missing-data policy:
"error"(default; any missing item is an error),"prorate"(scale the observed items up to the full count) or"na"(returnNAfor any score with a missing item).- subject_id
Optional subject identifier stored on the result.
- timestamp
Optional timestamp stored on the result.