outlierdummy: Outlier detection and matrix creation

View source: R/outlierdummy.R

outlierdummyR Documentation

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, ...)

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

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

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.

Details

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

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.

Author(s)

Ivan Svetunkov, ivan@svetunkov.com

See Also

influence.measures

Examples


# 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)


config-i1/greybox documentation built on Dec. 12, 2024, 1:42 p.m.