title: SAS proc tabulate
body: <p>I am trying to create a table like this:
  <img src="https://i.stack.imgur.com/FT5Zk.png" alt="Demog"></p>
  
  <p>Here's my code which is not working:</p>
  
  <pre><code>proc tabulate data=temp out = t1;
    class  age gender ethnic height TRT TREATGR;
    table  ethnic * (N) gender  * (N) age * (n mean median min max) height * (n mean median min max),  
        TREATGR*TRT*N;
  run;
  </code></pre>
  
  <p>Here's the log:</p>
  
  <p>127  proc tabulate data=temp out = t1;
  128    class  age gender ethnic height TRT TREATGR;
  129    table  ethnic * (N) gender  * (N) age * (n mean median min max) height * (n mean median min
  129! max),
  130            TREATGR<em>TRT</em>N;
  131  run;</p>
  
  <p>ERROR: There are multiple statistics associated with a single table cell in the following nesting :
         ETHNIC * N * TREATGR * TRT * N.
  ERROR: There are multiple statistics associated with a single table cell in the following nesting :
         GENDER * N * TREATGR * TRT * N.
  ERROR: There are multiple statistics associated with a single table cell in the following nesting :
         AGE * N * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting : AGE
         * Mean * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting : AGE
         * Median * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting : AGE
         * Min * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting : AGE
         * Max * TREATGR * TRT * N.
  ERROR: There are multiple statistics associated with a single table cell in the following nesting :
         HEIGHT * N * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting :
         HEIGHT * Mean * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting :
         HEIGHT * Median * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting :
         HEIGHT * Min * TREATGR * TRT * N.
  ERROR: Statistic other than N was requested without analysis variable in the following nesting :
         HEIGHT * Max * TREATGR * TRT * N.
  NOTE: The SAS System stopped processing this step because of errors.
  WARNING: The data set WORK.T1 may be incomplete.  When this step was stopped there were 0
           observations and 0 variables.
  WARNING: Data set WORK.T1 was not replaced because this step was stopped.
  NOTE: PROCEDURE TABULATE used (Total process time):
        real time           0.01 seconds
        cpu time            0.01 seconds</p>
  
  <p>But this works </p>
  
  <pre><code>proc tabulate data=temp out = t1;
    class  age gender ethnic height TRT TREATGR;
    table  ethnic  gender  age  height ,  
    TREATGR*TRT*N;
  run;
  </code></pre>
  
  <p>But it lits all the age and heights.</p>