Statistical programming, matrix languages, and more

Can treedisc be modified to run with just base sas and sas stat?

Reply
Esteemed Advisor
Posts: 7,285

Can treedisc be modified to run with just base sas and sas stat?

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

SAS Super FREQ
Posts: 3,390

Re: Can treedisc be modified to run with just base sas and sas stat?

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.

Esteemed Advisor
Posts: 7,285

Re: Can treedisc be modified to run with just base sas and sas stat?

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

Esteemed Advisor
Posts: 7,285

Re: Can treedisc be modified to run with just base sas and sas stat?

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")

Ask a Question
Discussion stats
  • 3 replies
  • 677 views
  • 0 likes
  • 2 in conversation