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 '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.

Value

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)

[Package rAverage version 0.5-8 Index]