I have been trying to estimate robust Mahalanobis distances in R for a set of three regressors that includes one dummy variable. Initially, I tried generating robust MCD estimates and their associated VCE using cob.rob. However, when I did so I received the following error message: "Error in solve.default(cov, ...) : Lapack routine dgesv: system is exactly singular". I believe that the MCD estimator involves subsampling and that the parameter for the discrete variable could not be identified in one of the subsamples due to insufficient variance. When using the minimum volume ellipsoid (MVE) estimator, I did not experience any problems. My code is given below. x<-cbind(c0[,3], c0[,7], c0[,8]) rest<-cov.rob(x, method = "mve", nsamp = "exact", cor=FALSE) xrd<-mahalanobis(x, rest$center, rest$cov, inverted=FALSE) xrd<-xrd^.5 d0<-ifelse(xrd> 3.0575159,1,0) Can anyone explain to me why the MVE estimator is able to accommodate discrete variables, whereas the MCD estimator cannot do so? I would like to be certain that the method I used to estimate robust distances is valid in light of the inclusion of a discrete variable in the regressor set. -- Jim James W. Shaw, Ph.D., Pharm.D., M.P.H. Assistant Professor Department of Pharmacy Administration College of Pharmacy University of Illinois at Chicago 833 South Wood Street, M/C 871, Room 266 Chicago, IL 60612 Tel.: 312-355-5666 Fax: 312-996-0868 Mobile Tel.: 215-852-3045
[RsR] Estimating robust distances in R (MVE vs. MCD)
1 message · James Shaw