Resources

Documentation Example 4 for PROC ROBUSTREG

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: rregex4                                             */
/*   TITLE: Documentation Example 4 for PROC ROBUSTREG          */
/* PRODUCT: STAT                                                */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Robust Regression                                   */
/*                                                              */
/*   PROCS: ROBUSTREG                                           */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: yonyao (Yonggang Yao)                               */
/*     REF:                                                     */
/*    MISC:                                                     */
/****************************************************************/

data BMI;
   input BMI Age Gender $ @@;
   datalines;
46.16 30.33 F 20.67 31.83 F 30.98 51.33 F 30.71 31.42 F
29.81 30.50 M 19.94 25.08 F 29.97 41.67 F 24.48 26.92 F
34.34 51.25 F 20.24 53.67 F 27.72 60.25 F 32.85 41.67 M
22.75 47.50 F 32.78 22.42 F 43.07 29.50 F 38.34 58.50 F
40.03 39.92 F 21.78 56.42 M 28.77 39.83 F 28.77 28.75 F
29.73 54.25 M 33.75 35.67 M 28.48 35.83 M 22.12 29.58 F
23.51 41.92 M 29.99 60.50 M 24.29 44.50 M 37.70 36.00 F
38.95 20.58 M 24.51 51.00 M 27.14 46.75 F 29.82 59.17 F
31.02 32.75 M 22.10 22.75 F 30.03 44.58 M 20.02 60.67 F
41.52 26.42 F 33.07 33.00 F 46.51 52.25 M 44.87 20.33 M
27.61 41.58 F 31.58 44.42 M 23.62 46.50 M 21.07 36.83 M
23.42 32.83 F 25.68 40.08 M 22.01 26.58 F 23.27 51.17 F
27.51 53.67 F 24.05 56.08 M 20.01 49.92 F 24.45 54.42 F
36.31 45.17 M 30.62 30.92 F 28.09 23.42 M 24.01 46.75 F
18.77 50.08 F 22.89 51.42 M 28.31 60.25 F 25.80 43.58 M
44.19 56.67 F 27.84 41.17 M 25.03 58.75 M 27.51 33.83 F
22.14 31.75 F 33.28 56.42 F 40.58 52.83 F 41.06 37.17 M
18.67 38.92 F 45.98 54.92 M 30.89 60.08 M 28.41 23.25 F
28.60 42.50 F 25.95 48.25 M 25.12 55.33 F 51.67 40.42 F
26.13 46.42 M 31.71 33.42 M 28.86 49.50 M 25.62 54.58 M
39.50 24.75 F 31.06 35.33 M 31.38 23.50 F 33.10 38.08 M
32.07 40.17 M 23.77 31.17 M 28.48 22.75 F 26.89 34.42 M
25.10 46.17 F 34.19 24.33 M 26.87 53.75 M 31.91 33.17 F
30.74 24.08 M 27.44 54.42 M 20.32 26.75 M 23.21 57.58 M
30.04 31.17 M 36.14 44.25 F 42.60 50.75 F 42.38 42.75 M
22.64 37.33 M 42.65 37.92 F 27.87 40.25 M 27.71 43.08 M
29.64 30.75 M 44.46 33.17 F 36.47 60.17 M 35.29 31.75 F
26.61 24.08 F 26.75 58.08 F 23.29 23.83 F 29.38 21.00 F
17.19 22.42 M 29.91 45.75 M 27.48 56.92 F 30.27 48.33 F
51.14 30.25 F 27.01 26.50 F 18.76 55.42 F 23.09 47.75 M
29.51 54.50 F 43.07 46.58 M 28.46 38.50 F 31.67 25.08 F
27.34 32.33 M 22.14 52.08 F 31.06 30.42 F 17.03 21.42 F
24.71 21.42 F 27.42 53.92 F 32.20 29.33 M 21.84 34.50 F
23.61 25.42 M 23.53 35.33 F 32.23 39.92 F 24.81 37.50 M
28.24 42.67 M 34.33 39.58 F 29.13 47.75 M 30.25 36.33 M
44.34 22.50 F 29.75 43.75 M 25.11 36.83 M 23.16 37.33 M
28.62 48.92 F 29.36 49.50 M 29.10 33.33 M 21.13 51.00 F
27.24 26.83 F 33.48 58.58 M 34.38 58.17 M 25.67 41.58 F
33.86 60.50 F 31.76 32.83 F 20.07 32.17 F 25.00 52.75 M
25.41 51.42 F 22.55 29.92 M 26.50 42.67 F 22.68 60.83 F
27.43 58.92 F 29.56 40.42 F 23.61 51.58 F 27.95 35.25 F
23.83 34.67 F 28.50 32.17 M 27.29 34.42 F 40.31 24.50 F
25.84 24.58 F 31.68 20.83 F 25.23 22.00 F 29.10 44.67 M
20.35 24.33 F 40.10 47.42 M 28.03 42.58 F 29.34 30.00 M
16.54 28.58 F 32.51 47.83 F 25.98 56.58 M 29.98 60.83 F
27.53 32.08 M 19.14 40.25 F 21.70 33.08 M 30.82 32.67 M
25.16 29.50 F 26.68 30.50 M 23.04 30.58 M 34.15 35.67 M
20.79 30.67 F 31.74 25.17 M 25.85 54.08 F 31.52 32.08 F
22.51 28.17 F 27.98 35.75 M 31.05 42.83 M 33.32 25.25 F
34.12 45.17 M 32.98 51.58 M 20.56 24.67 F 26.89 46.17 M
25.08 42.92 F 56.11 33.58 M 22.83 22.17 M 35.16 34.75 F
29.72 34.08 F 27.65 46.17 M 26.59 20.75 F 21.51 28.33 F
22.35 40.92 F 22.02 60.33 F 63.42 32.92 F 22.60 29.25 M
23.25 24.00 F 28.56 49.08 F 30.30 40.33 F 38.71 58.83 F
32.25 25.08 F 24.64 29.75 M 34.44 32.83 F 24.99 27.75 M
23.88 35.08 F 21.59 59.42 M 31.43 51.17 F 31.45 53.58 M
27.93 21.75 F 44.60 22.17 F 43.45 48.17 F 21.26 36.33 M
37.32 47.25 F 33.62 48.42 F 28.18 25.42 M 32.53 22.50 M
27.42 28.08 F 21.25 40.00 M 24.59 22.50 F 36.61 38.33 M
32.52 23.08 F 23.59 22.92 F 36.70 42.00 F 23.91 36.83 M
19.90 30.83 F 23.98 22.17 M 23.08 23.42 M 28.57 31.92 F
42.52 53.75 M 32.05 29.42 F 19.73 25.67 M 28.08 56.17 M
26.56 25.25 M 39.16 50.58 F 33.88 32.75 M 22.67 37.50 M
25.03 55.67 M 26.62 20.92 F 18.76 50.58 M 23.17 20.92 M
21.31 30.58 F 26.05 27.92 M 26.05 33.75 F 20.06 23.33 F
23.68 37.58 M 23.70 46.75 M 23.04 54.00 M 38.68 48.75 F
27.09 31.42 F 29.68 55.67 F 32.31 51.42 M 30.50 38.33 M
32.25 42.58 M 20.94 21.58 F 29.45 26.17 M 23.68 20.50 F
22.86 23.83 M 24.15 38.92 M 23.12 21.58 F 33.88 56.50 F
28.02 25.08 M 28.86 53.92 M 26.94 22.42 F 20.80 20.00 M
34.12 23.17 F 23.14 27.67 M 49.76 48.75 F 42.02 30.67 F
28.07 28.92 M 26.97 56.33 M 29.41 49.33 M 26.48 52.50 M
21.39 21.75 F 38.23 39.58 F 52.81 20.75 F 18.18 29.00 F
27.47 33.75 F 31.18 20.67 M 30.13 56.17 M 27.71 26.75 M
24.04 20.50 F 18.72 25.58 F 31.05 27.58 F 41.02 29.92 F
29.07 56.42 F 23.66 32.25 M 26.17 59.17 M 25.75 24.83 F
30.16 28.50 M 27.14 41.75 M 20.02 37.83 F 40.24 27.75 F
25.19 26.83 M 27.33 52.92 F 24.57 41.25 F 22.43 28.58 F
27.20 37.83 F 23.99 60.08 M 37.90 36.50 M 22.08 34.50 F
39.22 31.25 F 35.25 55.17 M 29.73 28.92 M 32.50 42.75 M
28.69 38.42 F 24.56 37.75 M 26.79 44.92 F 29.27 23.83 F
33.03 51.58 M 30.99 31.83 M 22.24 25.50 M 25.76 20.25 F
44.16 43.67 F 45.10 36.75 M 27.39 32.08 F 19.22 36.58 M
24.87 58.33 M 38.78 42.25 M 21.65 54.00 F 35.78 56.58 F
21.54 53.92 M 33.09 46.83 F 22.96 34.33 F 20.46 21.33 F
34.70 53.58 M 24.21 35.58 F 19.19 20.42 F 32.36 46.25 F
27.53 21.25 M 37.66 52.17 M 37.51 59.67 F 30.49 50.67 M
23.32 24.83 F 39.01 21.17 M 27.46 53.17 F 24.88 37.42 M
26.06 53.58 M 33.80 33.67 F 21.09 34.17 F 26.58 24.17 M
24.48 24.67 F 31.27 50.00 F 28.94 33.75 F 28.99 33.08 F
27.32 46.58 M 41.36 57.58 M 24.46 32.42 F 22.94 51.08 M
25.32 49.42 M 41.59 58.25 M 46.58 28.17 F 33.06 50.42 M
24.12 57.00 F 26.51 28.50 M 39.18 41.17 F 27.15 53.17 M
25.01 28.67 M 28.45 26.67 F 31.22 23.58 M 21.39 42.50 F
33.77 58.50 M 19.62 21.17 M 22.48 24.00 F 22.16 53.17 F
39.18 51.25 F 27.31 46.75 F 23.11 26.83 F 26.11 34.83 M
34.02 29.25 F 27.44 26.83 F 39.36 57.75 M 31.18 41.42 M
22.97 31.42 M 45.40 30.42 F 39.00 53.83 M 23.01 54.50 F
23.72 33.17 F 34.51 43.58 M 31.49 58.50 M 22.77 31.67 M
28.51 22.25 M 24.58 40.75 M 28.62 38.17 M 24.36 21.17 M
38.58 56.25 F 32.04 21.00 M 25.68 31.17 F 41.14 33.17 F
29.19 22.67 F 29.61 50.67 F 33.32 33.25 F 22.31 23.83 F
30.30 33.25 F 25.20 46.25 F 26.40 36.67 M 30.27 20.42 F
24.84 45.17 F 23.39 25.75 F 33.52 50.08 F 32.58 38.17 F
18.67 22.42 M 23.04 33.42 F 39.93 53.42 F 19.41 24.50 F
20.18 20.50 M 34.86 36.92 M 22.13 22.50 F 31.01 34.50 M
19.45 26.00 M 35.86 28.17 M 26.28 47.08 F 44.67 45.17 F
26.62 21.17 F 30.39 25.33 F 34.05 45.92 F 30.48 21.75 M
49.51 59.17 F 22.92 42.33 M 28.19 47.17 F 18.99 21.25 F
27.68 38.58 F 22.17 36.00 F 20.58 22.50 M 19.33 21.92 M
30.85 47.83 M 26.91 59.42 F 19.55 20.25 F 37.15 57.17 M
27.35 25.25 M 29.26 45.25 M 20.91 29.75 F 28.72 46.08 M
34.17 38.92 F 28.84 52.58 M 29.36 60.33 F 45.05 31.25 F
25.53 47.25 F 29.41 55.00 F 30.96 51.50 M 21.39 22.67 F
20.13 20.17 F 33.04 49.00 M 37.45 25.08 F 19.51 37.58 F
24.10 59.67 F 28.36 39.17 M 26.68 39.75 M 29.69 31.83 M
32.88 46.75 M 21.61 21.42 F 29.03 26.17 M 27.81 41.83 M
26.70 50.92 M 29.67 58.58 F 22.42 59.92 F 24.66 60.00 F
21.95 37.83 F 19.38 22.08 M 20.59 38.50 M 50.75 51.67 F
33.94 53.42 F 23.29 58.83 F 28.41 52.92 F 33.86 44.00 F
40.47 35.58 F 25.79 39.08 M 19.81 25.50 M 32.35 34.58 M
24.37 21.33 M 17.60 24.50 F 30.21 22.75 M 31.74 20.92 M
19.12 45.50 M 19.21 23.58 M 27.19 45.50 M 50.33 36.25 F
20.30 34.83 M 28.43 44.25 F 34.97 25.25 F 23.55 55.92 F
45.18 46.00 M 20.97 58.00 M 30.50 48.00 F 32.62 41.25 M
42.51 31.08 F 34.38 44.50 F 27.93 30.50 F 40.79 54.92 F
52.49 40.17 M 20.99 32.42 F 21.87 21.50 F 30.67 34.08 M
29.33 31.33 F 31.31 48.67 M 21.58 38.92 F 39.89 32.50 M
31.20 48.67 M 27.08 60.08 M 27.62 25.33 M 28.12 27.08 M
24.12 30.33 F 23.25 34.50 F 26.88 46.58 M 28.40 54.33 F
32.13 48.50 F 24.41 28.00 M 32.88 24.08 M 23.21 34.50 F
24.47 60.83 F 23.94 59.17 M 25.23 45.42 M 34.23 52.25 F
22.10 49.50 F 30.71 41.08 M 32.09 40.75 F 28.43 24.67 F
27.03 54.83 M 32.18 31.75 F 22.10 22.83 F 18.91 25.50 F
28.54 49.17 F 35.48 60.92 F 32.88 47.00 M 36.82 24.17 F
25.53 39.50 M 27.52 44.17 F 22.94 39.67 F 33.73 28.42 F
24.66 25.83 M 27.59 49.33 M 37.15 44.42 M 26.69 51.67 M
31.84 45.83 F 42.54 29.58 F 35.76 30.83 F 38.73 59.67 F
24.08 53.08 M 29.48 32.08 F 39.69 51.75 F 27.29 26.50 M
38.23 36.83 F 21.57 41.75 F 31.80 45.33 F 23.33 36.83 M
31.96 44.17 F 30.84 53.83 M 23.15 36.17 F 25.53 37.42 M
31.85 60.83 M 28.44 21.25 F 26.05 40.33 M 33.39 46.75 M
24.50 35.42 F 23.20 56.25 M 25.22 47.92 F 30.09 22.58 F
23.00 43.42 M 28.58 42.58 F 23.21 22.17 M 23.58 27.17 M
39.16 59.75 M 26.40 31.25 F 24.43 23.67 F 24.45 53.58 M
18.49 33.08 F 21.19 43.83 F 22.61 51.50 F 32.21 39.17 F
35.62 50.42 F 24.89 37.83 M 34.37 36.92 F 28.11 39.75 M
26.10 58.17 M 23.48 46.00 M 21.45 37.25 F 36.55 58.92 M
22.63 20.83 F 31.99 21.25 F 36.05 31.25 M 20.03 34.08 F
19.83 40.67 M 20.05 46.00 F 23.94 56.92 F 34.19 36.17 F
22.70 36.83 M 33.04 52.67 M 37.30 40.00 M 33.34 25.58 F
27.30 34.50 M 17.75 44.83 F 24.45 31.92 F 20.98 56.75 M
21.17 30.92 M 22.70 48.00 F 24.16 29.25 M 30.29 60.67 F
33.01 23.58 F 20.70 44.58 M 21.90 48.17 M 30.27 60.83 M
27.47 27.00 M 34.12 38.75 M 35.72 23.08 F 24.76 57.00 M
40.54 41.42 F 24.12 48.58 M 32.07 33.50 M 44.90 37.17 M
38.29 38.92 M 25.91 60.17 F 29.05 26.17 M 30.45 36.42 F
28.74 25.33 F 28.69 23.25 F 31.08 21.17 M 36.97 38.17 F
28.01 46.25 F 46.71 53.08 M 28.11 43.08 F 20.59 42.08 F
34.33 56.17 M 25.47 21.25 F 33.12 50.00 M 26.34 20.50 M
26.51 30.17 F 29.31 34.00 F 25.60 31.17 M 31.84 37.75 F
30.41 43.00 F 24.73 29.50 F 38.25 52.17 F 21.99 29.17 F
27.74 26.17 F 25.79 41.00 M 33.55 52.17 M 22.62 43.42 F
39.66 50.75 F 30.15 36.83 M 29.89 33.42 F 19.97 21.42 F
17.36 26.08 F 18.76 47.67 F 19.16 20.75 M 33.94 25.67 M
28.06 50.08 M 19.14 49.50 F 28.93 32.00 M 34.64 50.58 F
30.39 30.50 M 21.96 27.25 M 22.89 24.67 F 24.31 43.58 M
28.96 35.92 M 29.55 51.67 F 32.91 37.42 M 26.37 26.00 F
25.65 31.42 M 34.40 23.00 F 27.83 30.67 M 38.79 60.08 F
19.15 22.83 F 37.95 30.33 F 22.84 40.17 M 36.63 53.17 F
27.90 41.50 M 46.06 60.75 M 34.22 28.92 M 21.86 53.00 M
27.39 53.67 F 32.63 31.83 F 16.01 21.67 M 35.32 55.92 F
28.41 39.00 M 17.66 26.67 M 32.68 38.92 M 24.90 30.67 M
25.81 30.75 F 26.62 60.50 F 19.24 51.33 M 24.77 35.83 M
26.43 49.08 M 19.61 26.17 F 33.82 47.67 F 32.01 39.50 M
26.83 43.58 M 21.86 48.17 F 29.98 43.67 M 22.15 37.75 F
39.06 41.17 F 46.92 24.67 F 25.24 44.58 F 25.17 45.75 F
34.94 23.92 F 25.53 25.42 M 26.71 56.50 M 26.88 60.58 F
28.31 36.33 M 35.52 46.42 F 27.24 53.83 F 20.68 37.08 F
20.64 21.75 F 18.33 29.92 M 46.34 47.17 F 37.27 46.92 F
23.12 52.17 F 40.36 46.75 F 30.77 54.83 M 23.65 26.33 M
32.43 41.58 M 31.34 55.33 F 21.50 24.67 M 26.01 45.08 M
18.74 29.00 M 33.99 25.75 M 28.76 47.92 M 29.76 60.08 M
26.48 47.58 F 21.01 41.75 M 27.87 53.33 M 37.55 41.58 F
29.60 60.08 M 24.74 42.08 M 24.09 42.50 M 31.34 59.83 M
23.50 45.58 M 33.32 42.33 F 26.44 29.83 M 30.52 42.33 M
38.62 48.75 F 30.94 20.17 M 23.56 31.00 M 34.36 48.58 M
45.21 47.92 M 30.56 59.92 F 34.12 34.92 M 20.66 24.75 F
26.65 27.33 M 39.07 43.83 F 25.09 26.50 M 31.78 30.33 M
27.41 41.42 M 35.65 24.58 M 27.95 56.58 M 37.96 24.42 F
21.92 41.67 F 21.14 46.33 F 38.90 49.58 F 21.52 34.33 F
22.81 21.25 M 17.60 44.50 F 43.25 60.25 M 34.64 34.75 F
31.09 42.33 F 21.40 33.42 F 42.46 30.92 F 28.33 30.17 F
21.96 28.17 F 28.43 28.58 F 26.14 31.00 F 34.69 38.33 M
29.46 33.83 F 26.29 54.42 M 40.58 59.00 F 20.24 39.42 M
23.17 34.67 M 29.44 43.83 M 42.93 37.42 F 25.06 22.42 M
29.48 58.50 M 30.33 43.58 M 36.91 28.58 F 19.69 37.75 F
25.97 57.08 F 26.87 33.42 M 27.76 24.42 F 28.85 46.75 M
21.86 20.75 M 22.39 48.25 M 23.84 57.17 M 44.12 57.00 F
22.37 27.67 F 39.17 33.08 M 22.25 43.25 F 25.76 49.92 M
26.64 50.42 F 28.53 53.42 M 52.85 44.50 F 22.83 31.42 F
24.45 49.08 F 27.37 41.00 M 43.94 53.58 F 23.65 35.67 M
24.56 22.58 M 32.13 30.17 F 40.20 28.08 F 24.50 28.75 M
33.16 36.67 F 26.06 46.58 F 28.86 31.58 M 28.55 36.83 M
30.65 51.42 M 26.54 33.42 M 26.42 34.50 M 32.00 44.58 M
25.19 32.67 F 30.12 54.33 F 18.84 50.75 F 24.36 32.67 M
50.75 60.00 F 25.85 31.25 M 24.38 21.33 M 24.06 22.00 F
22.70 25.83 F 27.73 39.92 M 28.24 34.25 M 26.95 27.33 F
27.17 51.08 M 27.01 50.58 M 27.41 45.67 M 34.34 27.83 M
33.61 26.67 M 28.87 25.25 M 22.77 29.50 M 24.40 28.58 F
28.40 34.08 M 24.70 39.17 F 23.00 46.17 M 28.81 49.08 M
28.60 29.67 F 23.36 31.08 M 29.90 45.83 F 28.75 55.50 F
29.04 60.58 M 32.65 40.42 F 22.08 54.33 M 33.87 53.42 F
34.01 52.08 M 28.58 37.08 F 25.83 60.17 M 27.84 48.58 M
33.96 28.92 F 30.34 31.92 M 31.05 35.25 M 25.67 50.33 M
24.30 47.42 F 29.96 48.83 F 39.55 31.00 F 29.62 22.67 M
24.08 42.25 M 31.91 47.75 M 24.05 43.75 F 28.92 47.67 M
19.35 45.08 F 25.97 25.67 M 20.38 33.42 M 29.02 53.33 F
29.09 26.00 M 27.87 56.17 M 33.45 36.83 F 19.71 42.00 F
31.44 28.58 F 21.79 60.25 M 29.73 46.50 M 37.22 48.42 F
23.89 41.67 F 19.19 58.33 M 24.36 27.42 F 43.27 58.00 F
20.72 21.75 F 21.43 21.33 F 40.51 55.92 F 29.48 39.25 F
23.92 21.33 M 32.79 20.83 M 27.29 28.33 M 22.44 30.42 M
29.47 29.17 F 26.40 55.75 F 35.57 44.42 M 37.75 23.25 F
19.78 46.75 F 29.56 52.17 F 33.49 37.75 F 31.34 41.50 F
24.14 24.92 F 27.66 53.00 M 25.40 25.92 M 29.86 22.58 M
33.08 22.25 M 22.80 50.25 M 27.84 31.25 F 29.80 58.33 F
37.38 27.75 F 46.36 28.50 F 35.63 28.25 M 23.29 29.42 M
32.79 47.25 M 24.21 54.75 M 38.74 22.50 M 25.28 31.58 M
21.29 38.67 M 30.18 32.17 M 27.09 23.92 F 36.75 28.25 F
29.51 22.33 F 29.40 32.92 M 19.24 43.75 F 22.77 52.42 F
29.04 44.50 F 46.25 59.67 F 35.14 26.33 M 22.81 31.25 M
25.79 20.50 M 40.33 35.83 F 29.33 47.83 M 24.26 25.08 F
16.58 43.83 M 25.65 26.75 M 29.44 37.00 M 25.69 20.75 F
36.30 33.58 F 34.02 27.58 F 23.24 24.67 M 21.48 29.75 F
20.69 29.50 M 21.10 52.08 M 38.11 46.00 M 28.34 54.83 M
32.36 54.92 F 26.07 42.58 F 24.02 21.17 M 23.78 21.83 M
23.90 42.33 F 28.46 20.67 F 32.46 59.33 F 32.32 32.00 F
21.20 60.92 M 22.90 56.92 F 28.93 56.42 F 27.87 28.00 M
29.89 21.42 M 28.55 50.92 M 29.61 56.92 F 31.49 28.00 F
33.95 56.83 F 24.09 57.25 F 23.25 34.33 F 21.82 37.33 F
33.16 50.17 M 31.48 45.17 M 28.39 47.58 F 35.67 36.25 F
37.53 24.17 F 24.04 45.25 F 33.04 20.50 F 33.70 55.67 F
28.12 35.42 M 25.66 60.75 M 26.20 54.75 M 18.94 22.08 F
41.74 57.17 M 22.28 32.17 M 32.32 54.33 M 26.20 26.17 M
25.18 57.42 M 34.19 29.75 F 44.10 43.00 F 28.21 42.42 F
26.98 42.50 F 29.44 39.75 M 25.60 52.67 F 19.30 22.00 F
26.53 27.92 F 23.77 29.00 F 29.86 60.58 M 25.41 44.08 M
26.53 24.83 M 33.33 42.08 F 30.52 32.50 F 31.89 38.17 F
32.20 35.92 F 21.73 26.67 M 32.10 39.33 M 25.13 51.75 M
;

