|
Chapter Contents |
Previous |
Next |
| Robust Regression Examples |
The following data, consisting of the body weights (in kilograms) and brain weights (in grams) of N=28 animals, are reported by Jerison (1973) and can be found also in Rousseeuw and Leroy (1987, p. 57). Instead of the original data, this example uses the logarithms of the measurements of the two variables.
title "*** Brainlog Data: Do MVE ***";
aa={ 1.303338E-001 9.084851E-001 ,
2.6674530 2.6263400 ,
1.5602650 2.0773680 ,
1.4418520 2.0606980 ,
1.703332E-002 7.403627E-001 ,
4.0681860 1.6989700 ,
3.4060290 3.6630410 ,
2.2720740 2.6222140 ,
2.7168380 2.8162410 ,
1.0000000 2.0606980 ,
5.185139E-001 1.4082400 ,
2.7234560 2.8325090 ,
2.3159700 2.6085260 ,
1.7923920 3.1205740 ,
3.8230830 3.7567880 ,
3.9731280 1.8450980 ,
8.325089E-001 2.2528530 ,
1.5440680 1.7481880 ,
-9.208187E-001 .0000000 ,
-1.6382720 -3.979400E-001 ,
3.979400E-001 1.0827850 ,
1.7442930 2.2430380 ,
2.0000000 2.1959000 ,
1.7173380 2.6434530 ,
4.9395190 2.1889280 ,
-5.528420E-001 2.787536E-001 ,
-9.136401E-001 4.771213E-001 ,
2.2833010 2.2552720 };
By default, the MVE subroutine (like the MINVOL subroutine) uses
only 1500 randomly selected subsets rather than all subsets.
The following specification of the options
vector requires that all 3276 subsets of 3 cases
out of 28 cases are generated and evaluated:
title2 "***MVE for BrainLog Data***";
title3 "*** Use All Subsets***";
optn = j(8,1,.);
optn[1]= 3; /* ipri */
optn[2]= 1; /* pcov: print COV */
optn[3]= 1; /* pcor: print CORR */
optn[6]= -1; /* nrep: all subsets */
call mve(sc,xmve,dist,optn,aa);
Specifying optn[1]=3, optn[2]=1, and optn[3]=1 requests that all output be printed. Therefore, the first part of the output shows the classical scatter and correlation matrix.
Output 9.4.1: Some Simple Statistics
The second part of the output shows the results of the combinatoric optimization (complete subset sampling).
Output 9.4.2: Iteration History for MVE
| |||||||||||||||||||||||||||||||||||||||||||||||||
The third part of the output shows the optimization results after local improvement.
Output 9.4.3: Table of MVE Results
| ||||||||||||||||||||||||||||||||||||||
The final output presents a table containing the classical Mahalanobis distances, the robust distances, and the weights identifying the outlier observations.
Output 9.4.4: Mahalanobis and Robust Distances
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Again, you can call the subroutine scatmve(), which is included in the sample library in file robustmc.sas, to plot the classical and robust confidence ellipsoids:
optn = j(8,1,.); optn[6]= -1;
vnam = { "Log Body Wgt","Log Brain Wgt" };
filn = "brl";
titl = "BrainLog Data: Use All Subsets";
call scatmve(2,optn,.9,aa,vnam,titl,1,filn);
The output follows.
Output 9.4.5: BrainLog Data: Classical and Robust Ellipsoid
|
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.