Message-ID: <70901666-F703-4DF2-BA81-E35E4C6B1456@comcast.net>
Date: 2009-11-21T22:42:32Z
From: David Winsemius
Subject: changing plot symbol and/or size in plot(cox.zph)
In-Reply-To: <20091121162839.DEM16033@mpmail.binghamton.edu>
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