<?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 Re: should i use PROC tabulate or? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495134#M21700</link>
    <description>&lt;P&gt;thanks, Reeza and ballardw. I believe I need to use proc means and proc report to display. anyone has sample code to create a table like this? thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table2.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23236i5E6154A7D31B8EEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="table2.jpg" alt="table2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 02:11:49 GMT</pubDate>
    <dc:creator>magicdj</dc:creator>
    <dc:date>2018-09-13T02:11:49Z</dc:date>
    <item>
      <title>should i use PROC tabulate or?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495060#M21697</link>
      <description>&lt;P&gt;I try to display N MEAN(SD) se cv q1 median q3 [MIN; MAX] geomean by age group&lt;/P&gt;&lt;P&gt;MEAN(SD) [MIN; MAX] should be display like that in character format.&lt;/P&gt;&lt;P&gt;but, my result is like that:&lt;/P&gt;&lt;P&gt;I have picture format and prefix, but still missing ( or [, also the header Mean and (SD) separate from each other.&lt;/P&gt;&lt;P&gt;I don't know what's the best way to solve the problem.&lt;/P&gt;&lt;P&gt;hope to get some help. &amp;nbsp;thanks a lot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23231i687A7FFF97474E8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.jpg" alt="table.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by age;
run;

data c1;
  set class;
   Weightln=log10(Weight);
run;

proc sort data=c1;by age   ;


PROC MEANS DATA=c1  NOPRINT; 
     BY  age  ;   
     VAR Weight;  
   OUTPUT OUT=AB
    N=N0   
	MEAN=Mean0  
	CV=CV0   
	STD=SD0  
	STDERR=SE0  
	LCLM=LCLM   
	UCLM=UCLM  
    MIN=MIN0  
	Q1=Q10  
	MEDIAN=Median0  
    Q3=Q30  
	MAX=MAX0;   
RUN;


proc means data=c1 noprint;
var Weightln;
by age ;
output out=cd mean=logmean var=varlog  ;
run;
data gcd;

  set cd;

  geomean=round(exp(logmean), .001); 

run;

proc sql;
  create table all as
  select a.*,b.geomean
  from AB a
  left join gcd b
  on a.Age=b.age ;
quit;


proc format;
picture mnf (round) 

low-high = '009.99';
	picture sdf  (round)

low-high = ' 009.99)'
	                  .='N/A)'
 ( prefix = '(' );

	picture minf  (round) 
low-high = '009.99;'
      ( prefix = '[' );

	picture maxf  (round)
low-high = '009.99]';
   run;

PROC tabulate data=all  ORDER=data; 

  CLASS age;   
   VAR  n0 MEAN0 SD0 se0 cv0  q10  median0  q30 MIN0 MAX0 geomean ;
   keyword mean / style=[just=R];
keyword StD / style=[just=L];
   TABLE   age=""   , 
(
	n0='n'*max=''*f=4.  
    mean0='Mean'*max=''*[style=[just=R cellwidth=70 ] f=mnf.]
	SD0='(SD)'*max=''*[style=[just=L cellwidth=75 ] f=sdf.]
	SE0='SE'*max=''*f=8.2 
	cv0='CV%'*max=''*f=8.2 
	Q10='Q1'*max=''*f=8.2 
	median0='Median'*max=''*f=8.2  
	Q30='Q3'*max=''*f=8.2 
    min0='[Min;'*max=''*f=minf. 
	max0='Max]'*max=''*f=maxf.
	geomean='gmean'*max=''*f=8.2 
	
) 

     /  misstext='---' box=" age"  RTS=30  ;   
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Sep 2018 21:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495060#M21697</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2018-09-12T21:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: should i use PROC tabulate or?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495064#M21698</link>
      <description>For the desired format, the fastest solution is to create the data into a data set and then use PROC PRINT/REPORT to display. Use the CATT or CATX to create the variables with STD in brackets and such. &lt;BR /&gt;</description>
      <pubDate>Wed, 12 Sep 2018 22:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495064#M21698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-12T22:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: should i use PROC tabulate or?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495071#M21699</link>
      <description>&lt;P&gt;This modifies your std format a bit and uses some different style options. See if it gets close to what you want&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture mnf (round) 

low-high = '009.99';
	picture sdf  (round)

low-high = ' 009.99)' ( prefix = '(' )
	                  .= '(N/A)' (noedit)
 ;

	picture minf  (round) 
low-high = '009.99;'
      ( prefix = '[' );

	picture maxf  (round)
low-high = '009.99]';
   run;

PROC tabulate data=all  ORDER=data; 

  CLASS age;   
   VAR  n0  se0 cv0  q10  median0  q30 MIN0 MAX0 geomean ;
   VAR  MEAN0 /style=[just=R borderrightwidth=0];
   var SD0 /style=[just=L borderleftwidth=0 ] ;
   keyword mean / style=[just=R];
keyword StD / style=[just=L];
   TABLE   age=""   , 
(
	n0='n'*max=''*f=4.  
    mean0='Mean'*max=''*[style=[just=R cellwidth=70 borderrightwidth=0]]*f=mnf.
	SD0='(SD)'*max=''*[style=[just=L cellwidth=75 borderleftwidth=0 ]]*f=sdf.
	SE0='SE'*max=''*f=8.2 
	cv0='CV%'*max=''*f=8.2 
	Q10='Q1'*max=''*f=8.2 
	median0='Median'*max=''*f=8.2  
	Q30='Q3'*max=''*f=8.2 
    min0='[Min;'*max=''*f=minf. 
	max0='Max]'*max=''*f=maxf.
	geomean='gmean'*max=''*f=8.2 
	
) 

     /  misstext='---' box=" age"  RTS=30  ;   
RUN;&lt;/PRE&gt;
&lt;P&gt;You may want to look at the CELLPADDING style element if the space between the mean and std seem excessive or too small.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 23:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495071#M21699</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-12T23:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: should i use PROC tabulate or?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495134#M21700</link>
      <description>&lt;P&gt;thanks, Reeza and ballardw. I believe I need to use proc means and proc report to display. anyone has sample code to create a table like this? thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table2.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23236i5E6154A7D31B8EEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="table2.jpg" alt="table2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 02:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/should-i-use-PROC-tabulate-or/m-p/495134#M21700</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2018-09-13T02:11:49Z</dc:date>
    </item>
  </channel>
</rss>

