[R] Changing the labels on a regression tree (repeat post - with added clarity)
Peter Flom
flom at ndri.org
Mon Jul 21 16:43:54 CEST 2003
Hello
I posted a very similar question last week, but the responses I
received indicated that my post was unclear....
I have a regression tree created in rpart with
tr.logypsx <- rpart(log(YPSX + 1)
~AGE+drugfact+sexfact+as.numeric(OBSX) +WINDLE + EABUSED + PABAU +
positive.par + control.par + lenient.par, xval = 10, method = 'anova',
cp = 0.0001, data = duhray2)
and then
tr.logypsx.pruned <- prune(tr.logypsx, cp = .012)
The labels at the nodes are, naturally enough, the dependent variable
[log(YPSX + 1)]. This DV is better than YPSX because YPSX is extremely
skew. However, the intuitively meaningful variable is YPSX. Is there a
way to change the labels to reflect this?
Thanks in advance, and sorry for the repeat
Peter
Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
www.peterflom.com
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)
More information about the R-help
mailing list