<?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 statistics are not found in the output data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537250#M147714</link>
    <description>Which statistic doesn't PROC TABULATE calculate?</description>
    <pubDate>Wed, 20 Feb 2019 23:08:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-02-20T23:08:21Z</dc:date>
    <item>
      <title>Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537173#M147678</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to create a table of a descriptive statistics to show endpoints (N), min, 25th, median, 75th percentiles and the NMISS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Sum, Q1, NMISS, Q3 statistics were not created in the output dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. N is misleading as shown in the table below, even if i wanted to use it in the place of SUM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your time and help.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc repot sum wrong.png" style="width: 549px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27313i54ED5AE6A37CFBE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="proc repot sum wrong.png" alt="proc repot sum wrong.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=E.SEER_CANCERS_COUNTY NMISS SUM MIN Q1 MEDIAN Q3 MAX MAXDEC=1; 
CLASS CANCER_TYPE SEX; 
var N_COUNTY;
OUTPUT OUT=E.SUMMARY_ALL_LONG(DROP=_FREQ_ _TYPE_ WHERE=(CANCER_TYPE NE " " AND SEX NE " "));
run;
proc report data=E.SUMMARY_ALL_LONG;
column CANCER_TYPE _STAT_,SEX,N_COUNTY;
define CANCER_TYPE/ ' '  group;
define SEX/ across 'Gender';
define _STAT_/ across ' ';
DEFINE N_COUNTY/ ' ' FORMAT=9.1;  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2019 19:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537173#M147678</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-02-20T19:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537176#M147680</link>
      <description>&lt;P&gt;The options that you place on the PROC MEANS statement (such as NMISS SUM Q1) affect the report printed by PROC MEANS.&amp;nbsp; They have no impact on the contents of the output data set E.SUMMARY_ALL_LONG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To control the contents of the output data set, you need to add a description of the statistics you would like, as part of the OUTPUT statement.&amp;nbsp; Since you have just one analysis variable, a simple set of additions would be sufficient, such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OUTPUT OUT=E.SUMMARY_ALL_LONG(DROP=_FREQ_ _TYPE_ WHERE=(CANCER_TYPE NE " " AND SEX NE " "))
q1=q1 median=median q3=q3;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whatever statistics you want in the output data set, you must name and assign a variable name to, as part of the OUTPUT statement.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 20:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537176#M147680</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-20T20:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537188#M147684</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great. Thank you so much. I got it. Proc means worked out and now I'm stumbled with the following Proc Report. Would you please take a look at the image attached and see what I'm doing wrong in the code for the 'proc report' using the changed layout of the output data from proc means?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=E.SEER_CANCERS_COUNTY NMISS SUM MIN Q1 MEDIAN Q3 MAX MAXDEC=1; 
CLASS CANCER_TYPE SEX; 
var N_COUNTY;
OUTPUT OUT=E.SUMMARY_ALL_LONG(DROP=_FREQ_ _TYPE_ WHERE=(CANCER_TYPE NE " " AND SEX NE " "))
min=amin q1=aq1 median=amedian q3=aq3 nmiss=amiss sum=asum max=amax;
run;
proc report data=E.SUMMARY_ALL_LONG;
column CANCER_TYPE SEX,(AMIN AQ1 AMEDIAN AQ3 AMISS ASUM AMAX);
define CANCER_TYPE/ ' '  group;
define SEX/ across 'Gender';
DEFINE ASUM/ 'N CASES' FORMAT=9.1;  
DEFINE AMIN/ 'MIN' FORMAT=9.1;  
DEFINE AQ1/ 'MIN' FORMAT=9.1;  
DEFINE AMEDIAN/ 'MIN' FORMAT=9.1;  
DEFINE AQ3/ 'MIN' FORMAT=9.1;  
DEFINE AMISS/ 'MIN' FORMAT=9.1;  
DEFINE AMAX/ 'MAX' FORMAT=9.1;  
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PROC REPORT WENT WRONG.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27316i431A8AA4D1D6CD9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC REPORT WENT WRONG.png" alt="PROC REPORT WENT WRONG.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 20:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537188#M147684</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-02-20T20:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537195#M147688</link>
      <description>&lt;P&gt;Why not use PROC TABULATE directly instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.class;
