[Gsdesign-commits] r164 - in pkg/tex: . Sections tmphelp/tex

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 22 23:34:24 CEST 2009


Author: keaven
Date: 2009-05-22 23:34:23 +0200 (Fri, 22 May 2009)
New Revision: 164

Added:
   pkg/tex/Sections/
   pkg/tex/Sections/BoundaryProb.tex
   pkg/tex/Sections/CPAdaptation.tex
   pkg/tex/Sections/ConditionalPower.tex.undo
   pkg/tex/Sections/DefaultDesign.tex
   pkg/tex/Sections/InformationBasedDesign.tex
   pkg/tex/Sections/Multiplicity.tex
   pkg/tex/Sections/Noninferiority.tex
   pkg/tex/Sections/OtherParameters.tex
   pkg/tex/Sections/PredictivePower.tex
   pkg/tex/Sections/StdTxEffect.tex
   pkg/tex/Sections/WangTsiatis.tex
   pkg/tex/Sections/abstract.tex
   pkg/tex/Sections/acknowledgements.tex
   pkg/tex/Sections/alphafamily.tex
   pkg/tex/Sections/basicfeatures.tex
   pkg/tex/Sections/detailedex.tex
   pkg/tex/Sections/examples.tex
   pkg/tex/Sections/gsAnalysis.tex
   pkg/tex/Sections/header.tex
   pkg/tex/Sections/install.tex
   pkg/tex/Sections/motivation.tex
   pkg/tex/Sections/motivationCA.tex
   pkg/tex/Sections/motivationNI.tex
   pkg/tex/Sections/overview.tex
   pkg/tex/Sections/pos.tex
   pkg/tex/Sections/samplesize.tex
   pkg/tex/Sections/sfPoints.tex
   pkg/tex/Sections/spendfn.tex
   pkg/tex/Sections/statmethods.tex
   pkg/tex/Sections/testtype.tex
   pkg/tex/Sections/value.tex
   pkg/tex/tmphelp/tex/gsDesign_package_doc.tex
   pkg/tex/tmphelp/tex/testutils.tex
   pkg/tex/upquote.sty
Log:
v 2 manual completion

