Thursday, April 28, 2011

SAS ODS: simple course 1

ods listing close;
ods html path='c:\sasdata' body='ods01.html';
proc format;
    value $sexfmt  'F'='Female'
                     'M'='Male';
      value $sexback 'F'='red'
                     'M'='Green';
      value $actback 'LOW'='cxBBDDCC'
                   'MOD'='cxAACCBB'
                   'HIGH'='cx99BBAA';
run;
proc tabulate data=sasuser.admit format=4.1 style={background=ywh};;
      var fee / style=<parent>;
      var age height weight / style={background=yellow};
      class sex actlevel / style={background=white};
      classlev sex / style={background=$sexback.};
      classlev actlevel / style={background=$actback.};
      table sex*actlevel*(age height weight fee*{style=<parent>}), min max mean sum / box={style={background=ltgray}};
      keyword min max mean sum/ style={background=orange};
      format sex $sexfmt.;
run;
ods html close;
ods listing;

The SAS System

BOX Min keyword Max keyword Mean keyword Sum keyword
Sex CLASS ActLevel CLASS   34.0 44.0 39.8 159
Female
CLASSLEV
     +
$sexcolr.
HIGH CLASSLEV
     +
$actcolr.
Age VAR
Height VAR 66.0 69.0 67.0 268
Weight VAR 140 163 149 596
Fee VAR+
<parent>
125 *{style=<parent>} 150 *{style=<parent>} 137 *{style=<parent>} 549 *{style=<parent>}
LOW CLASSLEV
     +
$actcolr.
Age VAR 22.0 49.0 32.5 130
Height VAR 61.0 64.0 62.5 250
Weight VAR 118 172 138 552
Fee VAR+
<parent>
85.2 150 111 445
MOD CLASSLEV
     +
$actcolr.
Age VAR 32.0 43.0 39.3 118
Height VAR 63.0 67.0 65.0 195
Weight VAR 123 151 137 411
Fee VAR+
<parent>
125 150 141 424
Male
CLASSLEV
     +
$sexcolr.
HIGH CLASSLEV
     +
$actcolr.
Age 25.0 29.0 27.0 81.0
Height 72.0 76.0 74.3 223
Weight 168 193 183 549
Fee 85.2 125 98.4 295
LOW CLASSLEV
     +
$actcolr.
Age 34.0 60.0 48.3 145
Height 71.0 73.0 71.7 215
Weight 154 191 168 503
Fee 125 150 133 399
MOD CLASSLEV
     +
$actcolr.
Age 30.0 54.0 41.5 166
Height 69.0 72.0 70.5 282
Weight 147 183 169 676
Fee 125 150 144 574

No comments:

Post a Comment