proc sort data=bmi;
   by age;
run;

proc sgplot data=bmi;
   scatter x=age y=bmi/group=gender;
run;

proc glmselect data=bmi;
   class gender;
   effect Age_Sp=spl(age/degree=2 knotmethod=percentiles(3));
   model bmi = gender age_sp /selection=none showpvalues;
   output out=out_ols P=pred R=res;
run;

proc robustreg data=bmi method=s seed=100;
   class gender;
   effect Age_Sp=spl(age/degree=2 knotmethod=percentiles(3));
   model bmi = gender age_sp;
   output out=out_s P=pred R=res;
run;

data out2_s;
   set out_s;
   if gender="F" then label="F, S  ";
   if gender="M" then label="M, S  ";
run;

data out2_ols;
   merge bmi out_ols;
   if gender='F' then label='F, OLS';
   if gender='M' then label='M, OLS';
   keep pred bmi gender age label;
run;

data out2;
   set out2_ols out2_s;
run;

proc sgplot data=out2;
   series x=age y=pred/group=label;
run;

data three;
   set bmi;
   where bmi<38.315;
run;

proc robustreg data=three method=s seed=100;
   class gender;
   effect Age_Sp=spl(age/degree=2 knotmethod=percentiles(3));
   model bmi = gender age_sp;
   output out=out_s P=pred R=res;
run;

data out2_s;
   set out_s;
   if gender="F" then label="F, S  ";
   if gender="M" then label="M, S  ";
run;

proc glmselect data=three outdesign=four;
   class gender;
   effect Age_Sp=spl(age/degree=2 knotmethod=percentiles(3));
   model bmi = gender age_sp /selection=none showpvalues;
   output out=out_ols P=pred R=res;
run;

data out2_ols;
   merge three out_ols;
   if gender='F' then label='F, OLS';
   if gender='M' then label='M, OLS';
   keep pred bmi gender age label;
run;

data out2;
   set out2_ols out2_s;
run;

proc sgplot data=out2;
   series x=age y=pred/group=label;
run;
ods graphics off;