10-31-2013 09:22 PM
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?
11-01-2013 09:06 AM
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.
11-01-2013 10:20 AM
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.
08-27-2014 03:23 PM
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
frmla = possible_target_bank ~ total_customers
(ct = ctree(frmla, data = data4tree))
plot(ct, main="Conditional Inference Tree")
#Table of prediction errors
# Estimated class probabilities
tr.pred = predict(ct, newdata=data4tree, type="prob")