ref_support
Usage
ref_support(fit, newdata)Checks each row of newdata against the covariate ranges and the
joint (Mahalanobis) spread of the reference data on the covariates the
model actually uses. Statuses: "in", "edge" (outside the central
96% of a covariate or beyond the 99% Mahalanobis radius), "out"
(outside the observed range or beyond twice that radius), and
"new_group" (unseen factor level), and "unknown" (a covariate is
NA).
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
fit |
A ref_fit. |
newdata |
Target data. |
A tibble with .row, support, and the squared Mahalanobis
distance d2 (NA when there are fewer than two numeric covariates
or the row has a missing covariate).
Examples
Section titled “Examples”ref <- ref_simulate(80, seed = 1)spec <- ref_spec(family = ref_gaussian(), location = ~ age + sex)fit <- ref_fit(spec, data = ref, outcomes = "y")ref_support(fit, ref[1:3, ])# A tibble: 3 × 3 .row support d2 <int> <chr> <dbl>1 1 in 0.9332 2 in 0.3253 3 in 0.0306