<?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: Use descriptives statistics values in a sql table filter in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115094#M31827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2013 16:16:46 GMT</pubDate>
    <dc:creator>nicnad</dc:creator>
    <dc:date>2013-02-20T16:16:46Z</dc:date>
    <item>
      <title>Use descriptives statistics values in a sql table filter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115092#M31825</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;I have the following descriptive statitics that I run on the variable Calculation1 in SAS EG 4.1 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* -------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Code généré par une tâche SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Généré le : 19 février 2013 à 17:50:32&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Par tâche : Statistiques descriptives&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Données en entrée : SASUSER.QUERY_FOR_QUERY1_FOR_PPVS_SCEN3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Serveur :&amp;nbsp; SASMain&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ------------------------------------------------------------------- */&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;%_SASTASK_DROPDS(WORK.SORTTempTableSorted);&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;/* -------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Il est inutile de trier la table SASUSER.QUERY_FOR_QUERY1_FOR_PPVS_SCEN3.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ------------------------------------------------------------------- */&lt;BR /&gt;PROC SQL;&lt;BR /&gt; CREATE VIEW WORK.SORTTempTableSorted&lt;BR /&gt;&amp;nbsp; AS SELECT Calculation1 FROM SASUSER.QUERY_FOR_QUERY1_FOR_PPVS_SCEN3;&lt;BR /&gt;QUIT;&lt;BR /&gt;/* -------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Exécuter la procédure Means&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ------------------------------------------------------------------- */&lt;BR /&gt;TITLE;&lt;BR /&gt;TITLE1 "Statistiques descriptives";&lt;BR /&gt;TITLE2 "Résultats";&lt;BR /&gt;FOOTNOTE;&lt;BR /&gt;FOOTNOTE1 "Généré par le Système SAS (&amp;amp;_SASSERVERNAME, &amp;amp;SYSSCPL) le %SYSFUNC(DATE(), FRADFDE9.) à %SYSFUNC(TIME(), TIME6.)";&lt;BR /&gt;PROC MEANS DATA=WORK.SORTTempTableSorted&lt;BR /&gt; FW=12&lt;BR /&gt; PRINTALLTYPES&lt;BR /&gt; CHARTYPE&lt;BR /&gt; VARDEF=DF&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; MEAN &lt;BR /&gt;&amp;nbsp; STD &lt;BR /&gt;&amp;nbsp; MIN &lt;BR /&gt;&amp;nbsp; MAX &lt;BR /&gt;&amp;nbsp; N ;&lt;BR /&gt; VAR Calculation1;&lt;/P&gt;&lt;P&gt;RUN;&lt;BR /&gt;/* -------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Fin du code de la tâche.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ------------------------------------------------------------------- */&lt;BR /&gt;RUN; QUIT;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;%_SASTASK_DROPDS(WORK.SORTTempTableSorted);&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;TITLE; FOOTNOTE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then create an sql table using the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt; CREATE TABLE SASUSER.FINAL AS SELECT QUERY_FOR_QUERY1_FOR_PPVS_SCEN3.CUSTOMER_ID,&lt;/P&gt;&lt;P&gt; WHERE QUERY_FOR_QUERY1_FOR_PPVS_SCEN3.Calculation1 &amp;gt;= 5.1554977; /* THIS NUMBER IS THE MEAN PLUS TWO TIMES THE STD DEVIATION */&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, I want to calculate the mean and std dev for all the records of variable Calculation1 in table QUERY_FOR_QUERY1_FOR_PPVS_SCEN3 and use this value as a filter in my proc sql. How do I do that automatically (having a dynamic variable)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help and time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 22:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115092#M31825</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-02-19T22:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use descriptives statistics values in a sql table filter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115093#M31826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is probably better posted in the EG forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardless, what I'd do is&lt;/P&gt;&lt;P&gt;1. Forget proc means and use a single query builder&lt;/P&gt;&lt;P&gt;2. In the SQL field add 2 calculated column, one that is mean and one that is the std deviation (Computed Columns/Summarized Column)&lt;/P&gt;&lt;P&gt;3. Add another computed column that is the cutoff = mean+2*STD using advanced expressions&lt;/P&gt;&lt;P&gt;4. Add the other columns you need&lt;/P&gt;&lt;P&gt;5. Filter the summarized data - under filter data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 23:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115093#M31826</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-02-19T23:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Use descriptives statistics values in a sql table filter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115094#M31827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exactly what I needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 16:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-descriptives-statistics-values-in-a-sql-table-filter/m-p/115094#M31827</guid>
      <dc:creator>nicnad</dc:creator>
      <dc:date>2013-02-20T16:16:46Z</dc:date>
    </item>
  </channel>
</rss>

