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

时间:2017-05-30 14:44:16

标签: r party

我正在使用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

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

我认为这是当前CRAN版本partykit中的一个错误,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)

ctree-survival