Learn R Programming

greybox (version 0.6.4)

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, level = 0.999, type = c("rstandard", "rstudent"), ...)

Arguments

object

Model estimated using one of the functions of smooth package.

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.

...

Other parameters. Not used yet.

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.

Details

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

See Also

influence.measures

Examples

Run this code
# NOT RUN {
# 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