<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216048#M307625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for elaborating on how you use proc tabulate, ballardw--it's helpful advice.&amp;nbsp; Question:&amp;nbsp;&amp;nbsp; My understanding was I should be able to combine frequencies and statistics in proc tabulate.&amp;nbsp; However, my current proc tab step doesn't produce a row of Ns (frequencies) for the estabgroup variable.&amp;nbsp; Would you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _PAGE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P&gt;var Firm_employee_n;&lt;/P&gt;&lt;P&gt;table Firm_employee_n*(mean std), estabgroup ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 13:13:09 GMT</pubDate>
    <dc:creator>Maisha_Huq</dc:creator>
    <dc:date>2015-04-08T13:13:09Z</dc:date>
    <item>
      <title>Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216039#M307616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would anyone have suggestions for how I could write code to combine proc freq and proc means into one output dataset which would give me tables organized like the one below?&lt;/P&gt;&lt;P&gt;I'm not sure if it's possible to switch the proc freq so the N is in a row (instead of a column) and then show the mean of Covar1 for all the observations which have the valid values of a variable I'd like to cross tab each covariate with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black;" width="121"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="80"&gt;Var:ValidValue1&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="48"&gt;Var:ValidValue2&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="110"&gt;Var:ValidValue3&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="102"&gt;Var:ValidValue4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black; border-top: none;"&gt;N&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black; border-top: none;"&gt;Covar1&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black; border-top: none;"&gt;Covar2&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black; border-top: none;"&gt;Covar3&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black; border-top: none;"&gt;Covar&lt;EM&gt;n&lt;/EM&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none; border-top: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate questions and any guidance.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 20:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216039#M307616</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-03T20:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216040#M307617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to post a more detailed example of what you're looking for, sample input and output data in the format you'd like would be helpful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, proc tabulate is a good way to combine something like that OR proc report can also do a lot of summary/counts OR you may need to generate the tables and customize the output. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 21:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216040#M307617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-03T21:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216041#M307618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I THINK you might actually be looking for a report procedure such as proc tabulate or proc report.&lt;/P&gt;&lt;P&gt;I'm not sure exactly what role N plays in your example. Is it the number of records that have values of the VAR?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not going to use as simple VAR as a variable name as it gets confusing in syntax, I am going to call it VAR1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc tabulate data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class VAR1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Covar: ; /* this shortcut list would have to be replaced with your actual variable names here and in the table below*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table n&amp;nbsp; (covar: *mean=''),&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; Var1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Will give a row with the count of records for each value of Var1 and mean of the Covar variables, one per line.&lt;/P&gt;&lt;P&gt;NOTE: If you have many values for VAR1 and sent the output to RTF or PDF you'll likely encounter table wrapping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 21:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216041#M307618</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-03T21:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216042#M307619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ballardw! proc tabulate is looking like the better option. Do you know if proc tabulate can create an output dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, when I use the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=sample;&lt;/P&gt;&lt;P&gt;class Firm_employee_n ; /*edit covars here*/&lt;/P&gt;&lt;P&gt;var Firm_employee_n*(mean std);&lt;/P&gt;&lt;P&gt;table Firm_employee_n, estabgroup ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The log error says :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;202&amp;nbsp; var Firm_employee_n*(mean std);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_,&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; _CHAR_, _NUMERIC_.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we know why this is ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 13:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216042#M307619</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-06T13:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216043#M307620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A variable can be either CLASS or VAR but not both. You have that variable as both and the following isn't legal syntax:&lt;/P&gt;&lt;P&gt;var Firm_employee_n*(mean std);&lt;/P&gt;&lt;P&gt;The statistics requested appear in the table statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes Proc Tabulate generates output data sets add and OUT= clause on the Proc statement.&lt;/P&gt;&lt;P&gt;Proc tabulate data=have out=lib.outset ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate one and look at the resultant set. It isn't always the easiest format to understand because of nesting and the fact that multiple tables can be generated by one proc tabulate call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 16:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216043#M307620</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-06T16:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216044#M307621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ballardw!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proc tabulate code you guided me to use is what I was looking for.&lt;/P&gt;&lt;P&gt;In my SAS Ouput window, the table dimensions appear as expected but not in ODS tagsets excel--would you have an idea why this is?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _PAGE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P&gt;var Firm_employee_n;&lt;/P&gt;&lt;P&gt;table Firm_employee_n*(mean std), estabgroup ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods ods tagsets.excelxp file='S:\Projects\DOL OSHA EVAL\Output\Pilot Study\Baseline_descriptives_b.xls' style=journal;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp options(sheet_name="by_estabgroup");&lt;/P&gt;&lt;P&gt;proc print data=tab_estabgroup noobs; run;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output window&lt;/STRONG&gt;&lt;/P&gt;&lt;P&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;&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;&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;&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;&amp;nbsp; estabgroup&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |---------------------------------------------------|&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vv1|&amp;nbsp;&amp;nbsp;&amp;nbsp; vv2|&amp;nbsp;&amp;nbsp;&amp;nbsp; vv3|&amp;nbsp;&amp;nbsp;&amp;nbsp; vv4|&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; |-----------------------+------------+------------+------------+------------|&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; |firm_emplo-|&amp;nbsp;&amp;nbsp; Mean&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&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; |yee_n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-----------+------------+------------+------------+------------|&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |Std&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11|&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; -----------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the Excel output the estabgroup and firm_emp... var are switched.&amp;nbsp; I'm not sure why--would you know?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 490px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" width="100"&gt;estabgroup&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="200"&gt;firm_employee_n_Mean&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="190"&gt;firm_employee_n_Std&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="border-top: none;" width="100"&gt;vv1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="200"&gt;11&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="190"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="border-top: none;" width="100"&gt;vv2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="200"&gt;11&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="190"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="border-top: none;" width="100"&gt;vv3&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="200"&gt;11&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="190"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="border-top: none;" width="100"&gt;vv4&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="200"&gt;11&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="190"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 19:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216044#M307621</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-06T19:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216045#M307622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The table via the out statement does not have the same structure as the table displayed in the output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why not run the proc tablet between the ODS statements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods ods tagsets.excelxp file='S:\Projects\DOL OSHA EVAL\Output\Pilot Study\Baseline_descriptives_b.xls' style=journal;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods tagsets.excelxp options(sheet_name="by_estabgroup");&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc tabulate data=sample ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;var Firm_employee_n;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;table Firm_employee_n*(mean std), estabgroup ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 20:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216045#M307622</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-06T20:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216046#M307623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza is absolutely correct.&lt;/P&gt;&lt;P&gt;The dataset created by Proc Tabulate has one row for each combination of values of CLASS variables and then the statistics for each of the VAR variables for that combination. If you have a single class variable the output will actually look a lot like Proc Means/Summary with autoname option used for the variable statistics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I mentioned, proc tabulated generated datasets are somewhat complex and I've never seen a good example of a simple use for them. I use them but do a lot of post processing to get the results I want. The reports I use them for generally involve things that could be done with Proc Summary but sorting through the various combinations of _type_ I would needs gets to be tedious and the tabulate simplifies that somewhat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 20:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216046#M307623</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-06T20:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216047#M307624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for problem solving, Reeza!&amp;nbsp; I got the output window table to export this way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216047#M307624</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-08T13:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216048#M307625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for elaborating on how you use proc tabulate, ballardw--it's helpful advice.&amp;nbsp; Question:&amp;nbsp;&amp;nbsp; My understanding was I should be able to combine frequencies and statistics in proc tabulate.&amp;nbsp; However, my current proc tab step doesn't produce a row of Ns (frequencies) for the estabgroup variable.&amp;nbsp; Would you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _PAGE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P&gt;var Firm_employee_n;&lt;/P&gt;&lt;P&gt;table Firm_employee_n*(mean std), estabgroup ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216048#M307625</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-08T13:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216049#M307626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FREQ is N in most summary tables. You haven't requested that calculation. I'm not exactly sure where you need it, so you can play around with the location of the N statistic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _PAGE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;var Firm_employee_n;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;table Firm_employee_n*(mean std), estabgroup*(N) ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216049#M307626</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-08T13:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216050#M307627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Estabgroup is a character variable and I'm not allowed to it in the var statement then request a statistic apparently...&amp;nbsp; Is that how you'd interpret the following LOG messages?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;374&amp;nbsp; proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp; _PAGE_&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P&gt;375&lt;/P&gt;&lt;P&gt;376&amp;nbsp; var Firm_employee_n estabgroup;&lt;/P&gt;&lt;P&gt;ERROR: Variable estabgroup in list does not match type prescribed for this list.&lt;/P&gt;&lt;P&gt;377&amp;nbsp; table Firm_employee_n*(mean std), estabgroup*N ;&lt;/P&gt;&lt;P&gt;378&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Alternative code&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;369&amp;nbsp; proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp; _PAGE_&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P&gt;370&amp;nbsp; class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P&gt;371&amp;nbsp; var Firm_employee_n;&lt;/P&gt;&lt;P&gt;372&amp;nbsp; table Firm_employee_n*(mean std), estabgroup*N ;&lt;/P&gt;&lt;P&gt;373&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: There are multiple statistics associated with a single table cell in the following nesting :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firm_employee_n * Mean * estabgroup * N.&lt;/P&gt;&lt;P&gt;ERROR: There are multiple statistics associated with a single table cell in the following nesting :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firm_employee_n * Std * estabgroup * N.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216050#M307627</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-08T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216051#M307628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like I mentioned I'm not exactly sure where you need it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;proc tabulate data=sample&amp;nbsp; out=tab_estabgroup (drop=_TYPE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _PAGE_&amp;nbsp;&amp;nbsp;&amp;nbsp; _TABLE_);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;class&amp;nbsp; estabgroup ; /*edit covars here*/&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;var Firm_employee_n;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;table Firm_employee_n*(N mean std), estabgroup;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216051#M307628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-08T13:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216052#M307629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you go back to my first code example you will notice a little "n" appearing all by itself on the row level of the table. That is what would request the frequencies for each level of the column variable(s).&lt;/P&gt;&lt;P&gt;table &lt;EM style="text-decoration: underline;"&gt;&lt;STRONG&gt;n&lt;/STRONG&gt;&lt;/EM&gt; Firm_employee_n*( mean std), estabgroup;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 15:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216052#M307629</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-08T15:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216053#M307630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ballardw!&amp;nbsp; This was what I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking to combine the mean and standard deviation statistics into one cell:&amp;nbsp; if I wasn't using proc tab, I may have used the concatenation operator to combine a mean var and a std deviation var.&amp;nbsp; With proc tab, however, I'm not sure:&amp;nbsp; I see proc tab has an option to remove the horizantal lines in a table.&amp;nbsp; Would you know how to display mean and standard deviation in one cell, i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mean&lt;/P&gt;&lt;P&gt;(std dev)&amp;nbsp;&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 19:49:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216053#M307630</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-08T19:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216054#M307631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;It looks like proc tab can't actually combine statistics in a cell using punctuation. So I ll switch to proc report. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thanks to you both!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 20:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means/m-p/216054#M307631</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2015-04-08T20:36:47Z</dc:date>
    </item>
  </channel>
</rss>

