Learn R Programming

WPC (version 1.0)

SoloScattorPlot: Generate Scatter Plots for Time-to-Event and Biomarkers for One Group

Description

This function will generate the scatter plot of time-to-event and biomarker for one dataset. It helps to visualize the relationship between survival endpoints and biomarkers.

Usage

SoloScattorPlot(data, cutoff, xlab, ylab, main, ylim, xlim, col1, col2, lwd, pch1, pch2, legendloc, legendtxt, ncol)

Arguments

data
It is a data object with three variables included: event: the survival time, a positive numerical vector with no missing values; censor: the censor information, a vector with 1 indicating an event and 0 indicating right censored; marker: the biomarker information, or other interesting variables.
cutoff
This is to define the interesting data cutoff time point to see the relationship between time-to-events and markers.
xlab
It is the title for x axis; default is "Marker".
ylab
It is the title for y axis; default is "Time to Event".
main
It is the title for the plot; default is "Scattor Plot".
ylim
It creates the continuous scale of y axis of the plot; default is "c(0,3600)".
xlim
It creates the continuous scale of y axis of the plot; default is "c(0,100)".
col1
It defines the color of the dot; default is "red".
col2
It defines the color of the cutoff line; default is "red".
lwd
It defines the width of the cutoff line; default is "2".
pch1
It defines the type of the dot for event; default is "20".
pch2
It defines the type of the dot for censor; default is "21".
legendloc
It specifies the location of the legend; default is "bottomright".
legendtxt
It provides the text of the legend; default is "c("death","censor")".
ncol
It specifies the number of columns displayed in legend; default=1

References

Yang H., Tang R., Hale M. and Huang J. (2016) A visualization method measuring the performance of biomarkers for guiding treatment decisions Pharmaceutical Statistics, 15(2), 1539-1612

See Also

DuoScattorPlot, TrioScattorPlot

Examples

Run this code
	## Create the data object for the function

	o.data = data.frame(event=wpcdata$OSday, censor=wpcdata$OScensor, marker=wpcdata$Biomarker1)

	## Print out the figure:
	
	SoloScattorPlot(o.data,180,xlab=c("Marker"),ylab=c("Survival Rate"),
			main=c("Weighted Predictiveness Curve"),ylim=c(0,600),xlim=c(0,100),
			col1="red",col2="red",lwd=2,pch1=20,pch2=21,legendloc="bottomright",ncol=1)

Run the code above in your browser using DataLab