View source: R/compute_outliers.R
compute_outliers | R Documentation |
time_model()
.Based on computed area under the curves (i.e., compute_aucs()
)
and slopes (i.e., compute_slopes()
) for several intervals using
a model fitted by time_model()
, compute an outlier detection.
For details, see methods iqr
and zscore
of performance::check_outliers()
.
compute_outliers(
fit,
method,
period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17),
knots = list(cubic_slope = NULL, linear_splines = c(0.75, 5.5, 11), cubic_splines =
c(1, 8, 12))[[method]],
from = c("predicted", "observed"),
start = 0.25,
end = 10,
step = 0.01,
filter = NULL,
outlier_method = "iqr",
outlier_threshold = list(iqr = 2)
)
fit |
A model object from a statistical model such as
from a call to |
method |
The type of model provided in |
period |
The intervals knots on which AUCs are to be computed. |
knots |
The knots as defined |
from |
A string indicating the type of data to be used for the AP and AR computation, either "predicted" or "observed". Default is "predicted". |
start |
The start of the time window to compute AP and AR. |
end |
The end of the time window to compute AP and AR. |
step |
The step to increment the sequence. |
filter |
A string following |
outlier_method |
The outlier detection method(s). Default is |
outlier_threshold |
A list containing the threshold values for each method (e.g.,
|
A data.frame
listing the individuals which are not outliers based on several criteria.
data("bmigrowth")
ls_mod <- time_model(
x = "age",
y = "log(bmi)",
cov = NULL,
data = bmigrowth[bmigrowth[["sex"]] == 0, ],
method = "cubic_splines"
)
head(compute_outliers(
fit = ls_mod,
method = "cubic_splines",
period = c(0, 0.5, 1.5, 3.5, 6.5, 10, 12, 17)#,
# knots = list(
# "cubic_slope" = NULL,
# "linear_splines" = c(0.75, 5.5, 11),
# "cubic_splines" = c(1, 8, 12)
# )[[method]]
)[Outlier != 0])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.