Learn R Programming

greybox (version 2.0.2)

outlierdummy: Outlier detection and matrix creation

Description

Function detects outliers and creates a matrix with dummy variables. Only point outliers are considered (no level shifts).

Usage

outlierdummy(object, ...)

# S3 method for default outlierdummy(object, level = 0.999, type = c("rstandard", "rstudent"), ...)

# S3 method for alm outlierdummy(object, level = 0.999, type = c("rstandard", "rstudent"), ...)

Value

The class "outlierdummy", which contains the list:

  • outliers - the matrix with the dummy variables, flagging outliers;

  • statistic - the value of the statistic for the normalised variable;

  • id - the ids of the outliers (which observations have them);

  • level - the confidence level used in the process;

  • type - the type of the residuals used;

  • errors - the errors used in the detection. In case of count distributions, probabilities are returned.

Arguments

object

Model estimated using one of the functions of smooth package.

...

Other parameters. Not used yet.

level

Confidence level to use. Everything that is outside the constructed bounds based on that is flagged as outliers.

type

Type of residuals to use: either standardised or studentised. Ignored if count distributions used.

Author

Ivan Svetunkov, ivan@svetunkov.ru

Details

The detection is done based on the type of distribution used and confidence level specified by user.

See Also

Examples

Run this code

# Generate the data with S distribution
xreg <- cbind(rnorm(100,10,3),rnorm(100,50,5))
xreg <- cbind(100+0.5*xreg[,1]-0.75*xreg[,2]+rs(100,0,3),xreg)
colnames(xreg) <- c("y","x1","x2")

# Fit the normal distribution model
ourModel <- alm(y~x1+x2, xreg, distribution="dnorm")

# Detect outliers
xregOutlierDummy <- outlierdummy(ourModel)

Run the code above in your browser using DataLab