在生存 ctree 图中调整终端面板中的 yscale
Adjusting yscale in terminal panel in survival ctree plot
我正在使用包 party
/partykit
中的 ctree()
来绘制生存模型的生存树。
总体存活率良好,最差存活率为 95%,所以我想将 yscale
更改为 c(0.9, 1)
,以便面板在最终情节中有用。
我需要调整生存地块终端面板中的 yscale
参数,但这会引发错误,而且似乎不可能。
这在 ctree()
中可行吗?还是我应该使用其他方法?
我已将 yscale
的参数添加到 terminal_panel
函数,但这会引发错误
"Error in survfitKM(X, newY, casewt, ...) :
unused argument (yscale = c(0.9, 1))"
plot(taperfit.ct, terminal_panel = node_surv(taperfit.ct, yscale = c(0.9, 1)))
我希望这会改变比例以放大 KM 图,y 轴比例从 90% 存活率到 100% 存活率,但这并没有发生。
到目前为止,node_surv()
函数没有 yscale
参数,因此当您提供它时,它被传递给错误的函数并产生错误。但是,我只是将它添加到 R-Forge 上的 partykit
存储库中。因此,如果您签出并从那里构建 partykit
您的代码
plot(taperfit.ct, terminal_panel = node_surv(taperfit.ct, yscale = c(0.9, 1)))
或简称
plot(taperfit.ct, tp_args = list(yscale = c(0.9, 1)))
应该可以。
如果您使用旧的 party
实现(或者在构建 partykit
时遇到问题),您也可以手动解决该问题。
taperplot <- node_surv(taperfit.ct, yscale = c(0.9, 1))
fix(taperplot) ## go to line 11 and change the definition of yscale
plot(taperfit.ct, terminal_panel = taperplot)
我正在使用包 party
/partykit
中的 ctree()
来绘制生存模型的生存树。
总体存活率良好,最差存活率为 95%,所以我想将 yscale
更改为 c(0.9, 1)
,以便面板在最终情节中有用。
我需要调整生存地块终端面板中的 yscale
参数,但这会引发错误,而且似乎不可能。
这在 ctree()
中可行吗?还是我应该使用其他方法?
我已将 yscale
的参数添加到 terminal_panel
函数,但这会引发错误
"Error in survfitKM(X, newY, casewt, ...) :
unused argument (yscale = c(0.9, 1))"
plot(taperfit.ct, terminal_panel = node_surv(taperfit.ct, yscale = c(0.9, 1)))
我希望这会改变比例以放大 KM 图,y 轴比例从 90% 存活率到 100% 存活率,但这并没有发生。
到目前为止,node_surv()
函数没有 yscale
参数,因此当您提供它时,它被传递给错误的函数并产生错误。但是,我只是将它添加到 R-Forge 上的 partykit
存储库中。因此,如果您签出并从那里构建 partykit
您的代码
plot(taperfit.ct, terminal_panel = node_surv(taperfit.ct, yscale = c(0.9, 1)))
或简称
plot(taperfit.ct, tp_args = list(yscale = c(0.9, 1)))
应该可以。
如果您使用旧的 party
实现(或者在构建 partykit
时遇到问题),您也可以手动解决该问题。
taperplot <- node_surv(taperfit.ct, yscale = c(0.9, 1))
fix(taperplot) ## go to line 11 and change the definition of yscale
plot(taperfit.ct, terminal_panel = taperplot)