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.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1503 views
  • 0 likes
  • 2 in conversation