Learn R Programming

gsearly (version 1.0.0)

plotInform: An information plot for a gsearly model

Description

An information or variance plot for a gsearly model.

Usage

plotInform(mod, xlim=NA, ylim=NA, xlab=NA, ylab=NA, title=NULL, col=1,
    lty=1, pch=3, las=1, tlag=c(0,0), wopcol=grey(0.9), intlab=NA, labpos=1,
    legpos="bottomleft", ptype="var", pcol=1, ...)

Value

A plot of the selected type or a list consisting of the plotted line and interim point data.

Arguments

mod

A gsearly model from function gsearlyModel or gsearlyUser functions.

xlim

The x limits c(x1, x2) of the plot; default NA.

ylim

The y limits of the plot; default NA.

xlab

A label for the x axis; defaults to "Time".

ylab

A label for the y axis; defaults to "Information fraction" if ptype is "inform" or "SE" (standard error) if "var".

title

A main title for the plot; default NULL.

col

Default plotting color for lines and points; default 1.

lty

Line type; default 1.

pch

Plotting character or symbol for points; 3

las

A numeric value which is one of either 0, 1, 2 or 3; the style of axis labels, 0: always parallel to the axis, 1: always horizontal (default), 2: always perpendicular to the axis, 3: always vertical.

tlag

A vector of length 2, with positive values for time lags, pre-recruitment and post-recruitment, over which to extend the plotted lines; default c(0, 0).

wopcol

Color for the window of opportunity region, default grey(0.9). Set to grey(1) for no color.

intlab

A vector of labels for the interim analyses; defaults to t[1], t[2], etc. Set to NULL, for no labels.

labpos

Position of interim labels; default 1

legpos

Legend position is one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center"; default "topleft".

ptype

Plot type, which is one of "var" or "inform", for a variance or information plot, with the former plotting the square root of the variance of the treatment effect (sqrt(var)) and the latter the information (1/var); default "var".

pcol

Color for points; default 1.

...

Further arguments to plot function.

Examples

Run this code

 # For 90 percent power (pow), a call to gsearlyModel provides a feasible design
 fp <- c(0.0000,0.0010,0.0250)
 tn <- c(0.4800,0.7200,0.9750)
 rctdesign <- gsearlyModel(rmodel="dilin", trecruit=36, s=3, tfu=c(3,6,12),
                   tinterims=c(16,31), pow=0.8,
                   cmodel="exponential", sd=20, rho=0.75, theta=8, fp=fp, tn=tn)
 plotInform(rctdesign)

Run the code above in your browser using DataLab