<?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: How to make a frequency table with statistics values? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738682#M9960</link>
    <description>&lt;P&gt;This is super helpful! How would you then combine them using PROC SQL?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2021 19:17:57 GMT</pubDate>
    <dc:creator>ellpap</dc:creator>
    <dc:date>2021-05-03T19:17:57Z</dc:date>
    <item>
      <title>How to make a frequency table with statistics values?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738359#M9957</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to make a table similar to this one below with the data I have attached. I cannot seem to figure out how to use proc freq to generate the frequencies, proc means ( or proc univariate ) to generate the statistics values and then combine them in this way into a table. If anyone could give me any pointers on how to start that would be awesome! thanks so much!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ellpap_0-1619908560327.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58928i1CD50A96536BF5CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ellpap_0-1619908560327.png" alt="ellpap_0-1619908560327.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ellpap_0-1619908798312.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58929iCF7BEE00165610F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ellpap_0-1619908798312.png" alt="ellpap_0-1619908798312.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also these are the assumptions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Treatment:&lt;/P&gt;&lt;P&gt;1 = Active&lt;BR /&gt;0 = Placebo&lt;/P&gt;&lt;P&gt;Gender:&lt;BR /&gt;1 = Male&lt;BR /&gt;2 = Female&lt;/P&gt;&lt;P&gt;Race&lt;BR /&gt;1 = White&lt;BR /&gt;2 = Black&lt;BR /&gt;3 = Other&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 22:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738359#M9957</guid>
      <dc:creator>ellpap</dc:creator>
      <dc:date>2021-05-01T22:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a frequency table with statistics values?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738362#M9958</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a table for each purpose using PROC FREQ and PROC MEANS, and then join them with PROC SQL. You also need to create formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
* I have the data set adsl in this path;
libname a  "C:\Users\jenri\Downloads";

* Defining formats;
proc format lib=work;
	value gender
	1 = Male
	2 = Female
	;
	value race 
	1 = White
	2 = Black
	3 = Other
	;
	value treatment
	1 = Active
	0 = Placebo
	;
run;

* Applying formats to the data set ;
proc datasets lib=a;
	modify adsl;
	format gender gender. race race. trt treatment.;	
quit;

* Sorting by treatment;
proc sort data=a.adsl out=a.adsl;
	by trt;
run;

* Statistics ;
proc means data=a.adsl n mean std min max;
	by trt;
	var age;
	output out=work.means1;
run;

proc means data=a.adsl n mean std min max;
	var age;
	output out=work.means2;
run;

* Frequencies;
proc freq data=a.adsl;
	table trt*gender/out=work.freq1 nocol nopercent;
run;

proc freq data=a.adsl;
	table gender/out=work.freq2 ;
run;

proc freq data=a.adsl;
	table trt*race/out=work.freq3 nocol nopercent;
run;

proc freq data=a.adsl;
	table race/out=work.freq4 ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2021-05-01 204245.png" style="width: 346px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58930i696F6F642E7FAEBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Captura de pantalla 2021-05-01 204245.png" alt="Captura de pantalla 2021-05-01 204245.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this is useful for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 01:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738362#M9958</guid>
      <dc:creator>joseenrique1</dc:creator>
      <dc:date>2021-05-02T01:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a frequency table with statistics values?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738682#M9960</link>
      <description>&lt;P&gt;This is super helpful! How would you then combine them using PROC SQL?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 19:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-make-a-frequency-table-with-statistics-values/m-p/738682#M9960</guid>
      <dc:creator>ellpap</dc:creator>
      <dc:date>2021-05-03T19:17:57Z</dc:date>
    </item>
  </channel>
</rss>

