cryan at binghamton.edu
2009-Nov-21 21:28 UTC
[R] changing plot symbol and/or size in plot(cox.zph)
Is there a way to make the plot(cox.zph(model)) use some other symbol than open circles? plot(cox.zph(model), pch=whatever) seems to have no effect. Thanks. --Chris Ryan
David Winsemius
2009-Nov-21 22:42 UTC
[R] changing plot symbol and/or size in plot(cox.zph)
On Nov 21, 2009, at 4:28 PM, <cryan at binghamton.edu> wrote:> Is there a way to make the > > plot(cox.zph(model)) > > use some other symbol than open circles?Yes, but after looking at the code, the points call does not have trailing "..." so, not without modifying the function: library(survival) methods(plot) getAnywhere(plot.cox.zph) Now just hack the function: plot.cox.zph <gives you the function arguent list and body. plot.cox.zph2 <- <insert arguments and code here> And change these lines: + if (resid) + points(xx, y) + lines(pred.x, yhat) to + if (resid) + points(xx, y, ...) + lines(pred.x, yhat) Then using the example in help(cox.zph) : plot.cox.zph2(temp, pch=4) gives you "x"'s instead of "o"'s -- David Winsemius, MD Heritage Laboratories West Hartford, CT