Re: [S] predict.tree with tssa object

Prof Brian D Ripley (
Thu, 9 Jul 1998 15:56:59 +0100 (BST)

On Thu, 9 Jul 1998, Victor Moreno wrote:

> I am trying to adapt F.Harrel's validate.tree in Hmisc to accept an
> tssa object.

See below. This seems theoretically impossible.
> Function predict.tree should work with tssa objects according to the
> documentation, and results seem correct when predictions are
> calculated with the same dataset that generated the tssa object.

I am very surprised: predict.tree calls model.frame.tree, and that
expects the object to have been produced by tree. For me,
(examples from V&R complements)

predict(VA.tssa) fails
predict(VA.tssa, newdata=VA) works correctly.

> However, when "newdata" argument is used, the result is a unique
> value for all observations. Since prediction seems bo be actually
> done inside a C call, I can't trace where the problem is.

Look at the C code in my treefix library for how it is done in 4.0.

Are you by any chance predicting type="tree"? That definitely will
not work for tssa: it only knows about regression and classification trees.

> I would appreciate if somebody can help with this or give advise
> to validate trees with survival data. I have tested also Rpart and
> survtree but none seem to have ready validation functions.

Whatever is a `ready validation function'? validate.tree is said to be a
modification of cv.tree, and rpart has xpred for such a purpose. However,
I think there is something wrong here: cv.tree is a method to choose the
cost-complexity k, not to validate anything, and tssa has no analogue of
cost-complexity. So there is no analogue of cv.tree for tssa (nor for

You are dealing here with third-party packages: please address
your questions to their authors (as the S-news intro requests).
I think there is a complex interaction between their assumptions.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news