The Tietjen-Moore test algorithm is a generalization of the Grubbs' test algorithm, which is basically used for univariate datasets. The following algorithm depicts the detection of the multiple outliers in a univariate dataset by applying the Tietjen-Moore test algorithm. The following are the parameters used:
- Input parameter: Input data, including outliers
- Output parameters: Original data with outliers marked
The workflow is shown as follows:
![](https://static.packt-cdn.com/products/9781789804379/graphics/assets/2c1b6f53-23b3-43c2-b6f5-9b3f658d9a5c.png)
The step-wise approach will help us to create the function in the desired way. We will carry out the following steps to implement the detection of outliers in R for the bank dataset:
- Create a function that assists in generating the outliers in R:
> TietjenMoore <- function(dataSeries,k)
+ {
+ n = length(dataSeries)
+ ## Compute the absolute residuals.
+ r = abs(dataSeries - mean(dataSeries))
+ ## Sort data...