<?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 combine calculations into a table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-calculations-into-a-table/m-p/739413#M230782</link>
    <description>&lt;P&gt;Please provide your data as code (data step or SQL create/insert). Many of us will not download files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have to concatenate all the outputs as data sets in the layout you want, and then simply use proc print.&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 07:37:21 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-05-06T07:37:21Z</dc:date>
    <item>
      <title>How to combine calculations into a table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-calculations-into-a-table/m-p/738691#M230468</link>
      <description>&lt;P&gt;hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to combine all my calculations into a table and format it to look like the image below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;here is the code:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;* I have the data set adsl in this path;&lt;/DIV&gt;&lt;DIV&gt;libname a &amp;nbsp;"/folders/myfolders/FinalProject";&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;* Defining formats;&lt;/DIV&gt;&lt;DIV&gt;proc format lib=work;&lt;/DIV&gt;&lt;DIV&gt;value gender&lt;/DIV&gt;&lt;DIV&gt;1 = Male&lt;/DIV&gt;&lt;DIV&gt;2 = Female&lt;/DIV&gt;&lt;DIV&gt;;&lt;/DIV&gt;&lt;DIV&gt;value race&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1 = White&lt;/DIV&gt;&lt;DIV&gt;2 = Black&lt;/DIV&gt;&lt;DIV&gt;3 = Other&lt;/DIV&gt;&lt;DIV&gt;;&lt;/DIV&gt;&lt;DIV&gt;value treatment&lt;/DIV&gt;&lt;DIV&gt;1 = Active&lt;/DIV&gt;&lt;DIV&gt;0 = Placebo&lt;/DIV&gt;&lt;DIV&gt;;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;* Applying formats to the data set ;&lt;/DIV&gt;&lt;DIV&gt;proc datasets lib=a;&lt;/DIV&gt;&lt;DIV&gt;modify adsl;&lt;/DIV&gt;&lt;DIV&gt;format gender gender. race race. trt treatment.;&lt;/DIV&gt;&lt;DIV&gt;quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;* Sorting by treatment;&lt;/DIV&gt;&lt;DIV&gt;proc sort data=a.adsl out=a.adsl;&lt;/DIV&gt;&lt;DIV&gt;by trt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;* Statistics ;&lt;/DIV&gt;&lt;DIV&gt;proc means data=a.adsl n mean std min max;&lt;/DIV&gt;&lt;DIV&gt;by trt;&lt;/DIV&gt;&lt;DIV&gt;var age;&lt;/DIV&gt;&lt;DIV&gt;output out=work.means1;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc means data=a.adsl n mean std min max;&lt;/DIV&gt;&lt;DIV&gt;var age;&lt;/DIV&gt;&lt;DIV&gt;output out=work.means2;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;* Frequencies;&lt;/DIV&gt;&lt;DIV&gt;proc freq data=a.adsl;&lt;/DIV&gt;&lt;DIV&gt;table trt*gender/out=work.freq1 nocol nopercent;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc freq data=a.adsl;&lt;/DIV&gt;&lt;DIV&gt;table gender/out=work.freq2 ;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc freq data=a.adsl;&lt;/DIV&gt;&lt;DIV&gt;table trt*race/out=work.freq3 nocol nopercent;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc freq data=a.adsl;&lt;/DIV&gt;&lt;DIV&gt;table race/out=work.freq4 ;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is what I want it to look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ellpap_0-1620072057115.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58980i01EB67B25E828629/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ellpap_0-1620072057115.png" alt="ellpap_0-1620072057115.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also attached the dataset that is used in the code. Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-calculations-into-a-table/m-p/738691#M230468</guid>
      <dc:creator>ellpap</dc:creator>
      <dc:date>2021-05-03T20:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine calculations into a table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-calculations-into-a-table/m-p/739413#M230782</link>
      <description>&lt;P&gt;Please provide your data as code (data step or SQL create/insert). Many of us will not download files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have to concatenate all the outputs as data sets in the layout you want, and then simply use proc print.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 07:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-calculations-into-a-table/m-p/739413#M230782</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-05-06T07:37:21Z</dc:date>
    </item>
  </channel>
</rss>

