Skip to contents

User-facing wrapper that dispatches to the appropriate std_using_*() method for an npsych_scores object. When method and version are omitted, the registered defaults (see set_std_defaults()) are used.

Usage

std(scores, ..., method = NULL, version = NULL)

Arguments

scores

An npsych_scores object, such as MOCATOTS(c(25, 28)).

...

Named covariates passed through to the underlying std_using_*() method (e.g., age, sex, educ).

method

A single string naming the standardization method (e.g., "norms", "regression"). When NULL (the default), the default method registered via set_std_defaults() is used.

version

A single string identifying the version of the method (e.g., "nacc", "updated_2025.06"). When NULL (the default), the default version registered via set_std_defaults() is used. Ignored when the resolved method does not use versioned data.

Value

An std_npsych_scores object (inherits numeric). Access standardization metadata via S7 properties:

@method

The standardization method used (e.g., "norms", "regression").

@version

The version identifier (e.g., "nacc", "updated_2025.06"), or NULL if the method is unversioned.

@description

A human-readable summary of the standardization applied, including covariates.

@scores_subclass

The name of the originating npsych_scores subclass (e.g., "MOCATOTS").

See also

std_data() for batch-standardizing every npsych_scores column in a data frame, list_std_methods(), list_method_versions(), get_std_defaults(), set_std_defaults().

Examples

if (FALSE) { # \dontrun{
# Using registered defaults
std(MOCATOTS(c(25, 28)), age = 72, sex = 1, educ = 16)

# Specifying method and version explicitly
std(MOCATOTS(c(25, 28)), method = "norms", version = "nacc",
    age = 72, sex = "m", educ = 16)
} # }