Distance-Distance Plot

Description

"myplotDD" is a revised version of ".myddplot" in "plot-utils.R" in the package "rrcov". In "myplotDD", id.n and ind are printed out.

Usage

1
myplotDD(x, cutoff, id.n)

Arguments

x

An S4 object of class "CovRobust".

cutoff

The cutoff value used. If missing, cutoff <- sqrt(qchisq(0.975, p)) by default.

id.n

Number of observations to identify by a label. If not supplied, the number of observations with robust distance larger than cutoff is used.

Details

Distance-Distance Plot: Plot the vector y=rd (robust distances) against x=md (mahalanobis distances). Identify by a label the id.n observations with largest rd. If id.n is not supplied, calculate it as the number of observations larger than cutoff. Use cutoff to draw a horisontal and a vertical line. Draw also a dotted line with a slope 1.

"myplotDD(x)" is equivalent to "plot(x, which="dd")". which: indicate what kind of plot. If which = "dd", then a distance-distance Plot.

Value

A distance-distance plot is shown. Return a list with components:

cutoff

The cutoff value used. If missing, cutoff <- sqrt(qchisq(0.975, p)) by default.

id.n

Number of observations to identify by a label. If not supplied, the number of observations with robust distance larger than cutoff is used.

sort.y

A list containing the sorted values of y (the robust distance)

ind

The indices of the largest id.n observations whose robust distances are larger than cutoff.

Author(s)

Ying-Ying Zhang (Robert) robertzhangyying@qq.com

References

Zhang, Y. Y. (2013), An Object Oriented Solution for Robust Factor Analysis.

See Also

plot, qchisq, CovClassic, getDistance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(stock611)
covMcd=CovRobust(x=scale(stock611[,3:12]), control="mcd"); covMcd

## "myplotDD" shows id.n and ind.
## Note: id.n and ind change each time due to covMcd changes each time!
## However, the ind of largest robust distances do not change.
result = myplotDD(x=covMcd); result

## "myplotDD" is equivalent to "plot(x=covMcd, which="dd")".
plot(x=covMcd, which="dd")