<?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: UNIVARIATE - restrict computed statistics to what is needed? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544526#M74253</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
ods output summary=want;
proc means data=sashelp.heart   min p5 p25 median mean p75 p95 max stackodsoutput;
var _numeric_;
run;
ods select all;

proc print;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Mar 2019 12:10:47 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-03-20T12:10:47Z</dc:date>
    <item>
      <title>UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544509#M74250</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with&amp;nbsp;approximately 5.5 million observations of 3 numeric variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I need&amp;nbsp;are the means and a few quantiles for all 3 variables stored in a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently running the following code and getting the desired result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=MYDATA outtable=UNIV (keep=_var_ _min_ _p5_ _q1_ _median_ _mean_ _q3_ _p95_ _max_) noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This, however, seems like a waste of resources as it computes a number of statistics which I then drop immediately, and&amp;nbsp;it also generates a warning about the number of observations being too large to calculate &lt;EM&gt;Qn&lt;/EM&gt;, which I do not need here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;The number of nonmissing observations for variable X is too large to compute the robust measure of scale Qn. The statistic Qn is set to missing.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In sum, the code does what I want, but makes a number of unnecessary computations. In&amp;nbsp;order to save time and resources, and also just out of interest, I was wondering whether there was any way to restrict the computations to a list of explicitly requested statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your expertise.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 11:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544509#M74250</guid>
      <dc:creator>Vogel</dc:creator>
      <dc:date>2019-03-20T11:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544518#M74251</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267049"&gt;@Vogel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with&amp;nbsp;approximately 5.5 million observations of 3 numeric variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All I need&amp;nbsp;are the means and a few quantiles for all 3 variables stored in a table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am currently running the following code and getting the desired result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=MYDATA outtable=UNIV (keep=_var_ _min_ _p5_ _q1_ _median_ _mean_ _q3_ _p95_ _max_) noprint;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This, however, seems like a waste of resources as it computes a number of statistics which I then drop immediately, and&amp;nbsp;it also generates a warning about the number of observations being too large to calculate &lt;EM&gt;Qn&lt;/EM&gt;, which I do not need here.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then use PROC MEANS or PROC SUMMARY and you can control which statistics are computed.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 11:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544518#M74251</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-20T11:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544526#M74253</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
ods output summary=want;
proc means data=sashelp.heart   min p5 p25 median mean p75 p95 max stackodsoutput;
var _numeric_;
run;
ods select all;

proc print;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 12:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/544526#M74253</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-03-20T12:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556357#M74740</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all thanks, the layout of the output of your example code is exactly what I want!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only remaining issue I now have, is it's hard to reproduce the same layout when using an output dataset, i.e. one variable that contains the input data variable name, and further variables for each of the computed statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to achieve this directly from a proc means / summary, or do I basically need to transform the output data myself to replicate that layout?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 07:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556357#M74740</guid>
      <dc:creator>Vogel</dc:creator>
      <dc:date>2019-05-06T07:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556373#M74741</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267049"&gt;@Vogel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all thanks, the layout of the output of your example code is exactly what I want!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only remaining issue I now have, is it's hard to reproduce the same layout when using an output dataset, i.e. one variable that contains the input data variable name, and further variables for each of the computed statistics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to achieve this directly from a proc means / summary, or do I basically need to transform the output data myself to replicate that layout?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is not clear. What do you mean by "same layout"? Please explain further, or better yet, show us an example of what you want.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 10:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556373#M74741</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-06T10:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556378#M74742</link>
      <description>&lt;P&gt;OK, sorry about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working in Enterprise Guide&amp;nbsp;7.15 HF3. When I run the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.heart min p5 p25 median mean p75 p95 max;
	var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The report shows the output I'm attaching to this post in&amp;nbsp;an Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is whether, using an output statement to create an output dataset, I can get the results in a similar layout directly from proc means.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the resulting dataset would have one observation per numeric variable in SASHELP.HEART, Character variables for the variable names and labels, and Numeric variables for the requested statistics (which are the same for all variables).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 11:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556378#M74742</guid>
      <dc:creator>Vogel</dc:creator>
      <dc:date>2019-05-06T11:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556394#M74744</link>
      <description>&lt;P&gt;Some of us will not (or cannot) open Microsoft Office documents because they are a security risk.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paste a portion of the output from PROC MEANS into the window that appears when you click on the {i} icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;My question is whether, using an output statement to create an output dataset, I can get the results in a similar layout directly from proc means.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please show us what you want.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 12:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556394#M74744</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-06T12:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556413#M74747</link>
      <description>&lt;P&gt;Did you open table WANT ? Is that you want ?&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 13:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556413#M74747</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-05-06T13:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: UNIVARIATE - restrict computed statistics to what is needed?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556427#M74750</link>
      <description>Yes! I don't know how on earth I missed that. Thanks again and sorry for the confusion.</description>
      <pubDate>Mon, 06 May 2019 14:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/UNIVARIATE-restrict-computed-statistics-to-what-is-needed/m-p/556427#M74750</guid>
      <dc:creator>Vogel</dc:creator>
      <dc:date>2019-05-06T14:15:48Z</dc:date>
    </item>
  </channel>
</rss>

