[R] ctree for suvival analysis problem

Achim Zeileis Achim.Zeileis at uibk.ac.at
Thu May 17 15:42:07 CEST 2012


On Thu, 17 May 2012, ofraam wrote:

> Hi All,
>
> I'm using the party package to grow conditional inference trees for survival
> analysis.
> When I used party version  party_0.9-9991 everything worked well, but when I
> update to party_1.0-2 (due to using 64bit R), I get an error. For simplicity
> I will show the error I get for the example in the party documentation:
> ### survival analysis
> if (require("ipred")) {
> data("GBSG2", package = "ipred")
> GBSG2ct <- ctree(Surv(time, cens) ~ .,data = GBSG2)
> plot(GBSG2ct)
> treeresponse(GBSG2ct, newdata = GBSG2[1:2,])
> }

Works for me without a problem.

> for the plot(GBSG2ct) line I get the following error:
> Error in Summary.Surv(c(1814, 2018, 712, 1807, 772, 448, 2172, 2161, 471,  :
>  Invalid operation on a survival time
>
> and for treeresponse(GBSG2ct, newdata = GBSG2[1:2,]) I get this error:
> Error: extends(class(y), "Surv") is not TRUE
>
> (I care more about treeresponse but assume it is related).

My guess is that you have loaded package "rms" but haven't told us so. 
This overwrites Surv() in a way that is incompatible with the usage in 
ctree().

Best,
Z


> Any help would be highly appreciated!
>
> Thanks,
> Ofra
>
> --
> View this message in context: http://r.789695.n4.nabble.com/ctree-for-suvival-analysis-problem-tp4630362.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list