MVACARTGiniTree1 (R 2.14.2)
MVACARTGiniTree1 performs classification analysis for the US bankruptcy data (CF SEC 2004; bankruptcy.dat) with 84 companies employing the Gini index. It plots a decision tree. Pay attention about your R version. Please have a look at the comment in the code.
Wed, April 25 2012 by Dedy Dwi Prastyo
Make sure that you have installed the latest R-version. The package rpartScore runs only on R (≥ 2.14.2). If your version is older, unkomment the marked lines - but the output might differ.
Description: -
rm(list=ls(all=TRUE)) graphics.off() install.packages("rpart") library(rpart) install.packages("rpartScore") library(rpartScore) x = read.table("bankruptcy.dat") xx = data.frame(x) my.control = rpart.control(minsplit=1, usesurrogate=2, minbucket=1, maxdepth=30, surrogatestyle=1, cp=0) t2 = rpartScore(V3~V1+V2,xx,split = "quad",control=my.control) plot(t2) text(t2,cex=0.5)