plot.mcd             package:robustbase             R Documentation

_R_o_b_u_s_t _D_i_s_t_a_n_c_e _P_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Shows the Mahalanobis distances based on robust and classical
     estimates of the location and the covariance matrix in different
     plots. The following plots are available:

        *  index plot of the robust and mahalanobis distances

        *  distance-distance plot

        *  Chisquare QQ-plot of the robust and mahalanobis distances

        *  plot of the tolerance ellipses (robust and classic)

        *  Scree plot - Eigenvalues comparison plot

_U_s_a_g_e:

     ## S3 method for class 'mcd':
     plot(x,
          which = c("all", "dd", "distance", "qqchi2",
                    "tolEllipsePlot", "screeplot"),
          classic = FALSE, ask = (which=="all" && dev.interactive()),
          cutoff, id.n, labels.id = rownames(x$X), cex.id = 0.75,
          label.pos = c(4,2), tol = 1e-7, ...)

     covPlot(x,
          which = c("all", "dd", "distance", "qqchi2",
                    "tolEllipsePlot", "screeplot"),
          classic = FALSE, ask = (which == "all" && dev.interactive()),
          m.cov = covMcd(x),
          cutoff = NULL, id.n, labels.id = rownames(x), cex.id = 0.75,
          label.pos = c(4,2), tol = 1e-07, ...)

_A_r_g_u_m_e_n_t_s:

       x: For the 'plot()' method, a 'mcd' object, typically result of
          'covMcd'.
           For 'covPlot()', the numeric data matrix such as the 'X'
          component as returned from 'covMcd'.

   which: string indicating which plot to show.  See the _Details_
          section for a description of the options.  Defaults to
          '"all"'.

 classic: whether to plot the classical distances too. Defaults to
          'FALSE'.

     ask: logical indicating if the user should be _ask_ed before each
          plot, see 'par(ask=.)'.  Defaults to 'which == "all" &&
          dev.interactive()'. 

  cutoff: the cutoff value for the distances.

    id.n: number of observations to be identified by a label.  If not
          supplied, the number of observations with distance larger
          than 'cutoff' is used.

labels.id: vector of labels, from which the labels for extreme points
          will be chosen.  'NULL' uses observation numbers.

  cex.id: magnification of point labels.

label.pos: positioning of labels, for the left half and right half of
          the graph respectively (used as 'text(.., pos=*)').

     tol: tolerance to be used for computing the inverse, see 'solve'. 
          Defaults to 'tol = 1e-7'.

   m.cov: an object similar to those of class '"mcd"'; however only its
          components 'center' and 'cov' will be used.  If missing, the
          MCD will be computed (via 'covMcd()').

     ...: other parameters to be passed through to plotting functions.

_D_e_t_a_i_l_s:

     These functions produce several plots based on the robust and
     classical location and covariance matrix.  Which of them to select
     is specified by the attribute  'which'.  The 'plot' method for
     '"mcd"' objects is calling 'covPlot()' directly, whereas
     'covPlot()' should also be useful for plotting other (robust)
     covariance estimates.  The possible options are:

     '_d_i_s_t_a_n_c_e' index plot of the robust distances

     '_d_d' distance-distance plot

     '_q_q_c_h_i_2' a qq-plot of the robust distances versus the quantiles of
          the chi-squared distribution

     '_t_o_l_E_l_l_i_p_s_e_P_l_o_t' a tolerance ellipse plot, via 'tolEllipsePlot()'

     '_s_c_r_e_e_p_l_o_t' an eigenvalues comparison plot - screeplot

     The Distance-Distance Plot, introduced by Rousseeuw and van
     Zomeren (1990), displays the robust distances versus the classical
     Mahalanobis distances.  The dashed line is the set of points where
     the robust distance is equal to the classical distance. The
     horizontal and vertical lines are drawn at values equal to the
     cutoff which defaults to square root of the 97.5% quantile of a
     chi-squared distribution with p degrees of freedom.  Points beyond
     these lines can be considered outliers.

_R_e_f_e_r_e_n_c_e_s:

     P. J. Rousseeuw and van Zomeren, B. C. (1990). Unmasking
     Multivariate Outliers and Leverage Points. _Journal of the
     American Statistical Association_ *85*, 633-639.

     P. J. Rousseeuw and K. van Driessen (1999) A fast algorithm for
     the minimum covariance determinant estimator. _Technometrics_
     *41*, 212-223.

_S_e_e _A_l_s_o:

     'tolEllipsePlot'

_E_x_a_m_p_l_e_s:

     data(Animals, package ="MASS")
     brain <- Animals[c(1:24, 26:25, 27:28),]
     mcd <- covMcd(log(brain))

     plot(mcd, which = "distance", classic = TRUE)# 2 plots
     plot(mcd, which = "dd")
     plot(mcd, which = "tolEllipsePlot", classic = TRUE)
     op <- par(mfrow = c(2,3))
     plot(mcd) ## -> which = "all" (5 plots)
     par(op)

     ## same plots for another robust Cov estimate:
     data(hbk)
     hbk.x <- data.matrix(hbk[, 1:3])
     cOGK <- covOGK(hbk.x, n.iter = 2, sigmamu = scaleTau2,
                    weight.fn = hard.rejection)
     ## Not run:  covPlot(hbk.x, m.cov = cOGK, classic = TRUE, ask= TRUE)

