<?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 Proc tabulate with several vars and several formats for descriptive statistics in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/498967#M80</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'd be happy to receive help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's my code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc tabulate data=people&amp;nbsp;(where=(SAFFL='Y'));&lt;BR /&gt;var AGE weight height BMI;&lt;BR /&gt;table AGE='Age [years]' weight='Weight [kg]' height='Height [cm]' BMI='BMI [kg/m2]', (mean*f=8.1 std*f=8.1 (min median max n)*f=8.)/box='Parameters';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only need the BMI var statistics to be in 8.1 format and the rest in 8.0. I'm not able to do that. The only way I can think of is to create a separate&amp;nbsp;table for BMI and somehow combine them.&amp;nbsp; Is it possible to do it in the above code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You!!&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 06:53:14 GMT</pubDate>
    <dc:creator>dariatri</dc:creator>
    <dc:date>2018-09-26T06:53:14Z</dc:date>
    <item>
      <title>Proc tabulate with several vars and several formats for descriptive statistics</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/498967#M80</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'd be happy to receive help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's my code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc tabulate data=people&amp;nbsp;(where=(SAFFL='Y'));&lt;BR /&gt;var AGE weight height BMI;&lt;BR /&gt;table AGE='Age [years]' weight='Weight [kg]' height='Height [cm]' BMI='BMI [kg/m2]', (mean*f=8.1 std*f=8.1 (min median max n)*f=8.)/box='Parameters';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only need the BMI var statistics to be in 8.1 format and the rest in 8.0. I'm not able to do that. The only way I can think of is to create a separate&amp;nbsp;table for BMI and somehow combine them.&amp;nbsp; Is it possible to do it in the above code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You!!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 06:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/498967#M80</guid>
      <dc:creator>dariatri</dc:creator>
      <dc:date>2018-09-26T06:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with several vars and several formats for descriptive statistics</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/499159#M97</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You&amp;nbsp;might need to associate the 8.1 format with&amp;nbsp;the variable name (BMI) in addition to the statistic keyword.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Use the asterisk (*) operator to associate a statistic keyword with a variable. The N statistic (number of nonmissing values) can be specified in a dimension expression without associating it with a variable. [1]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;This might work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-sas"&gt;table &lt;BR /&gt;AGE='Age [years]' &lt;BR /&gt;weight='Weight [kg]' &lt;BR /&gt;height='Height [cm]' &lt;BR /&gt;BMI='BMI [kg/m2]', &lt;BR /&gt;(&lt;STRONG&gt;BMI*&lt;/STRONG&gt;mean*f=8.1 &lt;STRONG&gt;BMI*&lt;/STRONG&gt;std*f=8.1 (min median max n)*f=8.)&lt;BR /&gt;/box='Parameters';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Also, try enclosing the stat names in quotation marks:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Statistical keywords should be enclosed by single or double quotation marks to ensure that the keyword element is treated as a statistical keyword and not treated as a variable [1].&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Reference&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[1]&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p1g617vn5t3p39n0z9o601rw74jz.htm&amp;amp;locale=en#p0zbqfn4hn8c7wn17v006om1p3ah"&gt;TABULATE Procedure: keywords for statistics in dimension expressions&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 16:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/499159#M97</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2018-09-26T16:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with several vars and several formats for descriptive statistics</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/499163#M99</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230263"&gt;@dariatri&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'd be happy to receive help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That's my code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc tabulate data=people&amp;nbsp;(where=(SAFFL='Y'));&lt;BR /&gt;var AGE weight height BMI;&lt;BR /&gt;table AGE='Age [years]' weight='Weight [kg]' height='Height [cm]' BMI='BMI [kg/m2]', (mean*f=8.1 std*f=8.1 (min median max n)*f=8.)/box='Parameters';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only need the BMI var statistics to be in 8.1 format and the rest in 8.0. I'm not able to do that. The only way I can think of is to create a separate&amp;nbsp;table for BMI and somehow combine them.&amp;nbsp; Is it possible to do it in the above code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You!!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Easiest may be to use two table statements (you can have many table statements in proc tabulate).&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=people (where=(SAFFL='Y'));
var AGE weight height BMI;
table AGE='Age [years]' 
      weight='Weight [kg]' 
      height='Height [cm]' ,
     (mean*f=8.0 std*f=8.0 (min median max n)*f=8.0)
     /box='Parameters';
table BMI='BMI [kg/m2]', 
     (mean*f=8.1 std*f=8.1 (min median max n)*f=8.1)
     /box='Parameters';
run;&lt;/PRE&gt;
&lt;P&gt;if I understand what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other approach would be to presummarize the data with a procedure such as Proc Means/Summary, possibly transpose and/or round the results as desiredthen use proc Print or Report to display the values with best. format&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 16:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-several-vars-and-several-formats-for/m-p/499163#M99</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-26T16:12:33Z</dc:date>
    </item>
  </channel>
</rss>

