<?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 HPSPLIT using Bootstrapped Samples in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HPSPLIT-using-Bootstrapped-Samples/m-p/557975#M74804</link>
    <description>&lt;P&gt;Well I put the macro wrapper around it so it runs the different bootstrap samples, but&amp;nbsp;still&amp;nbsp;looking for a way to pull out the split value on the age variable.&amp;nbsp;So for the below code I would like the split value for the 5 generated trees - ideally placed into a file. As you can see, the code outputs a&amp;nbsp;file with the tree steps, but given my code overwrites the outputted file. Note sure if getting it to output 5 files and scrapping the values out of those is a good idea or if ODS TRACE can be used to find the pieces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=sashelp.heart out=heart_boot NOPRINT 
     seed=1                                         
     method=urs 
     samprate=1                          
     outhits
     rep = 5; 
run;

ods graphics on;
data heart_boot_trim;
	set heart_boot;
	keep Replicate status ageatstart;
run;

ods graphics on;
%macro run_model;
     %do i=1 %to 5;
proc hpsplit data=heart_boot_trim maxdepth=1 ;
	where replicate = &amp;amp;i;
/*	by Replicate; */
   class Status;
   model Status (event='Dead') = AgeAtStart;
   prune costcomplexity;
   partition fraction(validate=0.3 seed=1234);
   rules file='rules&amp;amp;&amp;amp;i.txt';
run;
	%end;
	%mend run_model;
%run_model;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the desired file would have something like:&lt;/P&gt;
&lt;P&gt;Sample&amp;nbsp;Split_Value&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;45.340&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 47.150&lt;/P&gt;
&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.170&lt;/P&gt;
&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46.020&lt;/P&gt;
&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.340&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 20:54:56 GMT</pubDate>
    <dc:creator>H</dc:creator>
    <dc:date>2019-05-10T20:54:56Z</dc:date>
    <item>
      <title>PROC HPSPLIT using Bootstrapped Samples</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HPSPLIT-using-Bootstrapped-Samples/m-p/557885#M74796</link>
      <description>&lt;P&gt;Hey community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a sample that I am running through HPSPIT for a binary (one-split) decision tree. I was planning to run a bunch of bootstrap versions of the set through the procedure and record what&amp;nbsp;the value&amp;nbsp;it is splitting on for the single continuous predictor. I created a reproachable example below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Issue, PROC HPSPLIT seems not to have a BY statement option. I suppose a work around is using wrap around piece of code that feeds the Replicate value into a where statement. I could probably figure that out, but I am a realist&amp;nbsp; and know it would take me over an hour to get it to work, so I am soliciting you all's help to write it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second issue, since you all are very savvy, I was also going to see if you could figure out a way to pull out the split value for each bootstrap sample. The current code just has B=5, but say if I bump it up to 50, could you all help create an automated way to pull out all of the split values and put them into a working SAS file. Let me know if you have questions!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=sashelp.heart out=heart_boot NOPRINT 
        seed=1                                         
	method=urs 
	samprate=1                          
        outhits
	rep = 5; 
run;


data heart_boot_trim;
	set heart_boot;
	keep Replicate status ageatstart;
run;

ods graphics on;
ods trace on;
proc hpsplit data=heart_boot_trim maxdepth=1 ;
/*	by Replicate; */  /*doesn't work*/
        class Status;
        model Status (event='Dead') = AgeAtStart;
       prune costcomplexity;
       partition fraction(validate=0.3 seed=1234);
       rules file='rules.txt';
run;
ods graphics off;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2019 16:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-HPSPLIT-using-Bootstrapped-Samples/m-p/557885#M74796</guid>
      <dc:creator>H</dc:creator>
      <dc:date>2019-05-10T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC HPSPLIT using Bootstrapped Samples</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HPSPLIT-using-Bootstrapped-Samples/m-p/557975#M74804</link>
      <description>&lt;P&gt;Well I put the macro wrapper around it so it runs the different bootstrap samples, but&amp;nbsp;still&amp;nbsp;looking for a way to pull out the split value on the age variable.&amp;nbsp;So for the below code I would like the split value for the 5 generated trees - ideally placed into a file. As you can see, the code outputs a&amp;nbsp;file with the tree steps, but given my code overwrites the outputted file. Note sure if getting it to output 5 files and scrapping the values out of those is a good idea or if ODS TRACE can be used to find the pieces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=sashelp.heart out=heart_boot NOPRINT 
     seed=1                                         
     method=urs 
     samprate=1                          
     outhits
     rep = 5; 
run;

ods graphics on;
data heart_boot_trim;
	set heart_boot;
	keep Replicate status ageatstart;
run;

ods graphics on;
%macro run_model;
     %do i=1 %to 5;
proc hpsplit data=heart_boot_trim maxdepth=1 ;
	where replicate = &amp;amp;i;
/*	by Replicate; */
   class Status;
   model Status (event='Dead') = AgeAtStart;
   prune costcomplexity;
   partition fraction(validate=0.3 seed=1234);
   rules file='rules&amp;amp;&amp;amp;i.txt';
run;
	%end;
	%mend run_model;
%run_model;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the desired file would have something like:&lt;/P&gt;
&lt;P&gt;Sample&amp;nbsp;Split_Value&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;45.340&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 47.150&lt;/P&gt;
&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.170&lt;/P&gt;
&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46.020&lt;/P&gt;
&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.340&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-HPSPLIT-using-Bootstrapped-Samples/m-p/557975#M74804</guid>
      <dc:creator>H</dc:creator>
      <dc:date>2019-05-10T20:54:56Z</dc:date>
    </item>
  </channel>
</rss>

