0

I am doing a ctree with partykit package

fitform<- Surv(delai_efs ,evt_efs) ~ age + sexer + bmiins + tailler + ins_diab + ins_atca + ins_atctips + ins_atctvp + iscf + aclf_hep_chk + aclf_rein + aclf_coag + aclf_neuro + aclf_pneumo  + don_age + don_sex + don_tai + don_bmi + don_dven + don_acr + don_diab + don_eti + thm + grf_usi + cirrhose + chc + split + hepatite_fulminante + greffe_combinee + dial + don_leu_last + don_na_last + don_tp_last + don_pla_last + don_bilt_last + don_pal_last + don_sgot_last + don_sgpt_last + don_ggt_last + don_cre_last + don_leu_highest + don_na_highest + don_tp_highest + don_pla_highest + don_bilt_highest + don_pal_highest + don_sgot_highest + don_sgpt_highest + don_ggt_highest + don_cre_highest

And I have this warning message with testtype="Teststatistic" with partykit (contrary to party) :

Warning messages:
1: In min(fmP(p), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf
2: In min(fmP(p), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf
3: In min(fmP(p), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf
4: In min(fmP(p), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf

How can i do to solve this problem?

S.Zebachi
  • 15
  • 6
  • 2
    It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data so we can run the code to see what's going on. – MrFlick May 30 '17 at 14:59
  • @MrFlick : Sorry, i will try to do a reproducible example the next time. – S.Zebachi May 31 '17 at 08:03

1 Answers1

1

I think this was a bug in the current CRAN release of partykit that Torsten fixed in the development version on R-Forge. After running

install.packages("partykit", repos = "http://R-Forge.R-project.org")

you can do

library("partykit")
library("survival")
data("GBSG2", package = "TH.data")
ct <- ctree(Surv(time, cens) ~ horTh + age + menostat + tsize +
  tgrade + pnodes + progrec + estrec, data = GBSG2,
  testtype = "Teststatistic", mincriterion = 10)
plot(ct)

ctree-survival

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • Thanks again for solving my problem !! it works well ! Note that an inner node in my partykit::ctree is different compared to my party:ctree with the same formula and data. – S.Zebachi May 31 '17 at 08:45
  • I would like also to understand what does it mean when we can't see the pvalue in the ctree whereas i run `inner_panel=node_inner(tree,pval=TRUE)` ? – S.Zebachi May 31 '17 at 08:54
  • By opting to use only the `"Teststatistic"` rather than the default `"Bonferroni"`-corrected p-values, you declare that you do not want to use the p-values for constructing the tree. Hence, they are not even computed and consequently also not shown. As for the differing results between `party` and `partykit`: Please provide a minimal, self-contained, and reproducible example. Then we can have a look at what changed. – Achim Zeileis May 31 '17 at 09:22
  • Unfortunately @AchimZeileis, i do not have the right to send the data even partially (there are clinical data). Thank you for explaining me how does `Teststatistic` works. Just a small question, how can i plot with the `partykit` package a ctree built by `party` package ? – S.Zebachi May 31 '17 at 14:40
  • It's not easily possible to plot party trees with partykit. And as for the data: You do not have to reveal the real data. Providing an artificial data set that has the same problem is even better for replicating the problem. – Achim Zeileis May 31 '17 at 17:56
  • Of course but the problem is that i don't manage actually to find an another dataset which shows differences between party::ctree and partykit::ctree. So @AchimZeileis thank you again for your help! – S.Zebachi Jun 01 '17 at 14:49