plot() function has been extended to work with objects returned by
For objects of type
gsDesign, seven types of plots are provided: z-values at boundaries (default), power,
estimated treatment effects at boundaries,
conditional power at boundaries, spending functions, expected sample size, and B-values at boundaries.
For objects of type
gsProbability plots are available for z-values at boundaries, power (default), estimated treatment effects at boundaries, conditional power, expected sample size and B-values at boundaries.
1 2 3 4
Object of class
1=boundary plot (default for
2=power plot (default for
3=estimated treatment effect at boundaries,
4=conditional power at boundaries,
5=spending function plot
(only available if
6=expected sample size plot, and
7=B-values at boundaries.
Character values for
Default is FALSE, which means ggplot2 graphics are used. If true, base graphics are used for plotting.
This allows many optional arguments that are standard when calling
Other arguments include:
The intent is that many standard
plot() parameters will function as expected; exceptions to this rule exist.
main, xlab, ylab, lty, col, lwd, type, pch, cex have been tested and work for most values of
exception is that
type="l" cannot be overridden when
plottype=2. Default values for labels depend on
the class of
Note that there is some special behavior for values plotted and returned
for power and expected sample size (ASN) plots for a
A call to
x<-gsDesign() produces power and expected sample size for only two
theta values: 0 and
plot(x, plottype="Power") (or
plot(x,plottype="ASN") for a
gsDesign object produces power (expected sample size) curves and returns a
gsDesign object with
theta values determined as follows.
theta is non-null on input, the input value(s) are used.
Otherwise, for a
gsProbability object, the
theta values from that object are used.
gsDesign object where
theta is input as
NULL (the default),
theta=seq(0,2,.05)*x$delta) is used.
gsDesign object, the x-axis values are rescaled to
theta/x$delta and the label for the x-axis theta / delta.
gsProbability object, the values of
theta are plotted and are labeled as theta.
See examples below.
Estimated treatment effects at boundaries are computed dividing the Z-values at the boundaries by the square root of
n.I at that analysis.
Spending functions are plotted for a continuous set of values from 0 to 1.
This option should not be used if a boundary is used or a pointwise spending function is used
sfl="WT", "OF", "Pocock" or
Conditional power is computed using the function
The default input for this routine is
theta="thetahat" which will compute the conditional power at each bound using the estimated treatment effect at that bound.
Otherwise, if the input is
gsDesign object conditional power is computed assuming
theta=x$delta, the original effect size for which the trial was planned.
Average sample number/expected sample size is computed using
n.I at each analysis times the probability of crossing a boundary at that analysis.
If no boundary is crossed at any analysis, this is counted as stopping at the final analysis.
B-values are Z-values multiplied by
Thus, the expected value of a B-value at an analysis is the true value of
theta multiplied by the proportion of total planned observations at that time.
See Proschan, Lan and Wittes (2006).
An object of
class(x); in many cases this is the input value of
x, while in others
x$theta is replaced
and corresponding characteristics computed; see details.
The manual is not linked to this help file, but is available in library/gsdesign/doc/gsDesignManual.pdf in the directory where R is installed.
Keaven Anderson keaven\[email protected]
Jennison C and Turnbull BW (2000), Group Sequential Methods with Applications to Clinical Trials. Boca Raton: Chapman and Hall.
Proschan, MA, Lan, KKG, Wittes, JT (2006), Statistical Monitoring of Clinical Trials. A Unified Approach. New York: Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# symmetric, 2-sided design with O'Brien-Fleming-like boundaries # lower bound is non-binding (ignored in Type I error computation) # sample size is computed based on a fixed design requiring n=100 x <- gsDesign(k=5, test.type=2, n.fix=100) x # the following translate to calls to plot.gsDesign since x was # returned by gsDesign; run these commands one at a time plot(x) plot(x, plottype=2) plot(x, plottype=3) plot(x, plottype=4) plot(x, plottype=5) plot(x, plottype=6) plot(x, plottype=7) # choose different parameter values for power plot # start with design in x from above y <- gsProbability(k=5, theta=seq(0, .5, .025), x$n.I, x$lower$bound, x$upper$bound) # the following translates to a call to plot.gsProbability since # y has that type plot(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.