Learn R Programming

cir (version 2.1.1)

plot.DRtrace: PLotting Methods for DRtrace, doseResponse Objects

Description

Plotting methods for doseResponse and DRtrace classes.

Usage

# S3 method for DRtrace
plot(
  x,
  xlab = "Patient Order",
  ylab = "Dose",
  shape = "circle",
  connect = TRUE,
  ...
)

# S3 method for doseResponse plot( x, xlab = "Dose", ylab = "Response", pch = "X", varsize = TRUE, refsize = 1/mean(x$weight), connect = FALSE, ... )

Arguments

x

the object, whether DRtrace or doseResponse

xlab, ylab

x-axis and y-axis labels passed on to plot

shape

the plotting shape (DRtrace only): 'circle' (default), 'square', or 'triangle'

connect

logical: whether to connect the symbols (generic plotting type 'b'). Default TRUE for DRtrace and FALSE for doseResponse

...

Other arguments passed on to plot.

pch

the plotting character (doseResponse only), the default being 'X' marks

varsize

(doseResponse only) logical, should symbol size vary by sample size? Default TRUE

refsize

(doseResponse only) a reference size by which the plotting sizes will be divided. Larger values make the symbols smaller. Default is mean(dr$weight).

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.

See Also

doseResponse, DRtrace

Examples

Run this code
# NOT RUN {
## Summary of raw data from the notorious Neuenschwander et al. (Stat. Med., 2008) trial
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))
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",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)
lines(neunCIR0$shrinkage$x,neunCIR0$shrinkage$y,type='b',pch=19)
legend(1,1,pch=c(4,19),legend=c('Observations','CIR (IR is same)'),bty='n')
# }

Run the code above in your browser using DataLab