On Fri, 28 Jun 2002, Peter Flom wrote:
> Hello
>
> I am interested in fitting a tree model for a variable which is ordinal, and
> where the distribution is far from uniform.
>
> More specifically, I would like to investigate drug use, which we have
> operationalized as hardest drug used in the last year (none, marijuana,
> cocaine/heroin (not crack, and not injected), crack, and any injected drug.
>
> The distribution in our sample is
> none - 186 marijuana - 136 cocaine/heroin 137 crack - 41 injection - 28
>
>
> The ordinality means that the misclassification costs are uneven (e.g.,
> calling a marijuana user a nonuser is no big deal. Calling an injector a
> nonuser is much more serious).
>
> I have been unable to find out how to do this in the S-Plus manuals; although
> the classic reference (Breiman et al., 1984) offers some hints, they do not
> provide any code (nor do they indicate that they used S-Plus at all).
That predates S-PLUS!
Use rpart and set up a loss matrix in the `parm' argument. You can
find rpart at the Mayo site, and pre-compiled for Windows at mine
(S+2000 and S+6 in separate areas).
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
|