Thanks Liaw!

I just implemented it using tapply:
tapply(fit$splits[, "improve"], rownames(fit$splits), sum)

If you can reference me to any other source / example and so on - it would
be great.  but either way - you helped me a lot, thank you !

Tal


----------------Contact
Details:-------------------------------------------------------
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Mon, Mar 8, 2010 at 4:52 PM, Liaw, Andy <andy_l...@merck.com> wrote:

> One way to do it (no p-values) is explained in the original CART book.
> You basically add up all the "improvement" (in fit$split[, "improve"])
> due to each splitting variable.
>
> Andy
>
> From: Tal Galili
> >
> > Simple example:
> >
> > # Classification Tree with rpart
> >
> > library(rpart)
> >
> > # grow tree
> >
> > fit <- rpart(Kyphosis ~ Age + Number + Start,
> >
> >      method="class", data=kyphosis)
> >
> > Now I would like to know how can I measure the "importance"
> > of each of my
> > three explanatory variables (Age, Number, Start) in the model?
> >
> > If this was a regression model, I could have looked at p
> > values from the
> > "anova" F test (between lm models with and without the
> > variable). But what
> > is the equivalence of using "anova" on lm to an rpart object ?
> >
> > Any pointers, insights and references to this question will
> > be helpful.
> >
> > Thanks,
> >
> > Tal
> >
> >
> >
> > ----------------Contact
> > Details:-------------------------------------------------------
> > Contact me: tal.gal...@gmail.com |  972-52-7275845
> > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il
> > (Hebrew) |
> > www.r-statistics.com (English)
> > --------------------------------------------------------------
> > --------------------------------
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> Notice:  This e-mail message, together with any attach...{{dropped:15}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to