outlierdummy | R Documentation |
Function detects outliers and creates a matrix with dummy variables. Only point outliers are considered (no level shifts).
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"), ...)
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. |
The detection is done based on the type of distribution used and confidence level specified by user.
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.
Ivan Svetunkov, ivan@svetunkov.com
influence.measures
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.