Learn R Programming

TIMP (version 1.13.6)

outlierCorr: Finds and removes outliers from a datasets

Description

Finds and removes outliers from datasets given the results of fitting as returned by fitModel. Uses the residuals in the fitted results to return a list of corrected datasets to be used in place of the datasets used in the call to fitModel as well as a list of weights. The data returned contains the fitted values at pointed that are outliers and will be assigned zero weight in subsequent fits.

Usage

outlierCorr(oldRes, fence=3, saturCorr=FALSE, saturThresh=.05,
                          saturMin=NA, saturDivMax=3, outlierCorr=TRUE,
                          newM = TRUE)

Value

list containing the elements dt, a list of corrected datasets, and weightList, a list of new weight matrices.

Arguments

oldRes

Object returned by fitModel function

fence

Object of class "numeric" determining what points to consider outliers.

saturCorr

whether to correct for saturation

saturThresh

See code.

saturMin

See code.

saturDivMax

See code.

outlierCorr

whether to perform outlier correction

newM

whether to add to the outliers and saturation points detected previously

Details

We calculate the fourth spread at a given value of x2 in a dataset. Those points that are less than the first quartile minus the fourth spread times fence are outliers, as are those points that are more than the third quartile plus the fourth spread times fence. Outliers are assigned a weight of zero and are assigned the values found in fitting for the purpose of generating smooth-looking plots.

See Also

fitModel, preProcess