<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Question about two-dimensional table in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Question-about-two-dimensional-table/m-p/68197#M3307</link>
    <description>I have an example data,like follows:&lt;BR /&gt;
data patients;&lt;BR /&gt;
   input ID $ 1-4 Name $ 6-16 Sex $ 18 Age 20-21 &lt;BR /&gt;
   Date 23-24 Height 26-27 Weight 29-31 &lt;BR /&gt;
   ActLevel $ 33-36 Fee 38-43;&lt;BR /&gt;
   format fee 6.2; &lt;BR /&gt;
   datalines;&lt;BR /&gt;
2458 Murray, W   M 27  1 72 168 HIGH  85.20&lt;BR /&gt;
2462 Almers, C   F 34  3 66 152 HIGH 124.80&lt;BR /&gt;
2523 Johnson, R  F 43 31 63 137 MOD  149.75&lt;BR /&gt;
2539 LaMance, K  M 51  4 71 158 LOW  124.80&lt;BR /&gt;
2544 Jones, M    M 29  6 76 193 HIGH 124.80&lt;BR /&gt;
2552 Reberson, P F 32  9 67 151 MOD  149.75&lt;BR /&gt;
2555 King, E     M 35 13 70 173 MOD  149.75&lt;BR /&gt;
2563 Pitts, D    M 34 22 73 154 LOW  124.80&lt;BR /&gt;
2571 Nunnelly, A F 44 19 66 140 HIGH 149.75&lt;BR /&gt;
2572 Oberon, M   F 28 17 62 118 LOW   85.20&lt;BR /&gt;
2574 Peterson, V M 30  6 69 147 MOD  149.75&lt;BR /&gt;
2575 Quigley, M  F 40  8 69 163 HIGH 124.80&lt;BR /&gt;
2578 Cameron, L  M 47  5 72 173 MOD  124.80&lt;BR /&gt;
2586 Derber, B   M 25 23 75 188 HIGH  85.20&lt;BR /&gt;
2588 Ivan, H     F 22 20 63 139 LOW   85.20&lt;BR /&gt;
2589 Wilcox, E   F 41 16 67 141 HIGH 149.75&lt;BR /&gt;
2595 Warren, C   M 54  7 71 183 MOD  149.75&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Then I  create a two-dimensional table,like follows:&lt;BR /&gt;
proc tabulate data=patients &lt;BR /&gt;
    style=[font_weight=bold];   &lt;BR /&gt;
   class actlevel;&lt;BR /&gt;
   classlev actlevel / style=[just=left];   &lt;BR /&gt;
   var age height weight / style=[font_size=3];   &lt;BR /&gt;
   keyword all sum / style=[font_width=wide];   &lt;BR /&gt;
   keylabel all="All Patients";   &lt;BR /&gt;
   table (actlevel="Activity Level" &lt;BR /&gt;
         all*[style=[background=yellow]]),        &lt;BR /&gt;
         (age height weight*f=best10.2)*mean /         &lt;BR /&gt;
         style=[background=white]        &lt;BR /&gt;
         misstext=[label="Missing" &lt;BR /&gt;
         style=[font_weight=light]]         &lt;BR /&gt;
         box=[label="Patient Info by Activity Level"          &lt;BR /&gt;
        style=[font_style=italic]];title 'Enhanced Table';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The result is follows:&lt;BR /&gt;
                              ---------------------------------------------------------------------&lt;BR /&gt;
                              |Patient Info by Activity Level|    Age     |   Height   |  Weight  |&lt;BR /&gt;
                              |                              |------------+------------+----------|&lt;BR /&gt;
                              |                              |    Mean    |    Mean    |   Mean   |&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |Activity Level                |            |            |          |&lt;BR /&gt;
                              |------------------------------|            |            |          |&lt;BR /&gt;
                              |HIGH                          |       34.29|       70.14|163.571429|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |LOW                           |       33.75|       67.25|    142.25|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |MOD                           |       40.17|       68.67|160.666667|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |All Patients                  |       36.24|       68.94|157.529412|&lt;BR /&gt;
                              ---------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
I don't understand following two parts:&lt;BR /&gt;
1) the value 'All Patients',how to calculate it? example how to get the result '36.24'?&lt;BR /&gt;
2) (age height weight*f=best10.2)*mean / ,what is the meaning of  'weight*f=best10.2'? How to get the result '163.571429'?&lt;BR /&gt;
&lt;BR /&gt;
Thanks

Message was edited by: EdwardKing</description>
    <pubDate>Mon, 31 Aug 2009 02:16:11 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-08-31T02:16:11Z</dc:date>
    <item>
      <title>Question about two-dimensional table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Question-about-two-dimensional-table/m-p/68197#M3307</link>
      <description>I have an example data,like follows:&lt;BR /&gt;
data patients;&lt;BR /&gt;
   input ID $ 1-4 Name $ 6-16 Sex $ 18 Age 20-21 &lt;BR /&gt;
   Date 23-24 Height 26-27 Weight 29-31 &lt;BR /&gt;
   ActLevel $ 33-36 Fee 38-43;&lt;BR /&gt;
   format fee 6.2; &lt;BR /&gt;
   datalines;&lt;BR /&gt;
