R 包 partykit:如何使用 teststat='Teststatistic' 参数

R package partykit : how to use teststat='Teststatistic' argument

我正在用 partykit 包做一个 ctree

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

而且我有 testtype="Teststatistic" 和 partykit 的警告消息(与派对相反):

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

我该如何解决这个问题?

我认为这是 partykit 当前 CRAN 版本中的一个错误,Torsten 在 R-Forge 的开发版本中修复了该错误。 运行

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

你可以做到

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)