outlier.replace function

Outlier detection and substitution

Outlier detection and substitution

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.

outlier.replace(object, whichModel = NULL, alpha = 0.05, value = NA)

Arguments

  • object: An object of class 'rav', containing the estimated averaging models.

  • whichModel: Argument that specifies which of the predicted models has to be compared to the observed data. Options are:

    1. "null": null model
    2. "ESM": equal scale values model
    3. "SAM": simple averaging model
    4. "EAM": equal-weights averaging model
    5. "DAM": differential-weight averaging model
    6. "IC": information criteria

    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.

Returns

A data object in which outliers have been removed or replaced.

See Also

rav, rAverage-package,

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)
  • Maintainer: Davide Massidda
  • License: GPL (>= 2)
  • Last published: 2017-07-29

Useful links