2458 Murray, W   M 27  1 72 168 HIGH  85.20&lt;BR /&gt;
2462 Almers, C   F 34  3 66 152 HIGH 124.80&lt;BR /&gt;
2523 Johnson, R  F 43 31 63 137 MOD  149.75&lt;BR /&gt;
2539 LaMance, K  M 51  4 71 158 LOW  124.80&lt;BR /&gt;
2544 Jones, M    M 29  6 76 193 HIGH 124.80&lt;BR /&gt;
2552 Reberson, P F 32  9 67 151 MOD  149.75&lt;BR /&gt;
2555 King, E     M 35 13 70 173 MOD  149.75&lt;BR /&gt;
2563 Pitts, D    M 34 22 73 154 LOW  124.80&lt;BR /&gt;
2571 Nunnelly, A F 44 19 66 140 HIGH 149.75&lt;BR /&gt;
2572 Oberon, M   F 28 17 62 118 LOW   85.20&lt;BR /&gt;
2574 Peterson, V M 30  6 69 147 MOD  149.75&lt;BR /&gt;
2575 Quigley, M  F 40  8 69 163 HIGH 124.80&lt;BR /&gt;
2578 Cameron, L  M 47  5 72 173 MOD  124.80&lt;BR /&gt;
2586 Derber, B   M 25 23 75 188 HIGH  85.20&lt;BR /&gt;
2588 Ivan, H     F 22 20 63 139 LOW   85.20&lt;BR /&gt;
2589 Wilcox, E   F 41 16 67 141 HIGH 149.75&lt;BR /&gt;
2595 Warren, C   M 54  7 71 183 MOD  149.75&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Then I  create a two-dimensional table,like follows:&lt;BR /&gt;
proc tabulate data=patients &lt;BR /&gt;
    style=[font_weight=bold];   &lt;BR /&gt;
   class actlevel;&lt;BR /&gt;
   classlev actlevel / style=[just=left];   &lt;BR /&gt;
   var age height weight / style=[font_size=3];   &lt;BR /&gt;
   keyword all sum / style=[font_width=wide];   &lt;BR /&gt;
   keylabel all="All Patients";   &lt;BR /&gt;
   table (actlevel="Activity Level" &lt;BR /&gt;
         all*[style=[background=yellow]]),        &lt;BR /&gt;
         (age height weight*f=best10.2)*mean /         &lt;BR /&gt;
         style=[background=white]        &lt;BR /&gt;
         misstext=[label="Missing" &lt;BR /&gt;
         style=[font_weight=light]]         &lt;BR /&gt;
         box=[label="Patient Info by Activity Level"          &lt;BR /&gt;
        style=[font_style=italic]];title 'Enhanced Table';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The result is follows:&lt;BR /&gt;
                              ---------------------------------------------------------------------&lt;BR /&gt;
                              |Patient Info by Activity Level|    Age     |   Height   |  Weight  |&lt;BR /&gt;
                              |                              |------------+------------+----------|&lt;BR /&gt;
                              |                              |    Mean    |    Mean    |   Mean   |&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |Activity Level                |            |            |          |&lt;BR /&gt;
                              |------------------------------|            |            |          |&lt;BR /&gt;
                              |HIGH                          |       34.29|       70.14|163.571429|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |LOW                           |       33.75|       67.25|    142.25|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |MOD                           |       40.17|       68.67|160.666667|&lt;BR /&gt;
                              |------------------------------+------------+------------+----------|&lt;BR /&gt;
                              |All Patients                  |       36.24|       68.94|157.529412|&lt;BR /&gt;
                              ---------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
I don't understand following two parts:&lt;BR /&gt;
1) the value 'All Patients',how to calculate it? example how to get the result '36.24'?&lt;BR /&gt;
2) (age height weight*f=best10.2)*mean / ,what is the meaning of  'weight*f=best10.2'? How to get the result '163.571429'?&lt;BR /&gt;
&lt;BR /&gt;
Thanks

Message was edited by: EdwardKing</description>
      <pubDate>Mon, 31 Aug 2009 02:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Question-about-two-dimensional-table/m-p/68197#M3307</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-31T02:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Question about two-dimensional table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Question-about-two-dimensional-table/m-p/68198#M3308</link>
      <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
Proc Tabulate uses the class variable ALL to allow you to request a statistic in any dimension of your table. For example, if you had SUM, as the statistic, then ALL would be the SUM statistic. Since you have MEAN as the statistic, then what you see on the line "All Patients" is the GRAND MEAN for Age, Height and Weight across all Activity Levels.&lt;BR /&gt;
 &lt;BR /&gt;
You can verify that this is the grand mean by running a PROC MEANS to verify the numbers:&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
proc means data=patients mean;&lt;BR /&gt;
  class actlevel;&lt;BR /&gt;
  var age height weight;&lt;BR /&gt;
  ways (0 1);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
Since PROC MEANS shows you the N or count that went into the calculation of these means, you can verify the numbers with a calculator.&lt;BR /&gt;
 &lt;BR /&gt;
As for question #2, the number: 163.571429 is the mean of the WEIGHT variable for the HIGH Activity Level. You can verify this number, also with the PROC MEANS output. The difference between PROC MEANS and PROC TABULATE is that PROC TABULATE gives you the syntax to control the arrangement of the dimensions in the table.&lt;BR /&gt;
 &lt;BR /&gt;
The syntax &lt;B&gt;*f=best10.2&lt;/B&gt; tells PROC TABULATE what format to apply to the calculated statistic. I'm not sure why you're applying the BEST format. You could try either of these (F= and FORMAT= are the same thing):&lt;BR /&gt;
[pre]&lt;BR /&gt;
weight*format=10.2&lt;BR /&gt;
weight*f=comma10.1&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
The number of decimal points can be controlled using the number after the period in the format specification.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 31 Aug 2009 04:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Question-about-two-dimensional-table/m-p/68198#M3308</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-08-31T04:52:07Z</dc:date>
    </item>
  </channel>
</rss>