class sex;
var weight height;
table weight height, (max mean min N STD)*sex;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great. Thank you so much. I got it. Proc means worked out and now I'm stumbled with the following Proc Report. Would you please take a look at the image attached and see what I'm doing wrong in the code for the 'proc report' using the changed layout of the output data from proc means?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=E.SEER_CANCERS_COUNTY NMISS SUM MIN Q1 MEDIAN Q3 MAX MAXDEC=1; 
CLASS CANCER_TYPE SEX; 
var N_COUNTY;
OUTPUT OUT=E.SUMMARY_ALL_LONG(DROP=_FREQ_ _TYPE_ WHERE=(CANCER_TYPE NE " " AND SEX NE " "))
min=amin q1=aq1 median=amedian q3=aq3 nmiss=amiss sum=asum max=amax;
run;
proc report data=E.SUMMARY_ALL_LONG;
column CANCER_TYPE SEX,(AMIN AQ1 AMEDIAN AQ3 AMISS ASUM AMAX);
define CANCER_TYPE/ ' '  group;
define SEX/ across 'Gender';
DEFINE ASUM/ 'N CASES' FORMAT=9.1;  
DEFINE AMIN/ 'MIN' FORMAT=9.1;  
DEFINE AQ1/ 'MIN' FORMAT=9.1;  
DEFINE AMEDIAN/ 'MIN' FORMAT=9.1;  
DEFINE AQ3/ 'MIN' FORMAT=9.1;  
DEFINE AMISS/ 'MIN' FORMAT=9.1;  
DEFINE AMAX/ 'MAX' FORMAT=9.1;  
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PROC REPORT WENT WRONG.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27316i431A8AA4D1D6CD9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC REPORT WENT WRONG.png" alt="PROC REPORT WENT WRONG.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 20:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537195#M147688</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-20T20:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537203#M147692</link>
      <description>I don't think I am the right person for this question.  I know a lot about PROC MEANS but very little about PROC REPORT.</description>
      <pubDate>Wed, 20 Feb 2019 20:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537203#M147692</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-20T20:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537249#M147713</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; , why directly using proc tabulate didn't work for me was that I needed bunch of stats that proc tabulate doesn't produce. However, using it in series with proc means did the job for me. Just in case, if this helps somebody, posted below is what worked. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=E.SEER_CANCERS_COUNTY NMISS SUM MIN Q1 MEDIAN Q3 MAX MAXDEC=1 NOPRINT; 
CLASS CANCER_TYPE SEX; 
var N_COUNTY;
OUTPUT OUT=E.SUMMARY_ALL_LONG(DROP=_FREQ_ _TYPE_ WHERE=(CANCER_TYPE NE " " AND SEX NE " "))
min=MIN q1=Q1 median=MEDIAN q3=Q3 nmiss=NOCASE sum=N max=MAX;
run;
proc tabulate data=E.SUMMARY_ALL_LONG;
CLASS CANCER_TYPE SEX;
var MIN Q1 MEDIAN Q3 NOCASE N MAX;
table CANCER_TYPE=' ',(N='N CASE' NOCASE='NO CASE' MIN Q1 MEDIAN Q3 MAX)*F=9.*SUM=' '*SEX='Gender';
FORMAT SEX $SEX.; 
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2019 23:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537249#M147713</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-02-20T23:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537250#M147714</link>
      <description>Which statistic doesn't PROC TABULATE calculate?</description>
      <pubDate>Wed, 20 Feb 2019 23:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537250#M147714</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-20T23:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537253#M147715</link>
      <description>tabulate doesn't calculate: percentiles, Q1 median Q3 nmiss, NMISS was very important for this table.</description>
      <pubDate>Wed, 20 Feb 2019 23:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537253#M147715</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-02-20T23:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537254#M147716</link>
      <description>&lt;P&gt;Yes it does, you do need to specify it correctly by indicating MISSING/MISS to allow for missing to be included but in general, it can definitely do those calculations as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.class;
class sex;
var weight height;
table weight height, (N NMISS Q1 Median Q3)*sex;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2019 23:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537254#M147716</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-20T23:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc means statistics are not found in the output data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537373#M147792</link>
      <description>This worked like a magic! Thank you!</description>
      <pubDate>Thu, 21 Feb 2019 13:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-means-statistics-are-not-found-in-the-output-data/m-p/537373#M147792</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-02-21T13:01:54Z</dc:date>
    </item>
  </channel>
</rss>

