BookmarkSubscribeRSS Feed
tka726
Obsidian | Level 7

Hello!

I am trying to create a decision tree in SAS v9.4 (TS1M1) using PROC HPSPLIT. This is an entirely new procedure for me and it's a little daunting.  Any help is greatly appreciated!!

 

My outcome is a binary group, and I have a few binary predictors. The model will run, but the output is not what I expected. I get  line-by-line output, with nodes all out of order. I am struggling to make sense of it. I was expecting a nice decision tree. Is it because of the version of SAS I am using?

Also - is there a way to get sensitivity, specificity from this procedure?

 

Thanks so much!!!

 

PROC HPSPLIT DATA=ads plots=all maxdepth=7 maxbranch=2 ;
CLASS group race_white asa12 anes_type_gen surg_type male ;
MODEL group= race_white asa12 anes_type_gen surg_type male;
grow gini;
prune gini;
rules file='&path.\test.rtf';

run;

3 REPLIES 3
Reeza
Super User

Have you already tried the examples in the documentation?

I would suggest working through the examples in the documentation first and understand what's happening there and then working on your own data.

 

Most PROCs have a decent example section:

https://documentation.sas.com/?docsetId=statug&docsetVersion=15.1&docsetTarget=statug_hpsplit_exampl...

 

Code specifically:

https://documentation.sas.com/api/docsets/statug/15.1/content/statug_code_hpsplex1.htm?locale=en

 


@tka726 wrote:

Hello!

I am trying to create a decision tree in SAS v9.4 (TS1M1) using PROC HPSPLIT. This is an entirely new procedure for me and it's a little daunting.  Any help is greatly appreciated!!

 

My outcome is a binary group, and I have a few binary predictors. The model will run, but the output is not what I expected. I get  line-by-line output, with nodes all out of order. I am struggling to make sense of it. I was expecting a nice decision tree. Is it because of the version of SAS I am using?

Also - is there a way to get sensitivity, specificity from this procedure?

 

Thanks so much!!!

 

PROC HPSPLIT DATA=ads plots=all maxdepth=7 maxbranch=2 ;
CLASS group race_white asa12 anes_type_gen surg_type male ;
MODEL group= race_white asa12 anes_type_gen surg_type male;
grow gini;
prune gini;
rules file='&path.\test.rtf';

run;


 

Reeza
Super User
I've linked to the latest version of SAS/STAT but you should check the version you need. You can find it by running: 'proc product_status;run;' and it will be in the log - you're looking for SAS/STAT 14.3 or something like that.
PGStats
Opal | Level 21

It is really worth upgrading to a more recent version of HPSPLIT. Especially for the graphs.If I recall correctly, the version you are using doesn't produce any graph. Check out the most recent doc to see what it does now.

PG

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1254 views
  • 0 likes
  • 3 in conversation