# NOT RUN {
# }
# NOT RUN {
data(hbk)
(out <- mmmult(hbk[,1:3]))
class(out)
summary(out)
## Generate contaminated data (200,3)
n <- 200
p <- 3
set.seed(123456)
X <- matrix(rnorm(n*p), nrow=n)
Xcont <- X
Xcont[1:5, ] <- Xcont[1:5,] + 3
out1 <- mmmult(Xcont, trace=TRUE) # no plots (plot defaults to FALSE)
names(out1)
## plot=TRUE - generates: (1) a plot of Mahalanobis distances against
## index number. The confidence level used to draw the confidence bands for
## the MD is given by the input option conflev. If conflev is
## not specified a nominal 0.975 confidence interval will be used and
## (2) a scatter plot matrix with the outliers highlighted.
(out1 <- mmmult(Xcont, trace=TRUE, plot=TRUE))
## plots is a list: the spm shows the labels of the outliers.
(out1 <- mmmult(Xcont, trace=TRUE, plot=list(labeladd="1")))
## plots is a list: the spm uses the variable names provided by 'nameY'.
(out1 <- mmmult(Xcont, trace=TRUE, plot=list(nameY=c("A", "B", "C"))))
## mmmult() with monitoring
(out2 <- mmmult(Xcont, monitoring=TRUE, trace=TRUE))
names(out2)
## Forgery Swiss banknotes examples.
data(swissbanknotes)
(out1 <- mmmult(swissbanknotes[101:200,], plot=TRUE))
(out1 <- mmmult(swissbanknotes[101:200,], plot=list(labeladd="1")))
# }
Run the code above in your browser using DataLab