<?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: Ranking in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738476#M35863</link>
    <description>&lt;P&gt;1. Calculate the percent of unsatisfactory per hospital. Depending on the data this could be proc freq or means. &lt;BR /&gt;2. Use PROC RANK to rank the data or order it descending and apply ranks manually. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Example below. Without the information request by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;we won't be able to help you further. Please include your code, log and example data if you run into issues.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=hospitalData noprint;
table hospital*specimen / out=hosp_spec outpct;
run;

proc rank data=hosp_spec out=want;
where specimen = '4';
var pct_row;
ranks rank_pct_row;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380590"&gt;@SriCh1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset with 9 hospitals and specimen types ranging 0-4 where 4=unsatisfactory. I need to calculate specimen types for each hospital and give rankings to the hospital according to the unsatisfactory specimen(4) percentages. How can we do this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 May 2021 03:10:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-05-03T03:10:08Z</dc:date>
    <item>
      <title>Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738440#M35859</link>
      <description>&lt;P&gt;I have a dataset with 9 hospitals and specimen types ranging 0-4 where 4=unsatisfactory. I need to calculate specimen types for each hospital and give rankings to the hospital according to the unsatisfactory specimen(4) percentages. How can we do this?&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 22:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738440#M35859</guid>
      <dc:creator>SriCh1</dc:creator>
      <dc:date>2021-05-02T22:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738442#M35860</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380590"&gt;@SriCh1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset with 9 hospitals and specimen types ranging 0-4 where 4=unsatisfactory. I need to calculate specimen types for each hospital and give rankings to the hospital according to the unsatisfactory specimen(4) percentages. How can we do this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not sure what "calculate" means in this context. Does it mean you need to &lt;STRONG&gt;count&lt;/STRONG&gt; the number of unsatisfactory specimens at each hospital? Can you show us a small portion of this data set following &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt; (and not via any other method).&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 22:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738442#M35860</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-02T22:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738444#M35861</link>
      <description>&lt;P&gt;Yes, count the number of unsatisfactory specimens for each hospital, convert it into a percentage, and then give ranking according to the percentage.&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 22:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738444#M35861</guid>
      <dc:creator>SriCh1</dc:creator>
      <dc:date>2021-05-02T22:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738447#M35862</link>
      <description>&lt;P&gt;Repeating: "Can you show us a small portion of this data set following &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self" rel="nofollow noopener noreferrer"&gt;these instructions&lt;/A&gt; (and not via any other method)."&lt;/P&gt;</description>
      <pubDate>Sun, 02 May 2021 22:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738447#M35862</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-02T22:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738476#M35863</link>
      <description>&lt;P&gt;1. Calculate the percent of unsatisfactory per hospital. Depending on the data this could be proc freq or means. &lt;BR /&gt;2. Use PROC RANK to rank the data or order it descending and apply ranks manually. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Example below. Without the information request by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;we won't be able to help you further. Please include your code, log and example data if you run into issues.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=hospitalData noprint;
table hospital*specimen / out=hosp_spec outpct;
run;

proc rank data=hosp_spec out=want;
where specimen = '4';
var pct_row;
ranks rank_pct_row;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/380590"&gt;@SriCh1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset with 9 hospitals and specimen types ranging 0-4 where 4=unsatisfactory. I need to calculate specimen types for each hospital and give rankings to the hospital according to the unsatisfactory specimen(4) percentages. How can we do this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 03:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738476#M35863</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-03T03:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738484#M35865</link>
      <description>This is the sample dataset&lt;BR /&gt;HOSPITAL SPEC_TYPE&lt;BR /&gt;Hospital A 0&lt;BR /&gt;Hospital B 2&lt;BR /&gt;Hospital B 3&lt;BR /&gt;Hospital C 1&lt;BR /&gt;Hospital A 4&lt;BR /&gt;Hospital A 4&lt;BR /&gt;Hospital E 2&lt;BR /&gt;Hospital D 4&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2021 04:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738484#M35865</guid>
      <dc:creator>SriCh1</dc:creator>
      <dc:date>2021-05-03T04:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738536#M35866</link>
      <description>&lt;P&gt;Please note that in the future, we're going to insist on you providing data according via &lt;EM&gt;working&lt;/EM&gt; SAS data step code (you can follow&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;), and you will get faster and probably more correct responses by doing so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have provided the data, just change the names of the variables and the names of the input data set in the code from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;to match your variable names. You will need to add the SPARSE option to the TABLES statement.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 10:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738536#M35866</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-03T10:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738558#M35868</link>
      <description>I did not know what was wrong with my error. Below I included the log part.&lt;BR /&gt;&lt;BR /&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;72&lt;BR /&gt;73 Proc FREQ data=Newborn.have noprint;&lt;BR /&gt;74 TABLES SPEC_TYPE*HOSPITAL/out=Newborn.percent;&lt;BR /&gt;75 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 3723 observations read from the data set NEWBORN.HAVE.&lt;BR /&gt;NOTE: The data set NEWBORN.PERCENT has 33 observations and 4 variables.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 2504.87k&lt;BR /&gt;OS Memory 34620.00k&lt;BR /&gt;Timestamp 05/03/2021 11:46:12 AM&lt;BR /&gt;Step Count 233 Switch Count 10&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 565&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 85&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 1328&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;76 proc rank data=Newborn.percent out=Newborn.final;&lt;BR /&gt;77 where SPEC_TYPE = 0;&lt;BR /&gt;78 var pct_row;&lt;BR /&gt;ERROR: Variable PCT_ROW not found.&lt;BR /&gt;79 ranks rank_pct_row;&lt;BR /&gt;80 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set NEWBORN.FINAL may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;BR /&gt;WARNING: Data set NEWBORN.FINAL was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE RANK used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 729.96k&lt;BR /&gt;OS Memory 33452.00k&lt;BR /&gt;Timestamp 05/03/2021 11:46:12 AM&lt;BR /&gt;Step Count 234 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 85&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 42&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 288&lt;BR /&gt;Block Output Operations 16&lt;BR /&gt;&lt;BR /&gt;81&lt;BR /&gt;82 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;94</description>
      <pubDate>Mon, 03 May 2021 11:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738558#M35868</guid>
      <dc:creator>SriCh1</dc:creator>
      <dc:date>2021-05-03T11:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738561#M35869</link>
      <description>&lt;PRE&gt;ERROR: Variable PCT_ROW not found.&lt;/PRE&gt;
&lt;P&gt;Sometimes these things can be solved simply by LOOKING AT the data sets. In this case, please look at the data set NEWBORN.PERCENT and see if the variable name is something other than PCT_ROW. If it is a different name, then use the name that is present in that data set.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 12:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738561#M35869</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-03T12:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738612#M35875</link>
      <description>You forgot the outpct in the TABLE statement.</description>
      <pubDate>Mon, 03 May 2021 15:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Ranking/m-p/738612#M35875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-03T15:11:02Z</dc:date>
    </item>
  </channel>
</rss>

