<?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 hpbin - group by in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821505#M324320</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/372747"&gt;@Toni2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks. It looks challenging as i have 50 variables and 80 months. Can I use something like %do i=1 %to 80 months inside hpbin?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you should be dynamically generating your variable list and month list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASHELP.VCOLUMN -&amp;gt; contains a list of variables in your data set, can filter by type&lt;/P&gt;
&lt;P&gt;PROC FREQ/SQL to get a list of distinct month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cross join the two lists via SQL to create a table of all combinations you need to run this for. This will be your two parameters to each macro call.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Then use CALL EXECUTE to call the macro for all combinations needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jul 2022 22:17:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-07-04T22:17:42Z</dc:date>
    <item>
      <title>Proc hpbin - group by</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821487#M324315</link>
      <description>&lt;P&gt;i want to produce Information Value (IV) for a continuous variable using the proc hpbin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, i need to estimate the IV per monthid and not sure how to group by in the hpbin procedure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example how my data looks like and at the bottom it is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="64" height="19" style="height: 14.4pt; width: 48pt;"&gt;MonthID&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Var1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Var2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;3&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;4&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;3&lt;/TD&gt;
&lt;TD align="right"&gt;6&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;3&lt;/TD&gt;
&lt;TD align="right"&gt;7&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;4&lt;/TD&gt;
&lt;TD align="right"&gt;8&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;4&lt;/TD&gt;
&lt;TD align="right"&gt;9&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;4&lt;/TD&gt;
&lt;TD align="right"&gt;10&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;5&lt;/TD&gt;
&lt;TD align="right"&gt;11&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.4pt;"&gt;5&lt;/TD&gt;
&lt;TD align="right"&gt;12&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro IV_continuous;

	proc hpbin data = data1 numbin = 10;
		input var1;
		ods output mapping = binning;
	run;

	proc hpbin data = data1 woe bins_meta=binning;
		target var2;
		ods output infovalue = continuous_iv_10 woe =continuous_woe_table_10;
	run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jul 2022 15:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821487#M324315</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-07-04T15:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc hpbin - group by</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821498#M324316</link>
      <description>From the docs it doesn't look like HPBIN supports BY group processing, which makes some sense for HP procedures. You likely to need to add a WHERE clause to the procedure to have it filter the data for each month as you pass it in.</description>
      <pubDate>Mon, 04 Jul 2022 19:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821498#M324316</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-07-04T19:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc hpbin - group by</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821503#M324318</link>
      <description>Thanks. It looks challenging as i have 50 variables and 80 months. Can I use something like %do i=1 %to 80 months inside hpbin?</description>
      <pubDate>Mon, 04 Jul 2022 21:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821503#M324318</guid>
      <dc:creator>Toni2</dc:creator>
      <dc:date>2022-07-04T21:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc hpbin - group by</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821505#M324320</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/372747"&gt;@Toni2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks. It looks challenging as i have 50 variables and 80 months. Can I use something like %do i=1 %to 80 months inside hpbin?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you should be dynamically generating your variable list and month list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASHELP.VCOLUMN -&amp;gt; contains a list of variables in your data set, can filter by type&lt;/P&gt;
&lt;P&gt;PROC FREQ/SQL to get a list of distinct month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cross join the two lists via SQL to create a table of all combinations you need to run this for. This will be your two parameters to each macro call.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Then use CALL EXECUTE to call the macro for all combinations needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 22:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-hpbin-group-by/m-p/821505#M324320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-07-04T22:17:42Z</dc:date>
    </item>
  </channel>
</rss>

