BookmarkSubscribeRSS Feed
art297
Opal | Level 21

I presume this is a good question for Rick, but everyone is welcome to respond.

The treedisc macro (i.e., http://www.psych.yorku.ca/friendly/lab/files/macros/treedisc.sas ) used to be provided by, downloadable from, and supported by SAS.  To run it, one first has to run another macro, namely xmaro (http://support.sas.com/kb/25/035.html ).  If you've never heard of it, it is a macro that can produce decision trees.  One needs SAS OR to view the trees, but I typically have always found that the text file results were quite sufficient in themselves.

My question, since I don't always have SAS/IML (which is called by the treedisc macro), can anyone provide a version that only needs base SAS and, possibly, SAS/STAT?

TIA,

Art

3 REPLIES 3
Rick_SAS
SAS Super FREQ

It is ironic that you posted this question to the SAS/IML Support Community, since you are asking whether someone can rewrite this program in a way that avoids using IML. 

This functionality is available in Enterprise Miner, but I doubt that it can be implemented easily by using SAS/STAT and Base SAS.

art297
Opal | Level 21

Rick,

My choice of forum was quite intentional as the answer requires the knowledge of someone who knows what proc iml is used for in the macro and, knowing that, whether it can be replicated without undergoing the expense of either EM or IML.

Art

art297
Opal | Level 21

Since no one answered my question, I thought I'd share what I just discovered. I was able to obtain the same results as obtained with the treedisc macro by running the following code in R (including a jpg of the tree itself which I've never been able to get from the macro since I don't license SAS/OR):

    # PARTY package

    library(party)

    jpeg('c:\\art\\R Plot%d.jpg')

    frmla = possible_target_bank ~ total_customers

    (ct = ctree(frmla, data = data4tree))

    plot(ct, main="Conditional Inference Tree")

     #Table of prediction errors

    table(predict(ct))

    # Estimated class probabilities

    tr.pred = predict(ct, newdata=data4tree, type="prob")

SAS INNOVATE 2024

innovate-wordmarks-white-horiz.png

SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 3 replies
  • 1360 views
  • 0 likes
  • 2 in conversation