Bug 15076 - Add plot=FALSE argument to termplot
Add plot=FALSE argument to termplot
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Wishlist
R 2.15.1 patched
Other Linux
: P5 enhancement
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 18:45 UTC by Terry Therneau
Modified: 2012-10-20 09:15 UTC (History)
0 users

See Also:


Attachments
Updated function (7.88 KB, application/octet-stream)
2012-10-19 18:45 UTC, Terry Therneau
Details
Updated help file (4.97 KB, application/octet-stream)
2012-10-19 18:46 UTC, Terry Therneau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terry Therneau 2012-10-19 18:45:17 UTC
Created attachment 1376 [details]
Updated function

We have a local mod that is used whenever none of the termplot options
is quite right.  It is invoked almost daily for Cox models in order to
put the y axis on a risk scale:

----
fit <- coxph(Surv(time, status) ~ ph.ecog + pspline(age), data=lung)
zz <- termplot(fit, se=TRUE, plot=FALSE)

yy <- zz$age$y + outer(zz$age$se, c(0, -2, 2), '*')
matplot(zz$age$x, exp(yy), log='y', type='l', lty=c(1,2,2),
     xlab="Age", ylab="Relative risk")

----
It is also useful to overlay the plots from two different fits.
The changed to termplot code simply adds a new block of statements.
I've attached updated versions of the .R and .Rd files; all lines except my addition agree with the current devel version.

The best reason I can give for why you should do this: you will be able to  defer requests for adding other new arguments!
Comment 1 Terry Therneau 2012-10-19 18:46:11 UTC
Created attachment 1377 [details]
Updated help file
Comment 2 Brian Ripley 2012-10-20 09:15:13 UTC
Added in R-devel (with \value{} in the documentation).