outlier.replace {rAverage} | R Documentation |
Outlier detection and substitution
Description
Starting by a previously estimated averaging model, this function detect outliers according to a Bonferroni method. The outliers can be substituted with a user-defined value.
Usage
outlier.replace(object, whichModel = NULL, alpha = 0.05, value = NA)
Arguments
object |
An object of class |
whichModel |
Argument that specifies which of the predicted models has to be compared to the observed data. Options are:
As default setting, the (first) best model is used. |
alpha |
Critical value for the z-test on residuals. |
value |
Argument that can be used to set a replacement for the outliers. If a function is specified, it is applied to each column of the final matrix: the resulting value is used to replace outliers detected on the same column. |
Value
A data object in which outliers have been removed or replaced.
See Also
Examples
data(pasta)
model <- rav(pasta, subset="s04", lev=c(3,3), names=c("Price","Packaging"))
outlier.replace(model, value=mean)
outlier.replace(model, whichModel="IC", value=NA)