<?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: Attempt at replicating a demographic table. Which PROC is best? Also how to do it? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710915#M218925</link>
    <description>A 20 year old paper that's still valid and appropriate...one of the things that's nice about SAS.</description>
    <pubDate>Tue, 12 Jan 2021 20:18:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-01-12T20:18:28Z</dc:date>
    <item>
      <title>Attempt at replicating a demographic table. Which PROC is best? Also how to do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710382#M218668</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to replicate this table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_0-1610202664219.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53364iE82B3AEF19964F30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_0-1610202664219.png" alt="Hello_there_0-1610202664219.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE data=data;
	class TREATMENT1 GENDER;
	table GENDER ALL, TREATMENT1 all;
	KEYLABEL ALL="Total";
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_1-1610203673276.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53365iD1F7657B7E67DFDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_1-1610203673276.png" alt="Hello_there_1-1610203673276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1. I need to have a fourth column that combines High and Low.&lt;/P&gt;&lt;P&gt;2. I also need to incorporate percents in the columns, so it equals N(%) for the categorical variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 14:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710382#M218668</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2021-01-09T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt at replicating a demographic table. Which PROC is best? Also how to do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710384#M218669</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi27/p202-27.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi27/p202-27.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 15:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710384#M218669</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-09T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt at replicating a demographic table. Which PROC is best? Also how to do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710387#M218672</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Your best bet:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252358"&gt;@Hello_there&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to replicate this table.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_0-1610202664219.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53364iE82B3AEF19964F30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_0-1610202664219.png" alt="Hello_there_0-1610202664219.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE data=data;
	class TREATMENT1 GENDER;
	table GENDER ALL, TREATMENT1 all;
	KEYLABEL ALL="Total";
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_1-1610203673276.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53365iD1F7657B7E67DFDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_1-1610203673276.png" alt="Hello_there_1-1610203673276.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;1. I need to have a fourth column that combines High and Low.&lt;/P&gt;
&lt;P&gt;2. I also need to incorporate percents in the columns, so it equals N(%) for the categorical variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 16:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710387#M218672</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-09T16:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt at replicating a demographic table. Which PROC is best? Also how to do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710426#M218696</link>
      <description>&lt;P&gt;PROC SQL. Here is an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro report_detail(dataset=,var=,time=);
/*For 第一个变量的 统计量*/
proc univariate data=&amp;amp;dataset(where=(time=&amp;amp;time)) outtable=temp_summary noprint;
class drug;
var &amp;amp;var ;
run;

/*For 第一个变量的 Geomean(CV)*/
ods select none;
ods output Equality=Temp_eq ConfLimits=Temp_ge TTests=Temp_tp;
proc ttest data=&amp;amp;dataset(where=(time=&amp;amp;time)) dist=lognormal;
class drug;
var &amp;amp;var;
run;
ods select all;
data Temp_ge_1;
 set Temp_ge(where=(Method is missing));
 drug=input(class, drug_ifmt.);
run;


proc sql;
create table temp_report_%sysfunc(translate(&amp;amp;time,_,.))  as
/*For 第一个变量的 N(Missing)*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b length=10 ,1 as c,'N(Missing)' as d length=20,
 drug as id format=drug_fmt.,
 cats(_NOBS_,'(',_NMISS_,')') as value
 from temp_summary
union
/*For 第一个变量的 Mean(SD)*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b, 2 as c,'Mean(SD)' as d,
 drug as id ,
 cats(put(_MEAN_,10.4),'(',put(_STD_,10.4),')') as value
 from temp_summary
union
/*For 第一个变量的 Median*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b,3 as c,'Median' as d,
 drug as id ,
 put(_MEDIAN_,10.4 -l) as value
 from temp_summary
union
/*For 第一个变量的 Q1,Q3*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b,4 as c,'Q1,Q3' as d,
 drug as id ,
 cats(put(_q1_,10.4),',',put(_q3_,10.4)) as value
 from temp_summary
union
/*For 第一个变量的 Min,Max*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b,5 as c,'Min,Max' as d,
 drug as id ,
 cats(put(_MIN_,10.4),',',put(_MAX_,10.4)) as value
 from temp_summary
union
/*For 第一个变量的 CV*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b,6 as c,'CV' as d,
 drug as id ,
 put(_CV_/100,10.4 -l) as value
 from temp_summary
union
/*For 第一个变量的 Geomean(CV)*/
select &amp;amp;time as a,catx(' ',&amp;amp;time,'hr') as b,7 as c,'Geomean(CV)' as d,
 drug as id , 
 cats(put(GeomMean,10.4),'(',put(CV,10.4),')') as value
 from temp_ge_1
;
quit;
%mend report_detail;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Jan 2021 10:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710426#M218696</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-10T10:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt at replicating a demographic table. Which PROC is best? Also how to do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710915#M218925</link>
      <description>A 20 year old paper that's still valid and appropriate...one of the things that's nice about SAS.</description>
      <pubDate>Tue, 12 Jan 2021 20:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Attempt-at-replicating-a-demographic-table-Which-PROC-is-best/m-p/710915#M218925</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-12T20:18:28Z</dc:date>
    </item>
  </channel>
</rss>