Added: pkg/tex/Sections/BoundaryProb.tex
===================================================================
--- pkg/tex/Sections/BoundaryProb.tex	                        (rev 0)
+++ pkg/tex/Sections/BoundaryProb.tex	2009-05-22 21:34:23 UTC (rev 164)
@@ -0,0 +1,245 @@
+\section{Group sequential testing\label{sec:testing}} 
+While the primary purpose of the \texttt{gsDesign} package is to design group sequential trials, computing boundary crossing probabilities is the essential first step. Thus, we begin a summary of theory and computation of boundary crossing probabilities. 
+\subsection{Distributional assumptions\label{sec:assumptions}}
+We illustrate the distribution theory with a sequence of normal random
+variates. Let $X_{1}$, $X_{2}$,... be independent and identically distributed normal random variables with mean $\theta$ and variance 1. For some positive integer $k$, let $n_{1}<n_{2}...<n_{k}$ represent fixed sample sizes where data will be analyzed and inference surrounding $\theta$ will be examined. This is referred to as a group sequential design. The first $k-1$ analyses are referred to as interim analyses, while the $k^{th}$ analysis is referred to as the final analysis.
+For $i=1,$ $2,...k$ consider the test statistic
+\[
+Z_{i}=%
+%TCIMACRO{\tsum \limits_{i=1}^{n_{i}}}%
+%BeginExpansion
+{\textstyle\sum\limits_{j=1}^{n_{i}}}
+%EndExpansion
+X_{j}/\sqrt{n_{i}}.
+\]
+The variance of $\bar{X}_i$ is $1/n_i$ and the corresponding statistical information is its reciprocal: $I_{i}=n_{i}$, $i=1,2,\ldots,k$. The
+test statistics $Z_{1}$, $Z_{2}$,...,$Z_{k}$ follow a multivariate normal
+distribution with, for $1\leq j\leq i\leq k$,
+
+\begin{equation}
+E\{Z_{i}\}=\theta\sqrt{I_{i}}\label{CanonicalMean}
+\end{equation}
+
+\begin{equation}
+Cov(Z_{j},Z_{i})=\sqrt{I_{j}/I_{i}}\label{CanonicalCov}
+\end{equation}
+
+Jennison and Turnbull \cite{JTBook} refer to (\ref{CanonicalMean}) and
+(\ref{CanonicalCov}) as the canonical form and present several types of
+outcomes for which test statistics
+for comparing treatment groups take this form asymptotically. 
+Specific examples in this manual consider 2-arm trials with binary or time-to-event outcomes.
+Note that when $\theta=0$, the mulitivariate normal distribution expressed in (\ref{CanonicalMean}) and (\ref{CanonicalCov}) depends only on $I_i/I_k$, $i=1,2,\ldots,k-1$.
+
+Computational methods for the \texttt{gsDesign} package related to the above multivariate normal distribution are described in Chapter 19 of Jennison and Turnbull \cite{JTBook} and are not provided here. Note that other software programs such as EAST and the University of Wisconsin software use this distributional assumption for group sequential design computations.
+
+\subsection{Hypotheses and testing}
+We assume that the primary
+test the null hypothesis $H_{0}$:~$\theta=0$ against the alternative $H_{1}$:
+$\theta=\delta$ for a fixed $\delta>0$. The value of $\theta$ will be referred to as a treatment effect here since that is what clinical trials are normally set up to examine. We have arbitrarily assume that $\theta>0$ represents a treatment benefit and will refer to this case as a positive treatment effect. 
+We assume further that there is
+interest in stopping early if there is good evidence to reject one hypothesis
+in favor of the other. For $i=1,2,\ldots,k-1$, interim cutoffs $a_{i}<b_{i}$
+are set; final cutoffs $a_{k}\leq b_{k}$ are also set. For $i=1,2,\ldots,k$,
+the trial is stopped at analysis $i$ to reject $H_{0}$ if $a_{j}<Z_{j}<b_{j}$,
+$j=1,2,\dots,i-1$ and $Z_{i}\geq b_{i}$. If the trial continues until stage
+$i$, $H_{0}$ is not rejected at stage $i$, and $Z_{i}\leq a_{i}$ then $H_{1}$
+is rejected in favor of $H_{0}$, $i=1,2,\ldots,k$. Thus, $3k$ parameters
+define a group sequential design: $a_{i}$, $b_{i}$, and $I_{i}$,
+$i=1,2,\ldots,k$. Note that if $a_{k}<b_{k}$ there is the possibility of
+completing the trial without rejecting $H_{0}$ or $H_{1}$. We will generally
+restrict $a_{k}=b_{k}$ so that one hypothesis is rejected.
+
+
+\subsection{Boundary crossing probabilities: \texttt{gsProbability()}\label{sec:gsProbability}}
+\subsubsection{One-sided testing\label{sec:1sidedtest}}
+We begin with a one-sided test. 
+In this case there is no interest in stopping early for a lower bound and thus $a_i= -\infty$, $i=1,2,\ldots,k$.
+The probability of first crossing an upper bound at analysis $i$, $i=1,2,\ldots,k$, is
+
+\begin{equation}
+\alpha_{i}^{+}(\theta)=P_{\theta}\{\{Z_{i}\geq b_{i}\}\cap_{j=1}^{i-1}%
+\{Z_{j}<b_{j}\}\}\label{alphai+(theta)}%
+\end{equation}
+
+The Type I error is the probability of ever crossing the upper bound when $\theta=0$. The value $\alpha^+_{i}(0)$ is commonly referred to as the amount of 
+Type I error spent at analysis $i$, $1\leq i\leq k$. The total upper boundary crossing probability for a trial is denoted in this one-sided scenario by 
+\begin{equation}
+\alpha^+(\theta) \equiv\sum_{i=1}^{k}\alpha^+_{i}(\theta)\label{alpha+(theta)}
+\end{equation}
+and the total Type I error by $\alpha^+(0)$.
+Assuming $\alpha^+(0)=\alpha$ the design will be said to provide a one-sided group sequential test at level $\alpha$.
+
+As an example, assume $k=3$, $n_i=100\times i$, and $b_i=\Phi^{-1}(.975)=1.96$, $i=1,2,3$. Thus, we are testing 3 times at a nominal .025 level at three equally spaced analyses. The function \texttt{gsProbability()} is designed to compute the probability of crossing the upper boundary at each analysis as follows. \texttt{gsProbability()} requires a lower bound; we let $a_i= -20$, $i=1,2,3$ to effectively make the probability of crossing a lower bound 0.
+\bigskip
+\begin{verbatim}
+> x<-gsProbability(k=3, theta=0, n.I=c(100, 200, 300), a=array(-20,3),
++ b=array(qnorm(.975),3))
+> x
+               Lower bounds   Upper bounds
+  Analysis  N  Z   Nominal p  Z   Nominal p
+         1 100 -20         0 1.96     0.025
+         2 200 -20         0 1.96     0.025
+         3 300 -20         0 1.96     0.025
+
+Boundary crossing probabilities and expected sample size assuming any cross
+stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+  Theta     1      2      3  Total  E{N}
+      0 0.025 0.0166 0.0121 0.0536 293.3
+
+Lower boundary (futility or Type II Error)
+          Analysis
+  Theta 1 2 3 Total
+      0 0 0 0     0
+\end{verbatim}
+
+In the table at the top of the output, we see the sample size at each test along with the upper boundary of 1.96 that is used for each test and its associated nominal significance level of .025. The lower part of the output shows the actual probabilities of first crossing the upper boundary at each test. Recall first that since \texttt{theta=0} we would get the same boundary crossing probabilities whether the statistical information \texttt{n.I=c(1,2,3)} or \texttt{n.I=c(100,200,300)}. That is, the boundary crossing probabilities under the null hypothesis depend only on the correlation structure of $Z_i$, $i=1,2,\ldots,k$. When the nominal .025 upper bound was used repeatedly at 3 equally spaced intervals in group sequential testing, the first test had a probability of $\alpha_1^+(0)=.025$ of crossing the upper bound. The probability computed for crossing the upper bound at the second test excludes cases where the boundary was crossed at the first test and is thus $\alpha_2^+(0)=.0166<.025$. The total probability of crossing the upper bound using all 3 tests is $\alpha^+(0)=.053>.025$ which illustrates the multiplicity issue of testing multiple times at the overall significance level normally specified for a test. The expected sample size indicated in the lower part of the output will be discussed in detail in section \ref{sec:ASN} below.
+
+A Bonferroni adjustment maintains a Type I error of $\leq .025$. For $i=1,2,3$ this would use the upper bound $b_i=\Phi^{-1}(1~-~.025/3)$. Substituting \texttt{qnorm(1-.025/3)} for \texttt{qnorm(.975)} in the above call to \texttt{gsProbability()} yields an upper bound of 2.39 and total Type I error of .0192. Thus, the Bonferroni adjustment is overly conservative for this case. We will return to this example later to show how to set equal bounds that yield a total Type I error of .025.
+
+In the above code, the call to \texttt{gsProbability()} returned a value into \texttt{x} which was then printed. The command \texttt{class(x)} following the above code will indicate that \texttt{x} has class \texttt{gsProbability}. The  elements of this class are displayed as follows:
+\bigskip\begin{verbatim}
+> summary(x)
+      Length Class  Mode   
+k     1      -none- numeric
+theta 1      -none- numeric
+n.I   3      -none- numeric
+lower 2      -none- list   
+upper 2      -none- list   
+en    1      -none- numeric
+r     1      -none- numeric
+\end{verbatim}
+Briefly, \texttt{k} is $k$, \texttt{theta} a vector of $\theta$-values, and \code{n.I} is a vector containing $I_i$, $i=1,2,\ldots,K$. The value in $r$ is a positive integer input to \texttt{gsProbability} that is used to define how fine of a grid is used for numerical integration when computing boundary crossing probabilities; this is the same as input and will normally not be changed from the default of 18. 
+The value of \texttt{en} will be discussed below in Section \ref{sec:ASN}.
+This leaves the lists \texttt{lower} and \texttt{upper}, which have identical structure. We examine \texttt{upper} by
+\bigskip\begin{verbatim}
+> x$upper
+$bound
+[1] 1.959964 1.959964 1.959964
+
+$prob
+           [,1]
+[1,] 0.02500000
+[2,] 0.01655891
+[3,] 0.01207016
+\end{verbatim}
+to see that it contains a vector \texttt{bound} which contains the values for $b_i$ and upper boundary crossing probabilities in \texttt{prob[i,j]} for analysis $i$ and the $\theta$-value in \code{theta[j]} for \texttt{i=1,2,...,k} and \texttt{j} from 1 to the length of \texttt{theta}.
+Further documentation is in the online help file displayed using \texttt{help(gsProbability)}.
+
+\subsubsection{Two-sided testing\label{sec:binding}}
+With both lower and upper bounds for testing and any real value $\theta$ representing treatment effect we denote the probability of crossing the upper boundary at analysis $i$ without previously crossing a bound by
+\begin{equation}
+\alpha_{i}(\theta)=P_{\theta}\{\{Z_{i}\geq b_{i}\}\cap_{j=1}^{i-1}%
+\{a_{j}<Z_{j}<b_{j}\}\},\label{alphai(theta)}
+\end{equation}
+$i=1,2,\ldots,k.$
+The total probability of crossing an upper bound prior to crossing a lower bound is denoted by 
+\begin{equation}
+\alpha(\theta)\equiv\sum_{i=1}^{k}\alpha_{i}(\theta)\label{alpha(theta)}.
+\end{equation}
+
+Next, we consider analogous notation for the lower bound. For $i=1,2,\ldots,k$
+denote the probability of crossing a lower bound at analysis $i$ without previously crossing any bound by
+\begin{equation}
+\beta_{i}(\theta)=P_{\theta}\{\{Z_{i}\leq a_{i}\}\cap_{j=1}^{i-1}\{a_{j}%
+<Z_{j}<b_{j}\}\}.\label{beta(theta)}%
+\end{equation}
+For symmetric testing for analysis $i$ we would have $a_i=-b_i$, $\beta_i(0)=\alpha_i(0),$ $i=1,2,\ldots,k$. 
+The total lower boundary crossing probability in this case is written as
+$\beta(\theta)=%
+%TCIMACRO{\tsum \limits_{i=1}^{k}}%
+%BeginExpansion
+{\textstyle\sum\limits_{i=1}^{k}}
+%EndExpansion
+\beta_{i}(\theta).$ 
+The total lower boundary crossing probability for a trial is denoted by 
+\begin{equation}
+\beta(\theta)\equiv\sum_{i=1}^{k}\beta_{i}(\theta).
+\end{equation} 
+
+To extend the one-sided example using repeated testing at a .025 level to two-sided testing at the .05 level, try the commands
+\bigskip
+\begin{verbatim}
+b<-array(qnorm(.975),3)
+x2<-gsProbability(k=3, theta=0, n.I=c(100, 200, 300), a=-b, b=b)
+x2
+\end{verbatim}
+The fact that a lower bound can be crossed before crossing an upper bound means that after the first interim analysis the upper boundary crossing probability here should be less than it was for the one-sided computation performed previously. 
+To examine this further, we print the upper boundary crossing probability at each analysis for the above one-sided and two-sided examples, respectively, to see that there is a small difference:
+\bigskip\begin{verbatim}
+> x$upper$prob
+           [,1]
+[1,] 0.02500000
+[2,] 0.01655891
+[3,] 0.01207016
+> x2$upper$prob
+           [,1]
+[1,] 0.02500000
+[2,] 0.01655890
+[3,] 0.01206929
+\end{verbatim} 
+
+Group sequential designs most often employ more stringent bounds at early interim analyses than later. We modify the above example to demonstrate this.
+\bigskip\begin{verbatim}
+> b<-qnorm(.975)/sqrt(c(1,2,3)/3)
+> b
+[1] 3.394757 2.400456 1.959964
+> x2b<-gsProbability(k=3, theta=0, n.I=c(100, 200, 300), a=-b,b=b)
+> x2b
+               Lower bounds   Upper bounds
+  Analysis  N    Z   Nominal p  Z   Nominal p
+         1 100 -3.39    0.0003 3.39    0.0003
+         2 200 -2.40    0.0082 2.40    0.0082
+         3 300 -1.96    0.0250 1.96    0.0250
+
+Boundary crossing probabilities and expected sample size assuming any cross 
+stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+  Theta     1     2      3  Total  E{N}
+      0 3e-04 0.008 0.0195 0.0279 298.3
+
+Lower boundary (futility or Type II Error)
+          Analysis
+  Theta     1     2      3  Total
+      0 3e-04 0.008 0.0195 0.0279
+\end{verbatim}
+
+By setting the interim boundaries to be substantially higher than $\Phi^{-1}(.975)=1.96$ we have drastically reduced the excess Type I error caused by multiple testing while still testing at the nominal .05 (2-sided) level at the final analysis. Thus, minimal adjustment to the final boundary should be required when employing such a strategy.
+Precise control of Type I error when using either equal bounds or adjusting relative sizes of bounds using the square root of sample size is discussed further in section \ref{sec:boundfam}. 
+
+\subsection{Expected sample size\label{sec:ASN}}
+We denote the sample size at analysis $i$ by $n_i$, $i=1,2,\ldots,k$ and the sample size at the time a boundary is crossed by $N$. 
+The average sample number (ASN) or expected sample size is defined by
+\begin{equation}
+\hbox{ASN}(\theta)=E_\theta \{N\}=\sum_{i=1}^k n_i\times(\alpha_i(\theta)+\beta_i(\theta)).\label{eqn:ASN}
+\end{equation}
+Values of ASN$(\theta)$ corresponding to $\theta$-values input to \texttt{gsProbability} in \texttt{theta} are output in the vector \texttt{en} returned by that function. In the one- and two-sided examples above we only had a single element 0 in \texttt{theta} and the expected sample sizes rounded to 293 and 286, respectively; these were labeled \texttt{E\{N\}} in the printed output. Since the probability of crossing a boundary at an interim analysis was small, the trial usually proceeds to the final analysis with 300 observations. We consider an additional $\theta$-value to demonstrate that the average sample number can be substantially smaller than the maximum sample size:
+\begin{verbatim}
+> x2c<-gsProbability(k=3, theta=c(0,.3), n.I=c(100, 200, 300), a=-b, b=b)
+> x2c
+               Lower bounds   Upper bounds
+  Analysis  N    Z   Nominal p  Z   Nominal p
+         1 100 -3.39    0.0003 3.39    0.0003
+         2 200 -2.40    0.0082 2.40    0.0082
+         3 300 -1.96    0.0250 1.96    0.0250
+
+Boundary crossing probabilities and expected sample size assuming any cross stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+  Theta      1      2      3  Total  E{N}
+    0.0 0.0003 0.0080 0.0195 0.0279 298.3
+    0.3 0.3465 0.6209 0.0320 0.9994 168.6
+
+Lower boundary (futility or Type II Error)
+          Analysis
+  Theta     1     2      3  Total
+    0.0 3e-04 0.008 0.0195 0.0279
+    0.3 0e+00 0.000 0.0000 0.0000
+\end{verbatim}
+Thus, assuming a positive treatment effect, the average sample number was approximately 169 compared to almost 300 when there was no treatment difference.

