<?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: Values of 'Proc Mean' into dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391608#M94102</link>
    <description>&lt;P&gt;Perhaps something like:&lt;/P&gt;
&lt;PRE&gt;proc summary data=sample5 nway ;
   class sample seed;&lt;BR /&gt;   var fare;
   output out=sampleX5 mean= std= /autoname;
run; &lt;/PRE&gt;
&lt;P&gt;You don't provide any variable names in your example that correspond to "sample no" or "seed" so I'm guessing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary does everything that means does with minor differences in some default behaviors. Summary always expects to build an output data set (ancient history Means didn't and summary was it) and will attempt to have statistics in columns not rows however you need to provide output names or use the autoname option which will, in this example, create fare_mean and fare_std. If you have multiple variables with the same requested statistics the basevariable receives a suffix with the statistic to create unique variables.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2017 17:47:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-08-29T17:47:11Z</dc:date>
    <item>
      <title>Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391599#M94094</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sample5 mean std;
	var fare;
	output out=sampleX5;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I received the following output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the same time I badly need to prepare the following output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------&lt;/P&gt;&lt;P&gt;Sample No | Seed No | Mean | Std |&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; |&lt;/P&gt;&lt;P&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use any options in mean function to sort it out? Or should I use 'proc transpose' only? Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 11:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391599#M94094</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-03-05T11:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391603#M94097</link>
      <description>&lt;P&gt;STACKODS option in your PROC MEAN statement and then use the ODS Table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/" target="_blank"&gt;http://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the last section of the blog post.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391603#M94097</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-29T17:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391608#M94102</link>
      <description>&lt;P&gt;Perhaps something like:&lt;/P&gt;
&lt;PRE&gt;proc summary data=sample5 nway ;
   class sample seed;&lt;BR /&gt;   var fare;
   output out=sampleX5 mean= std= /autoname;
run; &lt;/PRE&gt;
&lt;P&gt;You don't provide any variable names in your example that correspond to "sample no" or "seed" so I'm guessing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary does everything that means does with minor differences in some default behaviors. Summary always expects to build an output data set (ancient history Means didn't and summary was it) and will attempt to have statistics in columns not rows however you need to provide output names or use the autoname option which will, in this example, create fare_mean and fare_std. If you have multiple variables with the same requested statistics the basevariable receives a suffix with the statistic to create unique variables.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391608#M94102</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-29T17:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391629#M94110</link>
      <description>Thank you, Reeza. It seems that it will take some time to be familiarized with 'STACKODS'. I used you link in my decision. It is following.</description>
      <pubDate>Tue, 29 Aug 2017 18:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391629#M94110</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-08-29T18:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391631#M94112</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is the desicion using the link provided by Reeza.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sample&amp;amp;i noprint;
			var fare;
			output out=sampleX&amp;amp;i(drop=_type_ _freq_) mean= std= / autoname;
		run; 

		data sampleY&amp;amp;i;
			length sample_no $2 seed_no $5;
			set sampleX&amp;amp;i;
				sample_no=&amp;amp;i;
				seed_no=&amp;amp;&amp;amp;seed&amp;amp;i;
		run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 18:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391631#M94112</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-08-29T18:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Values of 'Proc Mean' into dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391634#M94114</link>
      <description>&lt;P&gt;This is a great example of why you should have used a single seed and REP. Then you can just use the BY statement. I think it's still worth stacking them and then processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*stack data together;
data have;
set seed1-seed10 indsname=source;
file=source;
run;

*sort to allow for BY. Could do CLASS as well;
proc sort data=have; by file;

proc means data=have nway stackods mean std;
by file;
var fare;
ods output summary=want;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 18:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Values-of-Proc-Mean-into-dataset/m-p/391634#M94114</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-29T18:56:13Z</dc:date>
    </item>
  </channel>
</rss>

