Learn R Programming

gsearly (version 1.0.0)

plotPower: A power plot for a gsearly model

Description

A power plot for a gsearly model.

Usage

plotPower(mod, xlim=NA, ylim=NA, xlab=NA, ylab=NA, title=NULL,
    col=c(1,2), lty=NA, pch=3, las=1, legpos=c("bottomright","topright"),
    xtype="theta", delta=seq(0,1,0.05), legstudy=NA, ...)

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; default depends on xtype setting such that if "delta", then label is "Standardized effect size" or if "theta", then label is "Effect size".

ylab

A label for the y axis; default "Cumulative boundary crossing probability".

title

A main title for the plot; default NULL.

col

Plotting colours for the lower and upper boundaries; default c(1, 2).

lty

Line types, which should be a numeric vector of length equal to the number of looks (mod$power$nlooks); default 1:nlooks.

pch

Plotting character or symbol for points; default 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.

legpos

Legend position is a vector of length 2 giving the positions of the legends (interims and probabilities), which are one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center"; default "topleft".

xtype

X-axis options are either "delta" or "theta", the former uses theta/sd (standardized effect size) and the latter theta; default "theta".

delta

An ordered vector of values at which the probabilities are calculated. Smoother curves are obtained if the intervals between values are smaller; default seq(0, 1, 0.05).

legstudy

A label for the study name in the legend; default is "study".

...

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.0010,0.0100,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)
 plotPower(rctdesign)

Run the code above in your browser using DataLab