<?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 FREQ in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596083#M15901</link>
    <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Sun, 13 Oct 2019 16:42:07 GMT</pubDate>
    <dc:creator>FEFE90</dc:creator>
    <dc:date>2019-10-13T16:42:07Z</dc:date>
    <item>
      <title>PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596062#M15892</link>
      <description>&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;Can anyone help me solve this question? I am not sure where I am mistaken.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Q : HOW MANY FIRM HAVING AVERAGE COMMON EQUITY/TOTAL ASSET RATIO GREATER THAN 50%?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data TOPCOM_TIC; set Q_COMP_SHORT10_18;
keep TIC CEQQ ATQ COM_EQ;
COM_EQ = CEQQ/ATQ;
run;

proc sort data=TOPCOM_TIC ; &amp;nbsp;
BY descending TIC COM_EQ;
RUN;&amp;nbsp;

proc means data=TOPCOM_TIC;
var COM_EQ ; BY TIC ;
output out=avg_CE
mean=avg_CE_TIC;
run;

Proc freq data=TOPCOM_TIC;
by COM_EQ ;
table TIC /out=Q6;
run;

data Q6; set Q6;
if COM_EQ&amp;gt;=50 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you&lt;/DIV&gt;</description>
      <pubDate>Sun, 13 Oct 2019 12:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596062#M15892</guid>
      <dc:creator>FEFE90</dc:creator>
      <dc:date>2019-10-13T12:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596065#M15893</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;COM_EQ&lt;/SPAN&gt; is a simple ratio, not a percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try changing the penultimate line from&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; COM_EQ&lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;50&lt;/SPAN&gt; &lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;to&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; COM_EQ&lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;gt;=0.5&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596065#M15893</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2019-10-13T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596066#M15894</link>
      <description>&lt;P&gt;I changed to 0.5 but I think something is incorrect with the proc means code. Any idea?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596066#M15894</guid>
      <dc:creator>FEFE90</dc:creator>
      <dc:date>2019-10-13T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596067#M15895</link>
      <description>&lt;P&gt;Have you inspected the data files? Are any of the values greater than 0.5?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596067#M15895</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2019-10-13T13:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596068#M15896</link>
      <description>&lt;P&gt;yes, there are a few that greater than 0.5&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596068#M15896</guid>
      <dc:creator>FEFE90</dc:creator>
      <dc:date>2019-10-13T13:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596069#M15897</link>
      <description>&lt;P&gt;In Q6?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596069#M15897</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2019-10-13T13:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596070#M15898</link>
      <description>&lt;P&gt;the code is not running from proc means, so the ones after that show errors. Should I change it from Q6 to TOPCOM_TIC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 13:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596070#M15898</guid>
      <dc:creator>FEFE90</dc:creator>
      <dc:date>2019-10-13T13:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596078#M15900</link>
      <description>&lt;P&gt;What do you mean by "not running"?&amp;nbsp;&amp;nbsp; I.e., what is the sas log telling you?&amp;nbsp; If we could see the log, we might be able to provide more effective assistance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, to see if I understand the object:&amp;nbsp; you want to calculate for each firm (variable TIC), the average ratio of quarterly reports of common equity (CEQ) to total assets (ATQ), right?&amp;nbsp;&amp;nbsp; It looks to me like you are using COMPUSTAT data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To do this you, don't need to sort - you can use the CLASS statement in proc means to get averages for each TIC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data TOPCOM_TIC; set Q_COMP_SHORT10_18;
  keep TIC CEQQ ATQ COM_EQ;
  COM_EQ = CEQQ/ATQ;
run;

proc means data=topcom_tic noprint nway;
  class tic;
  var com_eq;
  output out=stats (where=(_stat_='MEAN'));
run;

data need;
  set stats;
  over_under=sign(com_eq-.5);
run;

proc freq data=need;
  tables over_under;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;OL&gt;
&lt;LI&gt;The PROC MEANS has an NWAYS option.&amp;nbsp; Otherwise the output dataset would include not only the averages for each TIC ("one way" results), but also the global average ("zero way").&amp;nbsp; NWAY says to generate only the highest combination of CLASS variables&amp;nbsp; (for instance, if you had "CLASS SIC COUNTRY;", you would get only the two-way means for all SIC*COUNTRY combinations.).&lt;/LI&gt;
&lt;LI&gt;The data need step just makes a variable with +1 for ratio over .5, and -1 for ration &amp;lt; .5.&amp;nbsp; (exactly .5 leaves COM_EQ as a missing, so perhaps you would prefer&amp;nbsp;&amp;nbsp;&amp;nbsp; "OVER_NOTOVER= (com_eq&amp;gt;= 0.5);"&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 13 Oct 2019 15:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596078#M15900</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-10-13T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596083#M15901</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 16:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ/m-p/596083#M15901</guid>
      <dc:creator>FEFE90</dc:creator>
      <dc:date>2019-10-13T16:42:07Z</dc:date>
    </item>
  </channel>
</rss>

