| find_outliers | R Documentation |
Identifies outliers in Variance Function Profiling (VFP) models using a
two-phase approach. In the first phase, deviance residuals from the fitted
model are used to rank observations and select the k most extreme
candidates. In the second phase, each candidate is evaluated using a
Likelihood Ratio Test (LRT): the candidate is temporarily removed, the
best-fitting model is identified on the reduced data, and the same model
structure is fitted to the full data. Because the model structures are
identical the deviance difference is compared against a chi-squared(1)
distribution. The significance level alpha can be adjusted for
multiple testing using Bonferroni correction or False Discovery Rate (FDR).
The procedure stops at the first candidate that is not confirmed as an
outlier.
find_outliers(
obj,
model.no = NULL,
k = 5,
alpha = 0.05,
mult = c("fdr", "bonf", "none"),
mpos = TRUE,
plot = FALSE,
type = c("cv", "sd", "vc"),
...
)
obj |
(object) of class |
model.no |
(integer) model number to use. If |
k |
(integer) maximum number of outlier candidates to evaluate. |
alpha |
(numeric) global significance level for the LRT. |
mult |
(character) multiplicity adjustment method:
|
mpos |
(logical) if |
plot |
(logical) if |
type |
(character) scale for plotting: |
... |
additional arguments passed to |
The original VFP object with an additional list element
outliers containing:
resA data.frame with one row per evaluated
candidate, including the deviance residual (OCpDRes), the
best-fitting model (BestMod), deviances of the full
(DevFull) and reduced (DevRed) model, the deviance
difference (DiffDev), the critical value (QChisq),
the p-value, and a logical flag Outlier.
OutliersRemovedA data.frame with smooth plotting
coordinates of the final VFP model after outlier removal, or
NULL if no outliers were found.
ind.outInteger vector of confirmed outlier indices.
Andre Schuetzenmeister andre.schuetzenmeister@roche.com
## Not run:
data(Glucose)
Glucose$DF <- 1
Glucose$Mean <- (Glucose$V1 + Glucose$V2) / 2
Glucose$VC <- (Glucose$V1 - Glucose$V2)^2 / 4
Glucose <- Glucose[which(Glucose$VC > 0), ]
fit <- fit_vfp(Glucose, 1:9)
out <- find_outliers(fit)
out <- find_outliers(fit, plot = TRUE)
out <- find_outliers(fit, plot = TRUE, mult = "none")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.