Diagnostic Plots for Robust Regression
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: ROBUST6 */
/* TITLE: Diagnostic Plots for Robust Regression */
/* PRODUCT: IML */
/* DATA: */
/* */
/* SUPPORT: Rick Wicklin UPDATE: SEP 2013 */
/* REF: */
/* MISC: */
/* */
/****************************************************************/
%include sampsrc(robustmc); /* define graphing modules */
proc iml;
load module=_all_; /* load graphing modules */
/* Obs X1 X2 X3 Y Stack Loss data */
SL = { 1 80 27 89 42,
2 80 27 88 37,
3 75 25 90 37,
4 62 24 87 28,
5 62 22 87 18,
6 62 23 87 18,
7 62 24 93 19,
8 62 24 93 20,
9 58 23 87 15,
10 58 18 80 14,
11 58 18 89 14,
12 58 17 88 13,
13 58 18 82 11,
14 58 19 93 12,
15 50 18 89 8,
16 50 18 86 7,
17 50 19 72 8,
18 50 19 79 8,
19 50 20 80 9,
20 56 20 82 15,
21 70 20 91 15 };
x = SL[, 2:4]; y = SL[, 5];
LMSOpt = j(9,1,.);
MCDOpt = j(5,1,.);
MCDOpt[5]= -1; /* nrep: all subsets */
run RDPlot("LMS", LMSOpt, MCDOpt, y, x);