<?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 Tecnique that maximizes expenses by group in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Tecnique-that-maximizes-expenses-by-group/m-p/157231#M8221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a doubt that I believe has an easy solution but need your help to find it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with 8 columns. the first is my patientID, the next 6 are profile patient information with categorical values (eg: location, gender, age, disease, etc) and the last column is a continuous vAriable that tells me how much they paid in the hospital. I need to perform two pieces of analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1) identify those groups (based on all the possible combinations) that maximize, by patient, the total spent&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2) same as 1) but creating a rule stating that i only want groups with more than x patients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i do this in sas eg/em/base?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks.&lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Nov 2013 13:30:34 GMT</pubDate>
    <dc:creator>Stu1979</dc:creator>
    <dc:date>2013-11-27T13:30:34Z</dc:date>
    <item>
      <title>Tecnique that maximizes expenses by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Tecnique-that-maximizes-expenses-by-group/m-p/157231#M8221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a doubt that I believe has an easy solution but need your help to find it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with 8 columns. the first is my patientID, the next 6 are profile patient information with categorical values (eg: location, gender, age, disease, etc) and the last column is a continuous vAriable that tells me how much they paid in the hospital. I need to perform two pieces of analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1) identify those groups (based on all the possible combinations) that maximize, by patient, the total spent&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2) same as 1) but creating a rule stating that i only want groups with more than x patients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i do this in sas eg/em/base?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tks.&lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 13:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Tecnique-that-maximizes-expenses-by-group/m-p/157231#M8221</guid>
      <dc:creator>Stu1979</dc:creator>
      <dc:date>2013-11-27T13:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tecnique that maximizes expenses by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Tecnique-that-maximizes-expenses-by-group/m-p/157232#M8222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, let's define what the problem asks for.&amp;nbsp; I would interpret this as finding the groups with the largest average spent.&amp;nbsp; If that's not right, you'll have to explain what you mean by "maximize, by patient, the total spent". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, this is an easy task for SAS in theory.&amp;nbsp; You can get the average spent for every possible group easily:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=have missing;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; class location gender age disease /* plus 2 more variables not named in the problem */;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var amount_paid;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output out=stats mean=avg_paid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output data set STATS will even contain _FREQ_, holding the number of patients in the group.&amp;nbsp; So applying rules about minimum group size is easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trick will be whether your machine has enough memory to compute statistics for all groups at the same time.&amp;nbsp; If you don't run out of memory, the continuation is easy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=stats;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by descending avg_paid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=stats (obs=50);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to learn a few things about the CLASS statement:&amp;nbsp; how to translate from _TYPE_ to the group definition, and how the CLASS statement handles missing values (assuming that your data actually contains some missing values).&lt;/P&gt;&lt;P&gt;If you do run out of memory, a more complex strategy would be necessary.&amp;nbsp; But this is a good place to start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 15:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Tecnique-that-maximizes-expenses-by-group/m-p/157232#M8222</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-11-27T15:10:07Z</dc:date>
    </item>
  </channel>
</rss>