Added: pkg/tex/Sections/CPAdaptation.tex
===================================================================
--- pkg/tex/Sections/CPAdaptation.tex	                        (rev 0)
+++ pkg/tex/Sections/CPAdaptation.tex	2009-05-22 21:34:23 UTC (rev 164)
@@ -0,0 +1 @@
+\subsection{Sample size adaptation using conditional power}

Added: pkg/tex/Sections/ConditionalPower.tex.undo
===================================================================
(Binary files differ)


Property changes on: pkg/tex/Sections/ConditionalPower.tex.undo
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pkg/tex/Sections/DefaultDesign.tex
===================================================================
--- pkg/tex/Sections/DefaultDesign.tex	                        (rev 0)
+++ pkg/tex/Sections/DefaultDesign.tex	2009-05-22 21:34:23 UTC (rev 164)
@@ -0,0 +1,300 @@
+\section{Applying the default group sequential design\label{sec:default}}
+\subsection{Default parameters}
+We are now prepared to demonstrate derivation of group sequential designs using default parameters with the \code{gsDesign()} function.
+Along with this, we discuss the \texttt{gsDesign} class returned by \texttt{gsDesign()} and its associated standard print and plot functions. 
+We then apply this default group sequential design to each of our motivational examples. 
+The main parameters in \code{gsDesign()} will be explained in more detail in sections \ref{sec:gsDesign} through \ref{sec:spendfn}.
+
+The main parameter defaults that you need to know about are as follows:
+
+\begin{enumerate}
+\item Overall Type I error $\alpha = 0.025$ (one-sided)
+
+\item Overall Type II error $\beta = 0.1$ (Power = $90\%$)
+
+\item Two interim analyses equally spaced at 1/3 and 2/3 of the way through the trial plus the final analysis (\texttt{k=3})
+
+\item Asymmetric boundaries, which means we may stop the trial for futility or
+superiority at an interim analysis.
+
+\item $\beta$-spending is used to set the lower stopping
+boundary. This means that the spending function controls the incremental
+amount of Type II error at each analysis, $\beta_i(\delta)$, $i=1,2,\ldots,K$.
+
+\item Non-binding lower bound. Lower bounds are sometimes considered as
+guidelines, which may be ignored during the course of the trial. 
+Since Type I error is inflated if this is the case, regulators often demand that the lower bounds be ignored when computing Type I error.
+That is, Type I error is computed using $\alpha^+(\theta)$ from (\ref{alphai+(theta)}) and (\ref{alpha+(theta)}) rather than $\alpha(\theta)$ from (\ref{alphai(theta)}) and (\ref{alpha(theta)}). 
+
+\item A Hwang-Shih-DeCani spending functions with $\gamma = -4$ for the upper
+bound and $\gamma = -2$ for the lower bound. This provides a conservative,
+O'Brien-Fleming-like superiority bound and a less conservative lower bound.
+Spending functions will be discussed in detail in \ref{sec:spendfn}.
+\end{enumerate}
+
+\subsection{Sample size ratio for a group sequential design compared to a fixed
+design.\label{sec:ssratio}}
+
+In section \ref{sec:testing} and its subsections we gave distributional assumptions, defined testing procedures and denoted probabilities for boundary crossing.
+Consider a trial with a fixed design (no interim analyses) with power 100(1--$\beta$) and level $\alpha$ (1-sided). Denote the sample size as $N_{fix}$ and statistical information for this design as $I_{fix}$. 
+For a group sequential design as noted above, we denote the information ratio (inflation factor) comparing the information planned for the final analysis of a group sequential design compared to a fixed design as
+\begin{equation}
+r=I_{k}/I_{fix}=n_{k}/N_{fix}.\label{ssratio}%
+\end{equation}
+This ratio is independent of the $\theta$-value $\delta$ for which the trial
+is powered as long as the information (sample size) available at each analysis
+increases proportionately with $I_{fix}$ and the boundaries for the group
+sequential design remain unchanged; see, for example, Jennison and Turnbull \cite{JTBook}. 
+Because of this, the default for \texttt{gsDesign()} is to print the sample size ratios $r_i=I_i/I_k$, $i=1,2,\ldots,k$ rather than an actual sample size at each interim analysis. 
+This is implemented through by the default value of 1 for the input parameter \texttt{n.fix}. 
+We demonstrate in the following subsections how to set \texttt{n.fix} to apply to our motivating examples.
+
+\subsection{The default call to \texttt{gsDesign()}}
+We begin with the call 
+\verb!x <- gsDesign()!
+to generate a design using all default arguments. The next line
+prints a summary of \texttt{x}; this produces the same effect as
+\texttt{print(x)} or \texttt{print.gsDesign(x)}. Note that while the total
+Type I error is $0.025$, this assumes the lower bound is ignored if it is
+crossed; looking lower in the output we see the total probability of crossing
+the upper boundary at any analysis when the lower bound stops the trial is
+$0.0233$. Had the option 
+\verb!x <- gsDesign(test.type=3)!
+been run, both of these numbers would assume the trial
+stops if the lower bound stopped and thus would both be $0.025$. 
+
+\bigskip
+
+\begin{verbatim}
+> x <- gsDesign()
+> x
+Asymmetric two-sided group sequential design with 90 % power and 2.5
+Type I Error.
+Upper bound spending computations assume trial continues if lower bound is
+crossed.
+
+           Sample
+            Size    ----Lower bounds----  ----Upper bounds-----
+  Analysis Ratio*   Z   Nominal p Spend+  Z   Nominal p Spend++
+         1  0.357 -0.24    0.4057 0.0148 3.01    0.0013  0.0013
+         2  0.713  0.94    0.8267 0.0289 2.55    0.0054  0.0049
+         3  1.070  2.00    0.9772 0.0563 2.00    0.0228  0.0188
+     Total                        0.1000                 0.0250 
++ lower bound beta spending (under H1): Hwang-Shih-DeCani spending function 
+  with gamma = -2
+++ alpha spending: Hwang-Shih-DeCani spending function with gamma = -4
+* Sample size ratio compared to fixed non-group sequential design
+
+Boundary crossing probabilities and expected sample size assuming any cross
+stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+   Theta      1      2      3  Total   E{N}
+  0.0000 0.0013 0.0049 0.0171 0.0233 0.6249
+  3.2415 0.1412 0.4403 0.3185 0.9000 0.7913
+
+Lower boundary (futility or Type II Error)
+          Analysis
+   Theta      1      2      3  Total
+  0.0000 0.4057 0.4290 0.1420 0.9767
+  3.2415 0.0148 0.0289 0.0563 0.1000
+
+> plot(x)
+\end{verbatim}
+\begin{figure}
+\begin{center}
+\includegraphics[width=.6\textwidth]{figs/boundplot.pdf}
+\end{center}
+\caption{Default plot for gsDesign object}
+\end{figure}%
+
+\bigskip
+
+Above we have seen standard output for \texttt{gsDesign()}. 
+To access individual items of information about what is returned from the above, use \texttt{summary(x)} to list the elements of \texttt{x}.
+Type \texttt{help(gsDesign)} to get full documentation of the class \texttt{gsDesign} returned by the \texttt{gsDesign()} function. 
+To view an individual element of \texttt{x} type, for example, \texttt{x\$delta}. 
+Other elements of \texttt{x} can be accessed in the same way, and we will use these to display aspects of designs in further examples. 
+Of particular interest are the elements \texttt{upper} and \texttt{lower}. 
+These are both objects containing multiple variables concerning the upper and lower boundaries and boundary crossing probabilities.
+Type \texttt{summary(x\$upper)} to show what these variables are. 
+The upper boundary can be shown with the command \texttt{x\$upper\$bound}.
+For additional plots, enter \texttt{plot(x, plottype=2))} for a power plot.
+The argument \texttt{plottype} can run from 1 (the default) to 7.
+The options not already noted plot effect sizes at boundaries (\texttt{plottype=3}), conditional power at boundaries (\texttt{plottype=4})), 
+$\alpha$- and $\beta$-spending functions (\texttt{plottype=5})), expected sample size by underlying treatment difference (\texttt{plottype=6}), and B-values at boundaries (\texttt{plottype=7}).
+
+\subsection{Applying the default design to the CAPTURE example}
+The sample size ratios from (\ref{ssratio}) can be obtained as follows:
+\begin{verbatim}
+> x <- gsDesign()
+> x$n.I
+[1] 0.3566277 0.7132554 1.0698832
+\end{verbatim}
+These will be applied to each of our examples.
+Recall from the CAPTURE trial that we had a binomial outcome and wished to detect a reduction in the primary endpoint from a 15\% event rate in the control group to a 10\% rate in the experimental group.
+While we consider 80\% power elsewhere, we stick with the default of 90\% here.
+A group sequential design with 90\% power and 2.5\% Type I error has the same bounds as shown previously. The sample size at each analysis is obtained as follows (continuing the code just above):
+\begin{verbatim}
+> n.I <- nBinomial(p1 = .15, p2 = .1)
+> n.I
+1834.641
+> n.I * x$n.I
+[1]  654.2839 1308.5679 1962.8518
+\end{verbatim}
+Rounding up to an even number in each case, we see from the above that a while a fixed design requires 1836 patients, employing the default group sequential design inflates the sample size requirement to 1964. 
+Interim analyses would be peformed after approximately 654 and 1308 patients.
+
+The group sequential design can be derived directly by replacing the input parameter \texttt{n.fix} with the sample size from a fixed design trial as follows:
+
+\begin{verbatim}
+> n.I <- nBinomial(p1 = .15, p2 = .1)
+> x <- gsDesign(n.fix = n.I)
+> x$n.I
+[1]  654.2839 1308.5678 1962.8518
+\end{verbatim}
+
+Printing this design now replaces the sample size ratio with the actual sample sizes at each analysis. The only other difference from the design above in Section \ref{sec:default} is the second value of \texttt{theta} below.
+
+\begin{verbatim}
+> x
+Asymmetric two-sided group sequential design with 90 % power and 
+2.5 % Type I Error.
+Upper bound spending computations assume trial continues if lower 
+bound is crossed.
+
+                  ----Lower bounds----  ----Upper bounds-----
+  Analysis   N    Z   Nominal p Spend+  Z   Nominal p Spend++
+         1  655 -0.24    0.4057 0.0148 3.01    0.0013  0.0013
+         2 1309  0.94    0.8267 0.0289 2.55    0.0054  0.0049
+         3 1963  2.00    0.9772 0.0563 2.00    0.0228  0.0188
+     Total                      0.1000                 0.0250 
++ lower bound beta spending (under H1): Hwang-Shih-DeCani spending 
+function with gamma = -2
+++ alpha spending: Hwang-Shih-DeCani spending function with gamma = -4
+
+Boundary crossing probabilities and expected sample size assuming 
+any cross stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+   Theta      1      2      3  Total   E{N}
+  0.0000 0.0013 0.0049 0.0171 0.0233 1146.4
+  0.0757 0.1412 0.4403 0.3185 0.9000 1451.7
+
+Lower boundary (futility or Type II Error)
+          Analysis
+   Theta      1      2      3  Total
+  0.0000 0.4057 0.4290 0.1420 0.9767
+  0.0757 0.0148 0.0289 0.0563 0.1000
+\end{verbatim}
+
+\bigskip
+
+\subsection{Applying the default design to the noninferiority example}
+The fixed noninferiority design for a binomial comparison is the same as above, only changing the \texttt{nBinomial()} call to 
+\bigskip
+\begin{verbatim}
+> n.fix <- nBinomial(p1=.677, p2=.677, delta0=.07)
+> ceiling(gsDesign(n.fix = n.fix)$n.I)
+[1]  668 1336 2004
+>\end{verbatim}
+\bigskip
+Testing at each analysis can be peformed using the Miettinen and Nurminen \cite{MandN} method.
+Simulation to verify the normal approximation is adequate for comparing binomial event rates can be performed using the functions \code{simBinomial} and \code{testBinomial}.
+
+\subsection{Applying the default design to the cancer trial example}
+For trials with time-to-event outcomes, the variable \texttt{n.fix} in \texttt{gsDesign()} needed is the number of events from a fixed design trial. 
+The reader may wish to refer to Jennison and Turnbull \cite{JTBook} for further background; we also discuss distributional assumptions further in Section \ref{sec:TTE}.
+We begin with the code from the fixed design trial for the cancer trial example from \ref{sec:CAex}.
+Next, we call to \code{gsDesign()} with \texttt{n.fix} equal to the number of events for a fixed trial design. 
+The value \code{ssratio}, the sample size ratio at each analysis compared to the fixed design sample size is then shown. Note that the values are the same as shown in the first output of this example above.
+The inflation in the total sample size is the same as for the number of events required; that is, the sample size required for a group sequential design with the default interim analysis plan is inflated to 595 (or 596 for an even number) from 557 (or 558) from that of a fixed design by multiplying by 1.07. 
+
+\begin{verbatim}
+> x <- nSurvival(lambda.0=log(2)/6,lambda.1=log(2)/6*.7,eta=-log(.95),
++         Tr=30,Ts=36,type="rr",entry="unif")
+> ceiling(x$Sample.size)
+[1] 557
+> ceiling(x$Num.events)
+[1] 330
+> y <- gsDesign(n.fix=x$Num.events)
+> ceiling(y$n.I)
+[1] 118 236 353
+> ssratio <- (y$n.I / x$Num.events)
+> ssratio
+[1] 0.3566277 0.7132554 1.0698831
+> ceiling(ssratio[3] * x$Sample.size)
+[1] 595
+\end{verbatim}
+
+\subsection{Using \texttt{gsProbability()} following \texttt{gsDesign()}}
+
+We reconsider the default design and obtain the properties for a larger
+set of $\theta$ values than in the standard printout for \texttt{gsDesign()} shown previously.
+The first two lines of code below demonstrates a group sequential design generated by \texttt{gsDesign()} can be input to \texttt{gsProbability()} to obtain boundary crossing probabilities for an extended set of parameter values.
+The \texttt{theta} values in the output make more sense in this case when they are computed relative to the effect size \texttt{x\$delta} for which the trial is powered; this is more easily seen in the plot of expected sample size shown here since the $x$-axis uses this scale. 
+Note that the $y$-axis shows the expected sample size relative to a fixed design trial when the sample size ratio is computed; if we had input a fixed design sample size, the $y$-axis would show the actual expected sample size.
+Note further that the \texttt{plot()} function for the \texttt{gsDesign} class (used here) is an extension of the standard \texttt{plot()} function, and thus allows use of many of its parameters, such as line width (\texttt{lwd}), line type (\texttt{lty}), plot titles and axis labels.
+This plot demonstrates the ability of a group sequential design to appropriate adapt sample size to come to an appropriate conclusion depending on the true treatment effect. If the effect size is twice that for which the trial is powered, the expected sample size is about 40\% of that for a fixed design, compared to over 80\% in some cases when the true treatment effect is between the hypothesized values for the efficacy parameter $\theta$. 
+
+\bigskip
+
+\begin{verbatim}
+> x <- gsDesign()
+> y <- gsProbability(theta=x$delta*seq(0, 2, .25), d=x)
+> y 
+Asymmetric two-sided group sequential design with 90 % power and 
+2.5\% Type I Error.
+Upper bound spending computations assume trial continues if lower bound is 
+crossed.
+
+           Sample
+            Size    ----Lower bounds----  ----Upper bounds-----
+  Analysis Ratio*   Z   Nominal p Spend+  Z   Nominal p Spend++
+         1  0.357 -0.24    0.4057 0.0148 3.01    0.0013  0.0013
+         2  0.713  0.94    0.8267 0.0289 2.55    0.0054  0.0049
+         3  1.070  2.00    0.9772 0.0563 2.00    0.0228  0.0188
+     Total                        0.1000                 0.0250 
++ lower bound beta spending (under H1): Hwang-Shih-DeCani spending function
+with gamma = -2
+++ alpha spending: Hwang-Shih-DeCani spending function with gamma = -4
+* Sample size ratio compared to fixed non-group sequential design
+
+Boundary crossing probabilities and expected sample size assuming any cross 
+stops the trial
+
+Upper boundary (power or Type I Error)
+          Analysis
+   Theta      1      2      3  Total   E{N}
+  0.0000 0.0013 0.0049 0.0171 0.0233 0.6249
+  0.8104 0.0058 0.0279 0.0872 0.1209 0.7523
+  1.6208 0.0205 0.1038 0.2393 0.3636 0.8520
+  2.4311 0.0595 0.2579 0.3636 0.6810 0.8668
+  3.2415 0.1412 0.4403 0.3185 0.9000 0.7913
+  4.0519 0.2773 0.5353 0.1684 0.9810 0.6765
+  4.8623 0.4574 0.4844 0.0559 0.9976 0.5701
+  5.6727 0.6469 0.3410 0.0119 0.9998 0.4868
+  6.4830 0.8053 0.1930 0.0016 1.0000 0.4266
+
+Lower boundary (futility or Type II Error)
+          Analysis
+   Theta      1      2      3  Total
+  0.0000 0.4057 0.4290 0.1420 0.9767
+  0.8104 0.2349 0.3812 0.2630 0.8791
+  1.6208 0.1138 0.2385 0.2841 0.6364
+  2.4311 0.0455 0.1017 0.1718 0.3190
+  3.2415 0.0148 0.0289 0.0563 0.1000
+  4.0519 0.0039 0.0054 0.0097 0.0190
+  4.8623 0.0008 0.0006 0.0009 0.0024
+  5.6727 0.0001 0.0001 0.0000 0.0002
+  6.4830 0.0000 0.0000 0.0000 0.0000
+> plot(y, plottype=6, lty=2, lwd=3)
+\end{verbatim}
+\begin{figure}
+\begin{center}
+\includegraphics[width=.6\textwidth]{figs/ASN.pdf}
+\end{center}
+\caption{Average sample size plot}
+\end{figure}

Added: pkg/tex/Sections/InformationBasedDesign.tex
===================================================================
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/gsdesign -r 164


More information about the Gsdesign-commits mailing list