<?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: proc means with class YEAR and more variables, how to make individual tables for each variable? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103620#M29000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the help, everybody! I have now found a satisfying solution. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Aug 2012 14:48:39 GMT</pubDate>
    <dc:creator>silasskovsbo</dc:creator>
    <dc:date>2012-08-27T14:48:39Z</dc:date>
    <item>
      <title>proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103614#M28994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody. I have a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with some variables including the variable YEAR. I want to make some descr. statistics on the other variables for each year.&lt;/P&gt;&lt;P&gt;I use proc means with class YEAR and it works fine but there is a problem. I want to have descr. statistics on all the relevant variables in one PDF but with tables showing the statistics for each variable - so one table for each variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this (see below) but it just makes one table with both variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=XXXXX;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class YEAR ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var AGE EXPERIENCE ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do somebody know how to make this with indivudal tables for each variable?? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best // Silas, Aarhus University, Institute of Economics&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 12:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103614#M28994</guid>
      <dc:creator>silasskovsbo</dc:creator>
      <dc:date>2012-08-24T12:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103615#M28995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you just want to run two proc means?&lt;/P&gt;&lt;P&gt;proc means data=xxxx;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class year;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var age ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=xxxx;&lt;/P&gt;&lt;P&gt; class year;&lt;/P&gt;&lt;P&gt; var experience;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If more than a hand full then you could do it with a macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 14:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103615#M28995</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-08-24T14:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103616#M28996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also ended with that solution now but since there are many variables and very big data set it is a very demanding procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wondered if there was a solution like when you work with proc freq you can have more variables in one print by this simple code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=XXXX;&lt;/P&gt;&lt;P&gt;tables YEAR*(AGE EXPERIENCE);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 14:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103616#M28996</guid>
      <dc:creator>silasskovsbo</dc:creator>
      <dc:date>2012-08-24T14:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103617#M28997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not just have PROC MEANS output a dataset and the use PRINT or REPORT to display it the way you want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 14:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103617#M28997</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-08-24T14:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103618#M28998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you looked into "by group" processing?&amp;nbsp; Note that this will require sorting your data set by the "by groups".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=XXXXX;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by YEAR ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var AGE EXPERIENCE ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 15:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103618#M28998</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2012-08-24T15:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103619#M28999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach is to reshape your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (keep year&amp;nbsp; var value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array vars (list of your analysis variables);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length variable $32;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = dim(vars);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call vname( vars&lt;I&gt;,variable);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = vars&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This creates a data set with year, the name of the variable as the value of a string variable and the value.&lt;/P&gt;&lt;P&gt;Then sandwich the below code in appropriate ODS PDF or RTF call. Defaults to one table per page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class variable year;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table variable,&amp;nbsp; /* as first item this will be table level*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value *(n mean max min std),&amp;nbsp; /* or which ever statistics you want these will be row variables)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; year ; /* year would be column variable, if you want year as the row, then reverse the order of these*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 21:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103619#M28999</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-08-24T21:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc means with class YEAR and more variables, how to make individual tables for each variable?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103620#M29000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the help, everybody! I have now found a satisfying solution. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 14:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-means-with-class-YEAR-and-more-variables-how-to-make/m-p/103620#M29000</guid>
      <dc:creator>silasskovsbo</dc:creator>
      <dc:date>2012-08-27T14:48:39Z</dc:date>
    </item>
  </channel>
</rss>

