plot.DRtrace {cir} | R Documentation |
Plotting Methods for DRtrace, doseResponse Objects
Description
Plotting methods for doseResponse
and DRtrace
classes.
Usage
## S3 method for class 'DRtrace'
plot(
x,
xlab = "Patient Order",
ylab = "Dose",
shape = "circle",
connect = TRUE,
mcol = 1,
dosevals = NULL,
offset = 0.2,
...
)
## S3 method for class 'doseResponse'
plot(
x,
xlab = "Dose",
ylab = "Response",
pch = "X",
varsize = TRUE,
refsize = sqrt(1/mean(x$weight)),
connect = FALSE,
mcol = 1,
dosevals = NULL,
...
)
Arguments
x |
the object, whether DRtrace or doseResponse |
xlab , ylab |
x-axis and y-axis labels passed on to |
shape |
the plotting shape (DRtrace only): 'circle' (default), 'square', or 'triangle' |
connect |
logical: whether to connect the symbols (generic plotting type 'b'). Default |
mcol |
The color of the main plotting symbols and connecting lines. Default 1 (the current palette's first color). Note: if you change the color and inadvertently use |
dosevals |
Dose values to be plotted along the x-axis ( |
offset |
( |
... |
Other arguments passed on to Conversely, putting values on a different scale into |
pch |
the plotting character (doseResponse only), the default being 'X' marks |
varsize |
( |
refsize |
( |
Details
Generic methods for dose-response trajectory/trace (DRtrace
), and dose-response summary (doseResponse
) class objects.
The DRtrace
plotting uses the typical convention of plotting dose-finding experimental trace, with dose levels (x) in the vertical axis and 1/0 responses (y) denoted via filled/empty circles, respectively. In other words, this generic plotting method is only relevant for binary 0/1 outcomes.
The doseResponse
plotting has response rate on the y-axis and dose on the x-axis, and plots symbols whose area is proportional to the weights.
Author(s)
Assaf P. Oron <assaf.oron.at.gmail.com>
See Also
Examples
## Summary of raw data from the notorious Neuenschwander et al. (Stat. Med., 2008) trial
## Note the use of the 'cohort' argument to specify the cohort order
neundatTrace = DRtrace(x = c(rep(1:4,each=4), 7, 7, rep(6,9)),
y = c(rep(0,16), 1,1, rep(c(0,0,1),2), 0,0,0),
cohort = rep(1:8, c(4,4,4,4, 2, 3,3,3)) )
par(mar=c(3,3,3,1), mgp=c(2,.5,0), tcl=-0.25)
layout(t(1:2))
plot(neundatTrace ,main="N. et al. (2008) Cohort Trace", xlab = 'Cohort',
ylab="Ordinal Dose Level" ,cex.main=1.5)
## Same data, in 'doseResponse' format with actual doses rather than dose levels
neundatDose = doseResponse(x=c(1,2.5,5,10,20,25), y = c(rep(0,4),2/9,1), wt = c(3,4,5,4,9,2) )
plot(neundatDose ,main="N. et al. (2008) Final Dose-Toxicity", ylim=c(0,1),
xlab="Dose (mg/sq.m./wk)", ylab="Toxicity Response Curve (F)", cex.main=1.5)
## We can also convert the DRtrace object to doseResponse...
neundatLevel = doseResponse(neundatTrace)
### Now plotting the former, vs. IR/CIR estimates
neunCIR0 = cirPAVA(neundatDose,full=TRUE, adaptiveShrink = TRUE, target = 0.3)
lines(neunCIR0$shrinkage$x, neunCIR0$shrinkage$y, type='b' ,pch=19)
legend(1,1, pch=c(4,19), legend=c('Observations', 'CIR w/bias corr.'), bty='n')