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.
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.
Returns
list containing the elements dt, a list of corrected datasets, and weightList, a list of new weight matrices.