<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>RPACT Vignettes</title>
<link>https://www.rpact.org/vignettes/</link>
<atom:link href="https://www.rpact.org/vignettes/index.xml" rel="self" type="application/rss+xml"/>
<description>The rpact R package - Installation guidance, reference documentation, and practical vignettes for planning, simulating, and analyzing clinical trials.</description>
<language>en</language>
<image>
<url>https://www.rpact.org/figures/rpact_logo.png</url>
<title>RPACT Vignettes</title>
<link>https://www.rpact.org/vignettes/</link>
<height>144</height>
<width>144</width>
</image>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Mon, 24 Aug 2026 06:43:46 GMT</lastBuildDate>
<item>
  <title>Two-arm Analysis for Continuous Data with Covariates from Raw Data using rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/analysis/rpact_analysis_two_arm_adjusted_means_example/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6596 $
Last changed: $Date: 2022-09-30 11:59:22 +0200 (Fr, 30 Sep 2022) $
Last changed by: $Author: pahlke $
Copyright (c) 2022 by Friedrich Pahlke and Gernot Wassmer. All rights reserved.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>This vignette shows how to use the function <code>getDataset()</code> as an utility function to process adjusted means and estimated standard deviations from raw data, how to convert the raw data into an <a href="https://cran.r-project.org/package=rpact">rpact</a> dataset, and finally how to use this information for the analysis at interim and the final stage. Essentially, this is through the use of the CRAN package <a href="https://cran.r-project.org/package=emmeans">emmeans</a> that allows the extraction of least squares means from a specified model which is an ANCOVA model in this vignette.</p>
</section>
<section id="contents" class="level1">
<h1>Contents</h1>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p><em>This is an exclusive vignette for <a href="https://www.rpact.com/services/sla">RPACT SLA customers</a></em>. To read the whole vignette please login to <a href="https://www.rpact.com/user">My Account</a> at <a href="https://www.rpact.com/user">rpact.com</a>.</p>
<ul>
<li>Setup and raw data import
<ul>
<li>Load required  packages</li>
<li>Read raw data from local csv file</li>
<li>Check data</li>
</ul></li>
<li>Interim analyses
<ul>
<li>First look: analysis at stage 1
<ul>
<li>Check the getDataset result</li>
<li>Create and display the analysis results:</li>
</ul></li>
<li>Second look: analysis at stage 2</li>
<li>Last look: analysis at stage 3</li>
</ul></li>
<li>Multi-stage raw data import</li>
<li>Conclusions</li>
</ul>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Analysis</category>
  <category>Means</category>
  <guid>https://www.rpact.org/vignettes/analysis/rpact_analysis_two_arm_adjusted_means_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_03.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Using the Inverse Normal Combination Test for Analyzing a Trial with Continuous Endpoint and Potential Sample Size Re-Assessment with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="define-the-type-of-design-to-be-used-for-the-analysis" class="level1">
<h1>Define the type of design to be used for the analysis</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>In this vignette, we want to illustrate a design where at interim stages we are able to perform data-driven sample size adaptations. For this purpose, we use the <em>inverse normal combination test</em> for combining the <img src="https://latex.codecogs.com/png.latex?p">-values from the stages of the trial. This type of design ensures that the Type I error rate is controlled.</p>
<p>We want to use a three stage design with O`Brien and Fleming boundaries and additionally want to consider futility bounds -0.5 and 0.5 for the test statistics at the first and the second stage, respectively. Accordingly,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example of an inverse normal combination test:</span></span>
<span id="cb3-2">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb3-4">)</span></code></pre></div></div>
</div>
<p>defines the design to be used for this purpose. By default, this is a design with three stages, equally spaced information rates and one-sided <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">. The critical values can be displayed on the <img src="https://latex.codecogs.com/png.latex?z">-value or the <img src="https://latex.codecogs.com/png.latex?p">-value scale:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/index_files/figure-html/unnamed-chunk-5-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Note that we are using <em>non-binding</em> futility bounds that do not affect the boundaries for the rejection of the null hypothesis. They do however have an effect on the calculation of the conditional power at interim stages.</p>
<p>Creating the design with the function <code>getDesignInverseNormal()</code> fixes how the data are analysed. By default, the <em>unweighted inverse normal combination test</em> is used, i.e., the stage results are combined through the use on the inverse normal combination test statistics</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5CPhi%5E%7B-1%7D(1%20-%20p_1)%20+%20%5CPhi%5E%7B-1%7D(1%20-%20p_2)%7D%7B%5Csqrt%7B2%7D%7D%20%5Ctext%7B%20and%20%7D%5Cfrac%7B%5CPhi%5E%7B-1%7D(1%20-%20p_1)%20+%20%5CPhi%5E%7B-1%7D(1%20-%20p_2)+%20%5CPhi%5E%7B-1%7D(1%20-%20p_3)%7D%7B%5Csqrt%7B3%7D%7D"></p>
<p>for the second and the third (final) stage of the trial, respectively.</p>
</section>
<section id="entering-the-data" class="level1">
<h1>Entering the data</h1>
<p>In <a href="https://cran.r-project.org/package=rpact">rpact</a>, the way of using data for adaptive analysis is through summary statistics that summarize the data from the separate stages. Generally, the function <code>getDataset()</code> is used and depending on which summary statistics are entered, <a href="https://cran.r-project.org/package=rpact">rpact</a> knows the type of endpoint and the number of treatment groups. For testing means in a two-treatment parallel group design, <code>means1</code>, <code>means2</code>, <code>stDevs1</code>, <code>stDevs2</code>, <code>n1</code>, and <code>n2</code> must be defined as vectors with length number of the observed interim stages.</p>
<p>As an example, assume that the following results in the control and the experimental treatment arm were obtained for the first and the second stage of the trial.</p>
<p>First stage:</p>
<div class="cell">
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">arm</th>
<th style="text-align: right;">n</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">std</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">experimental</td>
<td style="text-align: right;">34</td>
<td style="text-align: right;">112.3</td>
<td style="text-align: right;">44.4</td>
</tr>
<tr class="even">
<td style="text-align: left;">control</td>
<td style="text-align: right;">37</td>
<td style="text-align: right;">98.1</td>
<td style="text-align: right;">46.7</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Second stage:</p>
<div class="cell">
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">arm</th>
<th style="text-align: right;">n</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">std</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">experimental</td>
<td style="text-align: right;">31</td>
<td style="text-align: right;">113.1</td>
<td style="text-align: right;">42.9</td>
</tr>
<tr class="even">
<td style="text-align: left;">control</td>
<td style="text-align: right;">33</td>
<td style="text-align: right;">99.3</td>
<td style="text-align: right;">41.1</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Here, sample size, mean and standard deviation were obtained <em>separately</em> from the stages. Enter these results as follows to obtain a dataset object in <a href="https://cran.r-project.org/package=rpact">rpact</a>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">datasetExample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">112.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">113.1</span>),</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">98.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">99.3</span>),</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">42.9</span>),</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">41.1</span>),</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>),</span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>)</span>
<span id="cb6-8">)</span></code></pre></div></div>
</div>
<p>The object <code>datasetExample</code> also contains the cumulative results which were calculated from the separate stage results:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Dataset of means</strong></p>
<ul>
<li><em>Stages</em>: 1, 1, 2, 2</li>
<li><em>Treatment groups</em>: 1, 2, 1, 2</li>
<li><em>Sample sizes</em>: 34, 37, 31, 33</li>
<li><em>Means</em>: 112.3, 98.1, 113.1, 99.3</li>
<li><em>Standard deviations</em>: 44.4, 46.7, 42.9, 41.1</li>
</ul>
<p><strong>Calculated data</strong></p>
<ul>
<li><em>Cumulative sample sizes</em>: 34, 37, 65, 70</li>
<li><em>Cumulative means</em>: 112.30, 98.10, 112.68, 98.67</li>
<li><em>Cumulative standard deviations</em>: 44.40, 46.70, 43.35, 43.84</li>
</ul>
</div>
</div>
<p>You might alternatively enter the cumulative results by specifying<br>
<code>cumulativeMeans1</code>, <code>cumulativeMeans2</code>, <code>cumulativeStDevs1</code>, <code>cumulativeStDevs2</code>, <code>cumulativeN1</code>, and <code>cumulativeN2</code> (note that you can also use the prefix <code>cum</code> instead of <code>cumulative</code> for this):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeMeans1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">112.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">112.68</span>),</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeMeans2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">98.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">98.67</span>),</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeStDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">43.35</span>),</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeStDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">43.84</span>),</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeN1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>),</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeN2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>)</span>
<span id="cb7-8">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of means</strong></p>
<ul>
<li><em>Stages</em>: 1, 1, 2, 2</li>
<li><em>Treatment groups</em>: 1, 2, 1, 2</li>
<li><em>Cumulative sample sizes</em>: 34, 37, 65, 70</li>
<li><em>Cumulative means</em>: 112.30, 98.10, 112.68, 98.67</li>
<li><em>Cumulative standard deviations</em>: 44.40, 46.70, 43.35, 43.84</li>
</ul>
<p><strong>Calculated data</strong></p>
<ul>
<li><em>Sample sizes</em>: 34, 37, 31, 33</li>
<li><em>Means</em>: 112.30, 98.10, 113.10, 99.31</li>
<li><em>Standard deviations</em>: 44.40, 46.70, 42.90, 41.11</li>
</ul>
</div>
</div>
</section>
<section id="analysis-results" class="level1">
<h1>Analysis results</h1>
<p>To apply the specified design to the provided data set, we can use the function <code>getAnalysisResults()</code>. Accordingly, this function requires the arguments <code>design</code> and <code>dataInput</code>. In our case,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> datasetExample,</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-5">)</span></code></pre></div></div>
</div>
<p>does the job, and the output is</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Analysis results (means of 2 groups, inverse normal combination test design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Fixed weights</em>: 0.577, 0.577, 0.577</li>
<li><em>Critical values</em>: 3.471, 2.454, 2.004</li>
<li><em>Futility bounds (non-binding)</em>: -0.500, 0.500</li>
<li><em>Cumulative alpha spending</em>: 0.0002592, 0.0071601, 0.0250000</li>
<li><em>Local one-sided significance levels</em>: 0.0002592, 0.0070554, 0.0225331</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Direction upper</em>: TRUE</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Equal variances</em>: TRUE</li>
</ul>
<p><strong>Stage results</strong></p>
<ul>
<li><em>Cumulative effect sizes</em>: 14.20, 14.02, NA</li>
<li><em>Cumulative (pooled) standard deviations</em>: 45.61, 43.60, NA</li>
<li><em>Stage-wise test statistics</em>: 1.310, 1.314, NA</li>
<li><em>Stage-wise p-values</em>: 0.09721, 0.09680, NA</li>
<li><em>Combination test statistics</em>: 1.298, 1.837, NA</li>
</ul>
<p><strong>Analysis results</strong></p>
<ul>
<li><em>Assumed standard deviation</em>: 43.6</li>
<li><em>Actions</em>: continue, continue, NA</li>
<li><em>Conditional rejection probability</em>: 0.06767, 0.19121, NA</li>
<li><em>Conditional power</em>: NA, NA, NA</li>
<li><em>Repeated confidence intervals (lower)</em>: -25.271, -4.803, NA</li>
<li><em>Repeated confidence intervals (upper)</em>: 53.67, 32.80, NA</li>
<li><em>Repeated p-values</em>: 0.29776, 0.07854, NA</li>
<li><em>Final stage</em>: NA</li>
<li><em>Final p-value</em>: NA, NA, NA</li>
<li><em>Final CIs (lower)</em>: NA, NA, NA</li>
<li><em>Final CIs (upper)</em>: NA, NA, NA</li>
<li><em>Median unbiased estimate</em>: NA, NA, NA</li>
</ul>
</div>
</div>
<p>Displayed as summary:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a two-sample t-test, equal variances option. H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>14.200</td>
<td>14.016</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative (pooled) standard deviation</td>
<td>45.614</td>
<td>43.604</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic</td>
<td>1.310</td>
<td>1.314</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value</td>
<td>0.0972</td>
<td>0.0968</td>
<td></td>
</tr>
<tr class="even">
<td>Inverse normal combination</td>
<td>1.298</td>
<td>1.837</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.0677</td>
<td>0.1912</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval</td>
<td>[-25.271; 53.671]</td>
<td>[-4.803; 32.798]</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.2978</td>
<td>0.0785</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Note that explicitly specifying the argument <code>stage = 2</code> is not necessary in this case as it would also be automatically obtained from the data set. However, one may wish to specify <code>stage = 1</code> in order to obtain the first-stage results only.</p>
<p>The inverse normal combination test statistic at the second stage is calculated to be 1.837, which is smaller than 2.454. Hence, the null hypothesis cannot be rejected, which is also reflected in the repeated <img src="https://latex.codecogs.com/png.latex?p">-value = 0.0785 larger than <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> and the lower bound of the repeated confidence interval (= -4.803) being smaller than 0 (i.e., the RCI contains the null hypothesis value).</p>
</section>
<section id="reassessing-the-sample-size-for-the-last-stage" class="level1">
<h1>Reassessing the sample size for the last stage</h1>
<p>A calculation of the <em>conditional power</em> is performed if the argument <code>nPlanned</code> is specified to <code>getAnalysisResults()</code>. <code>nPlanned</code> contains the (stage-wise) sample sizes <em>of the remaining stages</em> for both treatment groups and is a vector with one observation per remaining stage. For example, if we specify <code>nPlanned = 60</code>, the conditional power is calculated for a total of 60 patients in the 2 treatment groups <em>for the final stage</em> with equal allocation between the treatment groups (the latter can be changed with <code>allocationRatioPlanned</code> which is 1 by default).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb10-3">    datasetExample,</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span></span>
<span id="cb10-6">)</span></code></pre></div></div>
</div>
<p>yields the following output:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Analysis results (means of 2 groups, inverse normal combination test design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Fixed weights</em>: 0.577, 0.577, 0.577</li>
<li><em>Critical values</em>: 3.471, 2.454, 2.004</li>
<li><em>Futility bounds (non-binding)</em>: -0.500, 0.500</li>
<li><em>Cumulative alpha spending</em>: 0.0002592, 0.0071601, 0.0250000</li>
<li><em>Local one-sided significance levels</em>: 0.0002592, 0.0070554, 0.0225331</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned sample size</em>: NA, NA, 60</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Direction upper</em>: TRUE</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Equal variances</em>: TRUE</li>
</ul>
<p><strong>Stage results</strong></p>
<ul>
<li><em>Cumulative effect sizes</em>: 14.20, 14.02, NA</li>
<li><em>Cumulative (pooled) standard deviations</em>: 45.61, 43.60, NA</li>
<li><em>Stage-wise test statistics</em>: 1.310, 1.314, NA</li>
<li><em>Stage-wise p-values</em>: 0.09721, 0.09680, NA</li>
<li><em>Combination test statistics</em>: 1.298, 1.837, NA</li>
</ul>
<p><strong>Analysis results</strong></p>
<ul>
<li><em>Assumed standard deviation</em>: 43.6</li>
<li><em>Actions</em>: continue, continue, NA</li>
<li><em>Conditional rejection probability</em>: 0.06767, 0.19121, NA</li>
<li><em>Conditional power</em>: NA, NA, 0.6449</li>
<li><em>Repeated confidence intervals (lower)</em>: -25.271, -4.803, NA</li>
<li><em>Repeated confidence intervals (upper)</em>: 53.67, 32.80, NA</li>
<li><em>Repeated p-values</em>: 0.29776, 0.07854, NA</li>
<li><em>Final stage</em>: NA</li>
<li><em>Final p-value</em>: NA, NA, NA</li>
<li><em>Final CIs (lower)</em>: NA, NA, NA</li>
<li><em>Final CIs (upper)</em>: NA, NA, NA</li>
<li><em>Median unbiased estimate</em>: NA, NA, NA</li>
</ul>
</div>
</div>
<p>The conditional power of 0.645 is not very large and so a sample size increase might be appropriate. This conditional power calculation, however, is performed with the <em>observed effect</em> and <em>observed standard deviation</em> and so it might be reasonable to take a look at the effect size and its variability. This is graphically illustrated by the plot of the conditional power and the likelihood function over a range of alternative values. E.g., specify <code>thetaRange = c(0,30)</code> and obtain the graph below.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/index_files/figure-html/unnamed-chunk-18-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
</div>
<p>You can also specify an alternative effect and standard deviation (e.g., <code>thetaH1 = 15, assumedStDev = 35</code>) for which the conditional power should be calculated, and graph the results. Here, the functions <code>getConditionalPower()</code> and <code>getStageResults()</code> are used, but the same result can be obtained when specifying <code>thetaH1 = 15, assumedStDev = 35</code> in <code>getAnalysisResults()</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">stageResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getStageResults</span>(</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> datasetExample</span>
<span id="cb13-4">)</span>
<span id="cb13-5"></span>
<span id="cb13-6">stageResults <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getConditionalPower</span>(</span>
<span id="cb13-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb13-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb13-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">35</span></span>
<span id="cb13-11">    )</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Conditional power results means</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned sample size</em>: NA, NA, 60</li>
<li><em>Assumed effect under alternative</em>: 15</li>
<li><em>Assumed standard deviation</em>: 35</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Conditional power</em>: NA, NA, 0.7842</li>
</ul>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">stageResults <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb14-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb14-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>),</span>
<span id="cb14-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">35</span></span>
<span id="cb14-6">    )</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/index_files/figure-html/unnamed-chunk-20-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Overall, using a slightly smaller standard deviation than observed, the conditional power calculated with the originally planned sample size seems to be reasonably high.</p>
</section>
<section id="final-analysis" class="level1">
<h1>Final analysis</h1>
<p>Assume now that it was decided to continue with the originally planned sample size ( = 60 per stage) and the final stage shows the results:</p>
<p>Final stage:</p>
<div class="cell">
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">arm</th>
<th style="text-align: right;">n</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">std</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">experimental</td>
<td style="text-align: right;">32</td>
<td style="text-align: right;">111.3</td>
<td style="text-align: right;">41.4</td>
</tr>
<tr class="even">
<td style="text-align: left;">control</td>
<td style="text-align: right;">31</td>
<td style="text-align: right;">100.1</td>
<td style="text-align: right;">39.5</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We obtain the test results for the final stage and show it as a summary output as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">datasetExample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">112.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">113.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">111.3</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">98.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">99.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.1</span>),</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">42.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">41.4</span>),</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">41.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">39.5</span>),</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>),</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>)</span>
<span id="cb15-8">)</span>
<span id="cb15-9"></span>
<span id="cb15-10">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb15-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> datasetExample</span>
<span id="cb15-13">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 3 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a two-sample t-test, equal variances option. H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>14.200</td>
<td>14.016</td>
<td>13.120</td>
</tr>
<tr class="odd">
<td>Cumulative (pooled) standard deviation</td>
<td>45.614</td>
<td>43.604</td>
<td>42.432</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic</td>
<td>1.310</td>
<td>1.314</td>
<td>1.098</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value</td>
<td>0.0972</td>
<td>0.0968</td>
<td>0.1383</td>
</tr>
<tr class="even">
<td>Inverse normal combination</td>
<td>1.298</td>
<td>1.837</td>
<td>2.128</td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject</td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.0677</td>
<td>0.1912</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval</td>
<td>[-25.271; 53.671]</td>
<td>[-4.803; 32.798]</td>
<td>[0.768; 25.310]</td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.2978</td>
<td>0.0785</td>
<td>0.0183</td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0197</td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>[0.621; 24.519]</td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>12.620</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The warning indicates that the calculation of the final CI can be critical if sample size changes were performed. This is not the case here, and so the confidence interval that is based on the stagewise ordering given by (0.621, 24.519) is a valid inference tool. Together with the RCI at stage 3 (0.768, 25.31) it corresponds to the test decision of rejecting the null hypothesis. The test decision is also reflected in both the final <img src="https://latex.codecogs.com/png.latex?p">-value and repeated <img src="https://latex.codecogs.com/png.latex?p">-value being smaller than <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">.</p>
</section>
<section id="references" class="level1">
<h1>References</h1>
<ol type="1">
<li>Gernot Wassmer and Werner Brannath, <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, Springer 2016, ISBN 978-3319325606</li>
</ol>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Analysis</category>
  <category>Means</category>
  <guid>https://www.rpact.org/vignettes/analysis/rpact_continuous_analysis_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_08.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Analysis of a Multi-Arm Design with a Binary Endpoint using rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>This vignette provides examples of how to analyse a trial with multiple arms and a binary endpoint. It shows how to calculate the conditional power at a given stage and how to select/deselect treatment arms. For designs with multiple arms, <a href="https://cran.r-project.org/package=rpact">rpact</a> enables the analysis using the <strong>closed combination testing principle</strong>. For a description of the methodology please refer to Part III of the book <a href="http://monograph.wassmer.brannath.rpact.net/">“Group Sequential and Confirmatory Adaptive Designs in Clinical Trials”</a> (Wassmer and Brannath, 2016).</p>
<p>Suppose the trial was conducted as a multi-arm multi-stage trial with three active treatments arms and a control arm when the trial started. In the interim stages, it should be possible to de-select treatment arms if their treatment effect is likely too small to show significance - assuming reasonable sample size - at the end of the trial. This should hold true even if a certain sample size increase was taken into account. For this vignette, the considered endpoint is a failure (i.e., binary) and it is intended to test each active arm against a common control. This is to test the hypotheses <img src="https://latex.codecogs.com/png.latex?%20H_%7B0i%7D:%5Cpi_%7B%5Ctext%7Barm%7Di%7D%20=%20%5Cpi_%5Ctext%7Bcontrol%7D%20%5Cqquad%5Ctext%7Bagainst%7D%20%5Cqquad%20H_%7B1i%7D:%5Cpi_%7B%5Ctext%7Barm%7Di%7D%20%3C%20%5Cpi_%5Ctext%7Bcontrol%7D%5C;,%20%5C;i%20=%201,2,3%5C,,"> in the many-to-one comparisons setting. That is, it is intended to show that the failure rate is smaller in active arms as compared to control and so the power is directed towards negative values of <img src="https://latex.codecogs.com/png.latex?%5Cpi_%7B%5Ctext%7Barm%7Di%7D%20-%20%5Cpi_%5Ctext%7Bcontrol%7D">.</p>
</section>
<section id="create-the-design" class="level1">
<h1>Create the design</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>In <a href="https://cran.r-project.org/package=rpact">rpact</a>, we first have to select the combination test with the corresponding stopping boundaries to be used in the closed testing procedure. We choose a design with critical values within the Wang &amp; Tsiatis <img src="https://latex.codecogs.com/png.latex?%5CDelta">-class of boundaries with <img src="https://latex.codecogs.com/png.latex?%5CDelta%20=%200.25">. Planning two interim stages and a final stage, assuming equally sized stages, the design is defined through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>, </span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span></span>
<span id="cb3-6">) </span>
<span id="cb3-7">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (inverse normal combination test design)</strong></p>
<p>Wang &amp; Tsiatis Delta class design (deltaWT = 0.25), one-sided overall significance level 2.5%, undefined endpoint.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>This definition fixes the weights in the combination test which are the same over the three stages. This is a reasonable choice although the amount of information seems to be not the same over the stages (see <a href="https://doi.org/10.1080/10543406.2011.551336">Wassmer, 2010</a>).</p>
</section>
<section id="analysis" class="level1">
<h1>Analysis</h1>
<section id="first-stage" class="level2">
<h2 class="anchored" data-anchor-id="first-stage">First stage</h2>
<p>In each of the four arms (three treatment arms and one control arm), subjects were randomized such that around 40 subjects per arm will be observed. Assume that the following actual sample sizes and failures in the control and the three experimental treatment arms were obtained for the first stage of the trial:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Arm</th>
<th>n</th>
<th>Failures</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Active 1</td>
<td>42</td>
<td>7</td>
</tr>
<tr class="even">
<td>Active 2</td>
<td>39</td>
<td>8</td>
</tr>
<tr class="odd">
<td>Active 3</td>
<td>38</td>
<td>14</td>
</tr>
<tr class="even">
<td>Control</td>
<td>41</td>
<td>18</td>
</tr>
</tbody>
</table>
<p>These data are defined as an <a href="https://cran.r-project.org/package=rpact">rpact</a> dataset with the function <code>getDataset()</code> for the later use in <code>getAnalysisResults()</code> through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">dataRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span>  <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span>  <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>,</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events4      =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>,</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>,</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>,</span>
<span id="cb4-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>,</span>
<span id="cb4-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes4 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span></span>
<span id="cb4-10">)</span></code></pre></div></div>
</div>
<p>That is, you can use the <code>getDataset()</code> function in the usual way and simply extend it to the multiple treatment arms situation. Note that the arm with the highest index <strong>always refers to the control group</strong>. For the control group, specifically, it is <strong>mandatory to enter values over all stages</strong>. As we will see below, it is possible to omit information of de-selected active arms.</p>
<p>Using</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb5-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
</div>
<p>one obtains the test results for the first stage of this trial (note the <code>directionUpper = FALSE</code> specification that yields small <img src="https://latex.codecogs.com/png.latex?p">-values for negative test statistics):</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.167</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.205</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (3)</td>
<td>0.368</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative control rate</td>
<td>0.439</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 2, 3)</td>
<td>0.0095</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0066</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 3)</td>
<td>0.0066</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2, 3)</td>
<td>0.0239</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0034</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0128</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 2, 3)</td>
<td>2.346</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.480</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 3)</td>
<td>2.480</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2, 3)</td>
<td>1.980</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.704</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>2.233</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (3)</td>
<td>0.639</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>First of all, at the first interim no hypothesis can be rejected with the closed combination test. This is seen from the <code>Test action: reject (i)</code> variable. It is remarkable, however, that the <img src="https://latex.codecogs.com/png.latex?p">-value for the comparison of treatment arm 1 against control (p = 0.0034) is quite small and even the <img src="https://latex.codecogs.com/png.latex?p">-value for the global intersection is (p(1, 2, 3) = 0.0095) is not too far from showing significance. It is important to know that, by default, the <strong>Dunnett many-to-one comparison test</strong> for binary data is used as the test for the intersection hypotheses, and the <strong>approximate pairwise score test</strong> (which is the signed square root of the <img src="https://latex.codecogs.com/png.latex?%5Cchi%5E2"> test) is used for the calculation of the separate <img src="https://latex.codecogs.com/png.latex?p">-values. Note that in this presentation, the intersection test for the whole closed system of hypotheses is provided such that the closed test can completely be reproduced.</p>
<p>The repeated <img src="https://latex.codecogs.com/png.latex?p">-values (0.0519, 0.0948, and 0.4568, respectively) precisely correspond with the test decision meaning that a repeated <img src="https://latex.codecogs.com/png.latex?p">-value is smaller or equal to the overall significance level (0.025) if and only if the corresponding hypothesis can be rejected at the considered stage. This direct correspondence is not generally true for the repeated confidence intervals (i.e., they can contain the value zero although the null hypothesis can be rejected), but it is true for the situation at hand. The repeated confidence intervals can be displayed with the <code>plot(type = 2)</code> command by</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>For assessing the conditional power, a sample size specification for the remaining stages needs to be done. We assume that around 80 subjects will be obtained <strong>per considered comparison</strong> and <strong>per stage</strong> (i.e., 40 subjects per stage for each considered treatment group and 40 subjects per stage for the control arm). Use <code>?getAnalysisResults()</code> for further information about how to specify the parameter <code>nPlanned</code>. Assuming 80 subjects you have to re-run (<code>options("rpact.summary.output.size" = "small")</code> reduces the output of the summary)</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"small"</span>)</span>
<span id="cb7-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>)</span>
<span id="cb7-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb7-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
</div>
<p>to obtain</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0. The conditional power calculation with planned sample size is based on overall treatment rate: pi(1) = 0.17, pi(2) = 0.21, pi(3) = 0.37 and overall control rate = 0.439.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td>80</td>
<td>80</td>
</tr>
<tr class="odd">
<td>Conditional power (1)</td>
<td></td>
<td>0.9672</td>
<td>0.9990</td>
</tr>
<tr class="even">
<td>Conditional power (2)</td>
<td></td>
<td>0.8438</td>
<td>0.9846</td>
</tr>
<tr class="odd">
<td>Conditional power (3)</td>
<td></td>
<td>0.0239</td>
<td>0.1229</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>The <code>Conditional power (i)</code> variable shows very high power (esp.&nbsp;for the final stage) for treatment arms 1 and 2, but not for arm 3. Note that the conditional power is calculated under the assumption that the <strong>observed rates are the true rates</strong>. This can be changed, however, by setting <code>piControl</code> and/or <code>piTreatments</code> equal to the desired values (<code>piTreatments</code> can even be a vector specifying one rate per active treatment arm), e.g.,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb8-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>),</span>
<span id="cb8-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.17</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>),</span>
<span id="cb8-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.44</span></span>
<span id="cb8-8">) </span>
<span id="cb8-9">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0. The conditional power calculation with planned sample size is based on assumed treatment rate: pi(1) = 0.17, pi(2) = 0.2, pi(3) = 0.37 and assumed control rate = 0.44.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td>80</td>
<td>80</td>
</tr>
<tr class="odd">
<td>Conditional power (1)</td>
<td></td>
<td>0.9648</td>
<td>0.9988</td>
</tr>
<tr class="even">
<td>Conditional power (2)</td>
<td></td>
<td>0.8594</td>
<td>0.9879</td>
</tr>
<tr class="odd">
<td>Conditional power (3)</td>
<td></td>
<td>0.0235</td>
<td>0.1213</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Note that the title of the summary describes the situation under which the conditional power calculation is performed.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatmentRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), </span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/index_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
</div>
<p>Altogether, based on the results of the first interim the decision to drop treatment arm 3 and to recruit further 40 patients to each treatment arms 1 and 2 (and to the control group) was taken.</p>
</section>
<section id="second-stage" class="level2">
<h2 class="anchored" data-anchor-id="second-stage">Second stage</h2>
<p>Also for the second stage, in each of the remaining treatment arms and the control arm, subjects were randomized such that around 40 subjects per arm will be observed. Assume the following failures and actual sample sizes in the control and the two remaining arms:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Arm</th>
<th>n</th>
<th>Failures</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Active 1</td>
<td>37</td>
<td>9</td>
</tr>
<tr class="even">
<td>Active 2</td>
<td>41</td>
<td>13</td>
</tr>
<tr class="odd">
<td>Active 3</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Control</td>
<td>42</td>
<td>19</td>
</tr>
</tbody>
</table>
<p>With <code>getDataset()</code>, these data for the second stage are appended to the first stage data as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">dataRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>),</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>),</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>),</span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>),</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>)</span>
<span id="cb11-10">)</span></code></pre></div></div>
</div>
<p>and the stage 2 results are obtained with <code>getAnalysisResults()</code> as above. Printing a summary of the analysis results yields:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td>-0.243</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td>-0.183</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.167</td>
<td>0.203</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.205</td>
<td>0.262</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (3)</td>
<td>0.368</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative control rate</td>
<td>0.439</td>
<td>0.446</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td>-1.939</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td>-1.266</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td>0.0262</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td>0.1027</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 2, 3)</td>
<td>0.0095</td>
<td>0.0478</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0066</td>
<td>0.0478</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 3)</td>
<td>0.0066</td>
<td>0.0262</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2, 3)</td>
<td>0.0239</td>
<td>0.1027</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0034</td>
<td>0.0262</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0128</td>
<td>0.1027</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 2, 3)</td>
<td>2.346</td>
<td>2.837</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.480</td>
<td>2.932</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 3)</td>
<td>2.480</td>
<td>3.125</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2, 3)</td>
<td>1.980</td>
<td>2.295</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.704</td>
<td>3.283</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>2.233</td>
<td>2.474</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (3)</td>
<td>0.639</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td>0.6572</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td>0.3589</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td>[-0.429; -0.037]</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td>[-0.380; 0.024]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td>0.0065</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td>0.0256</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Treatment arm 1 is significantly better than control, stated by <code>Test action: reject (1)</code>, and reflected in both <code>Repeated $p$-value (1)</code> falling below 0.025 and the <code>Repeated confidence interval (1)</code> excluding 0. For treatment arm 2, however, significance could not be shown, although both, the global intersection hypothesis and the single hypothesis referring to treatment arm 2, can be rejected with the corresponding combination test. The reason for non-significance is the overall adjusted test statistic for testing <img src="https://latex.codecogs.com/png.latex?H_%7B02%7D%5Ccap%20H_%7B03%7D"> which is 2.295 &lt; 2.305.</p>
<p>In order to show significance also for treatment arm 2, one might calculate the power if the sample size of the final stage was reduced to 20 subjects per considered arm (treatment arm 2 and control). This is achieved through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"small"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb12-2">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb12-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb12-7">) </span>
<span id="cb12-8">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0. The conditional power calculation with planned sample size is based on overall treatment rate: pi(1) = 0.2, pi(2) = 0.26, pi(3) = NA and overall control rate = 0.446.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td>-0.243</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td>-0.183</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td>-1.939</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td>-1.266</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td>0.0262</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td>0.1027</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td>0.6572</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td>0.3589</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>40</td>
</tr>
<tr class="odd">
<td>Conditional power (1)</td>
<td></td>
<td></td>
<td>0.9830</td>
</tr>
<tr class="even">
<td>Conditional power (2)</td>
<td></td>
<td></td>
<td>0.8069</td>
</tr>
<tr class="odd">
<td>Conditional power (3)</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td>[-0.429; -0.037]</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td>[-0.380; 0.024]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td>0.0065</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td>0.0256</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>showing that conditional power might be reduced to around 80% if the sample size was decreased. However, as showing in this graph</p>
<div class="cell">
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/index_files/figure-html/unnamed-chunk-17-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
</div>
<p>this is predominantly due to the relatively large observed overall failure rate in stage 2. Assuming a failure rate of (say) 20% yields conditional power of 91.1% which is obtained from</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>,</span>
<span id="cb14-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb14-7">)</span>
<span id="cb14-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>conditionalPower[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
</div>
<p>Therefore, it might be reasonable to drop treatment arm 1 (for which significance was already shown) and compare treatment arm 2 only against control in the final stage.</p>
</section>
<section id="final-stage" class="level2">
<h2 class="anchored" data-anchor-id="final-stage">Final stage</h2>
<p>Assume the following sample sizes and failures for the final stage where only (additional) active arm 2 and control data were obtained.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Arm</th>
<th>n</th>
<th>Failures</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Active 1</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Active 2</td>
<td>18</td>
<td>7</td>
</tr>
<tr class="odd">
<td>Active 3</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Control</td>
<td>19</td>
<td>11</td>
</tr>
</tbody>
</table>
<p>These data for the final stage are entered as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">dataRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>),</span>
<span id="cb15-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb15-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>)</span>
<span id="cb15-10">)</span></code></pre></div></div>
</div>
<p>and</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb16-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb16-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataRates,</span>
<span id="cb16-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb16-5">) </span>
<span id="cb16-6">results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
</div>
<p>provides the results (significance for treatment arm 2 could additionally be shown):</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Dunnett intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0031</td>
<td>0.0124</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0031</td>
<td>0.0106</td>
<td>0.0186</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.741</td>
<td>2.305</td>
<td>2.083</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>-0.272</td>
<td>-0.243</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>-0.234</td>
<td>-0.183</td>
<td>-0.185</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>-0.071</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>-2.704</td>
<td>-1.939</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>-2.233</td>
<td>-1.266</td>
<td>-1.156</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>-0.639</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0034</td>
<td>0.0262</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0128</td>
<td>0.1027</td>
<td>0.1238</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2615</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td>TRUE</td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td>TRUE</td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2647</td>
<td>0.6572</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1708</td>
<td>0.3589</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (3)</td>
<td>0.0202</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (1)</td>
<td>[-0.541; 0.038]</td>
<td>[-0.429; -0.037]</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (2)</td>
<td>[-0.514; 0.089]</td>
<td>[-0.380; 0.024]</td>
<td>[-0.351; -0.012]</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (3)</td>
<td>[-0.384; 0.259]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.0519</td>
<td>0.0065</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.0948</td>
<td>0.0256</td>
<td>0.0070</td>
</tr>
<tr class="odd">
<td>Repeated p-value (3)</td>
<td>0.4568</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Summarizing the results, <code>plot(results, type = 2, legendPosition = 4)</code> produces a plot of the sequence of repeated confidence intervals over the stages:</p>
<div class="cell">
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/index_files/figure-html/unnamed-chunk-23-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="closing-remarks" class="level1">
<h1>Closing remarks</h1>
<p>This example describes a range of design modifications, namely selecting treatments arms and performing sample size recalculation for both stages. It is important to recognize that neither the type of adaptation nor the adaptation rule was pre-specified. Despite this, the closed combination test provides control of the experimentwise error rate in the strong sense. To utilize the whole repertoire of possible adaptations, one might also use the <code>conditional rejection probability (i)</code> values in order to <strong>completely redefine</strong> the design, which includes, for example, to change the number of remaining stages, to change the type of intersection test, or even to add a treatment arm.</p>
<p>Note that in multi-arm designs no final analysis <img src="https://latex.codecogs.com/png.latex?p">-values, confidence intervals, and median unbiased treatment effect estimates are calculated. This is in contrast to the single hypothesis adaptive designs where, using the stage-wise ordering of the sample space, at the final stage such calculations were done with rpact (for example, see the vignette <a href="https://vignettes.rpact.com/html/rpact_analysis_examples.html">Analysis of a group sequential trial with a survival endpoint</a>).</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Analysis</category>
  <category>Rates</category>
  <category>Multi-arm</category>
  <guid>https://www.rpact.org/vignettes/analysis/rpact_multi_arm_analysis_rates_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_15.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Analysis of a Group Sequential Trial with a Survival Endpoint using rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/analysis/rpact_analysis_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>This tutorial provides two examples:</p>
<ul>
<li>The <strong>first example</strong> illustrates <strong>how to get inference (point estimate, confidence interval, and <img src="https://latex.codecogs.com/png.latex?p%5C,">-value) which respect the group sequential design after rejecting the null hypothesis at the interim or final analysis</strong>.</li>
<li>The <strong>second example</strong> illustrates tools which are relevant for <strong>monitoring interim results of an ongoing trial</strong>: <strong>repeated confidence intervals</strong> and <strong>conditional power</strong>.</li>
</ul>
<p>For a general introduction to “Inference in group sequential designs”, please refer to the book <a href="http://monograph.wassmer.brannath.rpact.net/">“Group Sequential and Confirmatory Adaptive Designs in Clinical Trials”</a> by Gernot Wassmer &amp; Werner Brannath.</p>
<p>This tutorial only covers survival endpoints. Code for other endpoints is similar but the dataset needs to be provided in a different format (see <code>?getDataset</code> for details).</p>
</section>
<section id="inference-for-the-gallium-trial-which-was-stopped-at-an-interim-analysis" class="level1">
<h1>Inference for the Gallium trial which was stopped at an interim analysis</h1>
<p>For details about the Gallium trial, we refer to the primary study publication: <a href="https://www.nejm.org/doi/full/10.1056/NEJMoa1614598">Marcus et al, N Engl J Med 2017; 377:1331-1344</a>.</p>
<section id="gallium-design-background" class="level2">
<h2 class="anchored" data-anchor-id="gallium-design-background">Gallium design background</h2>
<p><strong>Trial characteristics</strong>:</p>
<ul>
<li>Population: Treatment-naive follicular lymphoma patients.</li>
<li>Comparison: Rituximab + chemotherapy vs.&nbsp;Obinutuzumab + chemotherapy. Rituximab: Rituxan, Mabthera. Obinutuzumab: Gazyva(ro).</li>
<li>Phase III, 1:1 randomized, open-label clinical trial.</li>
<li>Primary endpoint: investigator-assessed progression-free survival (PFS).</li>
</ul>
<p><strong>Group-sequential design</strong>:</p>
<ul>
<li>O’Brien &amp; Fleming boundary with interim analyses after 30% and 67% of PFS events.</li>
<li>Non-binding futility after 30% of PFS events (if estimated HR &gt; 1).</li>
<li>Target HR 0.74, 80% power at two-sided 5% significance level <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> final analysis at 370 PFS events.</li>
<li>Target sample size is 1202 subjects.</li>
</ul>
</section>
<section id="conventional-analyses-at-the-first-and-second-interim-analysis" class="level2">
<h2 class="anchored" data-anchor-id="conventional-analyses-at-the-first-and-second-interim-analysis">Conventional analyses at the first and second interim analysis</h2>
<p>Results from standard inference at the <strong>futility interim analysis after 113 events</strong>:</p>
<ul>
<li>Stratified HR 0.69 (95% CI 0.47 to 1.01). <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> <strong>Trial continues.</strong></li>
<li>log(HR) = log(0.69) with standard error 0.20.</li>
<li>Corresponding Z-score: log(0.69)/0.20 = -1.86.</li>
</ul>
<p>Results from standard inference at the <strong>efficacy interim analysis after 245 events</strong>:</p>
<ul>
<li>Stratified HR 0.66 (95% CI 0.51 to 0.85).</li>
<li>log(HR) = log(0.66) with standard error 0.13.</li>
<li>Corresponding Z-score: log(0.66)/0.13 = -3.225.</li>
<li>Two-sided <img src="https://latex.codecogs.com/png.latex?p">-value is 0.0012 which was smaller than the critical value from the O’Brien-Fleming boundary of 0.012. <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> <strong>Trial stopped early for efficacy</strong>.</li>
</ul>
</section>
<section id="analysis-accounting-for-the-group-sequential-design" class="level2">
<h2 class="anchored" data-anchor-id="analysis-accounting-for-the-group-sequential-design">Analysis accounting for the group sequential design</h2>
<p>First, load the <a href="https://cran.r-project.org/package=rpact">rpact</a> package and <strong>define the group sequential boundaries</strong> using the function <code>getDesignGroupSequential</code>. Note that while the Gallium protocol specified a two-sided significance level of 5%, we implement this via a one-sided significance level of 2.5% as <a href="https://cran.r-project.org/package=rpact">rpact</a> (sensibly) only supports one-sided designs if futility interim analyses are specified.</p>
<p><strong>First, load the rpact package </strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>and define the design:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FutilityBounds = c(0,-6) are on the Z-scale; a value of Z = 0 implies futility</span></span>
<span id="cb3-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># if the interim estimate is "in the wrong direction" (i.e., HR &gt;= 1 here),</span></span>
<span id="cb3-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a value of Z = -6 is essentially the same as Z = -Inf and implies no futility</span></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># boundary for the second interim as per the Gallium design</span></span>
<span id="cb3-5">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">113</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">370</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">370</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb3-9">)</span></code></pre></div></div>
</div>
<p>Note that <code>bindingFutility = FALSE</code> has no impact because it is the default, so actually this could be omitted (same holds for <code>sided = 1</code> and <code>alpha = 0.025</code>).</p>
<p>Second, the <strong>results after the first and second interim</strong> are specified using the function <code>getDataset()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># overallLogRanks: One-sided logrank statistic or Z-score ( = log(HR)/SE) from Cox regression</span></span>
<span id="cb4-2">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">113</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>),</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.86</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.225</span>),</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallAllocationRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb4-6">)</span></code></pre></div></div>
</div>
<p>Since rpact version 3.2, the prefix cumulative[Capital case of first letter of variable name]… or cum[Capital case of first letter of variable name]… can alternatively be used for this. That is,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">113</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>),</span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.86</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.225</span>),</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeAllocationRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb5-5">)</span></code></pre></div></div>
</div>
<p>defines the same survival dataset. This is used for creating the <strong>adjusted inference</strong> using the function <code>getAnalysisResults()</code> (<code>directionUpper = FALSE</code> is specified because the power is directed towards negative values of the logrank statistics):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">adj_result <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> results,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb6-5">)</span>
<span id="cb6-6">adj_result</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results (survival of 2 groups, group sequential design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.305, 0.662, 1.000</li>
<li><em>Critical values</em>: 3.891, 2.520, 1.992</li>
<li><em>Futility bounds (non-binding)</em>: 0.000, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.00004995, 0.00587877, 0.02499999</li>
<li><em>Local one-sided significance levels</em>: 0.00004995, 0.00586101, 0.02318178</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Direction upper</em>: FALSE</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Theta H0</em>: 1</li>
</ul>
<p><strong>Stage results</strong></p>
<ul>
<li><em>Cumulative effect sizes</em>: 0.7047, 0.6623, NA</li>
<li><em>Stage-wise test statistics</em>: -1.860, -2.673, NA</li>
<li><em>Stage-wise p-values</em>: 0.031443, 0.003762, NA</li>
<li><em>Overall test statistics</em>: -1.860, -3.225, NA</li>
<li><em>Overall p-values</em>: 0.0314428, 0.0006299, NA</li>
</ul>
<p><strong>Analysis results</strong></p>
<ul>
<li><em>Actions</em>: continue, reject and stop, NA</li>
<li><em>Conditional rejection probability</em>: 0.1373, 0.8616, NA</li>
<li><em>Conditional power</em>: NA, NA, NA</li>
<li><em>Repeated confidence intervals (lower)</em>: 0.3389, 0.4799, NA</li>
<li><em>Repeated confidence intervals (upper)</em>: 1.4653, 0.9139, NA</li>
<li><em>Repeated p-values</em>: 0.234459, 0.005409, NA</li>
<li><em>Final stage</em>: 2</li>
<li><em>Final p-value</em>: NA, 0.0006656, NA</li>
<li><em>Final CIs (lower)</em>: NA, 0.5157, NA</li>
<li><em>Final CIs (upper)</em>: NA, 0.8515, NA</li>
<li><em>Median unbiased estimate</em>: NA, 0.6626, NA</li>
</ul>
</div>
</div>
<p>The output is explained as follows:</p>
<ul>
<li><code>Critical values</code> are group sequential efficacy boundary values on the <img src="https://latex.codecogs.com/png.latex?z">-scale, <code>Local one-sided significance levels</code> are the corresponding one-sided local significance levels.</li>
<li><code>Cumulative effect sizes</code> refer to hazard ratio estimates that are based on the overall test statistics.</li>
<li><code>Test statistics</code> and <code>p-values</code> refer to <img src="https://latex.codecogs.com/png.latex?z">-scores and <img src="https://latex.codecogs.com/png.latex?p">-values obtained from the first interim analysis and results which would have been obtained after the second interim analysis if not all data up to the second interim analysis but only new data since the first interim had been included (i.e., per-stage results).</li>
<li><code>Overall test statistics</code> are the given (overall, not per-stage) <img src="https://latex.codecogs.com/png.latex?z">-scores from each interim and <code>Overall p-value</code> the corresponding one-sided <img src="https://latex.codecogs.com/png.latex?p">-values.</li>
<li><code>Repeated confidence intervals</code> provide valid (but conservative) inference at any stage of an ongoing or stopped group sequential trial. <code>Repeated p-values</code> are the corresponding <img src="https://latex.codecogs.com/png.latex?p">-values.</li>
<li><code>Final p-value</code> is the <strong>final one-sided adjusted <img src="https://latex.codecogs.com/png.latex?p">-value</strong> based on the stagewise ordering of the sample space.</li>
<li><code>Median unbiased estimate</code> and <code>Final CIs</code> are the corresponding median-unbiased <strong>adjusted treatment effect estimate</strong> and the <strong>confidence interval</strong> for the hazard ratio at the interim analysis where the trial was stopped.</li>
</ul>
<p>These results can also be displayed with the <code>summary()</code> function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">adj_result <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &lt; 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>30.5%</td>
<td>66.2%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0059</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0059</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.891</td>
<td>2.520</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>-Inf</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>0.705</td>
<td>0.662</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall test statistic</td>
<td>-1.860</td>
<td>-3.225</td>
<td></td>
</tr>
<tr class="even">
<td>Overall p-value</td>
<td>0.0314</td>
<td>0.0006</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>reject and stop</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.1373</td>
<td>0.8616</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval</td>
<td>[0.339; 1.465]</td>
<td>[0.480; 0.914]</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.2345</td>
<td>0.0054</td>
<td></td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td></td>
<td>0.0007</td>
<td></td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td></td>
<td>[0.516; 0.852]</td>
<td></td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td></td>
<td>0.663</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Note that for this example, the <strong>adjusted final hazard ratio of 0.663 and the adjusted confidence interval of (0.516, 0.852) match the results from the conventional analysis almost exactly for the first two decimals.</strong> This is consistent with the finding that stopping a trial after 50% or more of the events had been collected has a negligible impact on estimation.</p>
</section>
</section>
<section id="example-monitoring-an-ongoing-trial" class="level1">
<h1>Example: Monitoring an ongoing trial</h1>
<p>Monitoring ongoing trials is also possible with the function <code>getAnalysisResults()</code> introduced above. <strong>Repeated confidence intervals</strong> which provide valid (but conservative) inference at any stage of an ongoing or stopped group sequential trial can be obtained using the same code as introduced in the previous example. <strong>Conditional power calculations</strong> require additional specification of the following arguments:</p>
<ul>
<li>The assumed true hazard ratio <code>thetaH1</code>.</li>
<li>The planned number of additional events for future interim stages (<code>nPlanned</code>).</li>
<li>The planned allocation ratio <code>allocationRatioPlanned</code> for future interim stages (default is 1).</li>
</ul>
<p>We illustrate these capabilities by introducing <strong>hypothetical interim results</strong> for the Gallium trial.</p>
<p>Assume the same design as for the Gallium trial introduced above and the following interim results:</p>
<p><strong>Hypothetical results</strong> from standard inference at the <strong>futility interim analysis</strong> after 113 events:</p>
<ul>
<li>Stratified HR 0.69 (95% CI 0.47 to 1.01). <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> <strong>Trial would continue.</strong></li>
<li>log(HR) = log(0.69) with standard error 0.20.</li>
<li>Corresponding Z-score: log(0.69)/0.20 = -1.86.</li>
</ul>
<p><strong>Hypothetical results</strong> from standard inference at the <strong>efficacy interim analysis</strong> after 245 events:</p>
<ul>
<li>Stratified HR 0.80 (95% CI 0.62 to 1.03). <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> <strong>Trial would continue.</strong></li>
<li>log(HR) = log(0.80) with standard error 0.13.</li>
<li>Corresponding Z-score: log(0.80)/0.13 = -1.716.</li>
</ul>
<p><strong>Calculation of repeated confidence intervals</strong> and <strong>conditional power</strong>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1) Specify results so far using function getDataset() as before</span></span>
<span id="cb8-2">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">113</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>),</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.86</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.716</span>),</span>
<span id="cb8-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeAllocationRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-6">)</span>
<span id="cb8-7"></span>
<span id="cb8-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2) Calculate repeated confidence intervals and conditional power using</span></span>
<span id="cb8-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the function getAnalysisResults() as before</span></span>
<span id="cb8-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Additional arguments for the conditional power calculation are</span></span>
<span id="cb8-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - nPlanned: additional events from second interim until final analysis</span></span>
<span id="cb8-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   (370-245 for this trial)</span></span>
<span id="cb8-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - thetaH1: True hazard ratio governing future stages</span></span>
<span id="cb8-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   (set to 0.74 here as per the original protocol assumptions)</span></span>
<span id="cb8-15">interim_results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb8-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb8-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> results,</span>
<span id="cb8-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb8-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">370</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span></span>
<span id="cb8-20">)</span>
<span id="cb8-21">interim_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &lt; 1. The conditional power calculation with planned sample size is based on assumed effect = 0.74.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>30.5%</td>
<td>66.2%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0059</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0059</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.891</td>
<td>2.520</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>-Inf</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>0.705</td>
<td>0.803</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall test statistic</td>
<td>-1.860</td>
<td>-1.716</td>
<td></td>
</tr>
<tr class="even">
<td>Overall p-value</td>
<td>0.0314</td>
<td>0.0431</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.1373</td>
<td>0.1527</td>
<td></td>
</tr>
<tr class="odd">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>125</td>
</tr>
<tr class="even">
<td>Conditional power</td>
<td></td>
<td></td>
<td>0.7448</td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval</td>
<td>[0.339; 1.465]</td>
<td>[0.582; 1.108]</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.2345</td>
<td>0.1013</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>As per the output above, the recommended action after the second interim analysis of this hypothetical trial would be to continue the trial, a repeated confidence interval for the hazard ratio is (0.582 to 1.108), and the conditional power to reach significance at the final analysis under protocol assumptions is 0.745. Final estimates and <img src="https://latex.codecogs.com/png.latex?p">-values are still missing as the trial has not stopped yet.</p>
<p>To obtain a <strong>plot of the conditional power over a range of alternatives</strong> you might call the <a href="https://cran.r-project.org/package=rpact">rpact</a> <code>plot()</code> function and specify the range for theta with <code>thetaRange</code>. This produces the conditional power curve together with the likelihood function over the specified range:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">interim_results <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_analysis_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
</div>
<p>Note that <code>nPlanned</code> (the maximum number of remaining events) is extracted from <code>interim_results</code> and can optionally be changed.</p>
<p>If one <strong>only</strong> wants to <strong>calculate the conditional power</strong>, then it is computationally more efficient to call the functions <code>getStageResults()</code> and <code>getConditionalPower()</code> instead. The code below illustrates this by plotting the conditional power curve depending on the true treatment effect. The dashed vertical lines in the plot correspond to the protocol hazard ratio of 0.74 and the observed interim hazard ratio of 0.8.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># get stage results so far</span></span>
<span id="cb11-2">stageResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getStageResults</span>(design, results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb11-3"></span>
<span id="cb11-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># calculate condition power for true HR ranging from 0.6 to 1</span></span>
<span id="cb11-5">hr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb11-6"></span>
<span id="cb11-7">cpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(hr))</span>
<span id="cb11-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(hr)) {</span>
<span id="cb11-9">    cpower[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getConditionalPower</span>(stageResults,</span>
<span id="cb11-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">370</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>,</span>
<span id="cb11-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> hr[i]</span>
<span id="cb11-12">    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>conditionalPower[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]</span>
<span id="cb11-13">}</span>
<span id="cb11-14"></span>
<span id="cb11-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Alternatively, use the Vectorize() function for doing this:</span></span>
<span id="cb11-16">cpowerVec <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Vectorize</span>(<span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb11-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getConditionalPower</span>(stageResults,</span>
<span id="cb11-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">370</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">245</span>,</span>
<span id="cb11-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> x</span>
<span id="cb11-20">    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>conditionalPower[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]</span>
<span id="cb11-21">})</span>
<span id="cb11-22">cpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cpowerVec</span>(hr)</span>
<span id="cb11-23"></span>
<span id="cb11-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot results</span></span>
<span id="cb11-25"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(hr, cpower,</span>
<span id="cb11-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"True hazard ratio"</span>,</span>
<span id="cb11-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Conditional power"</span>,</span>
<span id="cb11-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb11-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Conditional power after second interim analysis"</span></span>
<span id="cb11-30">)</span>
<span id="cb11-31"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axis</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">at =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>))</span>
<span id="cb11-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axis</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">at =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>))</span>
<span id="cb11-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">v =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">h =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gray</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>))</span>
<span id="cb11-34"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">v =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/analysis/rpact_analysis_examples/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Analysis</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/analysis/rpact_analysis_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_02.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Step-by-Step rpact Tutorial</title>
  <dc:creator>[[](#)]{.author-row} [[Daniel Lakens](# &quot;Daniel Lakens&quot;) [](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="getting-started-with-rpact-cloud" class="level1">
<h1>Getting started with RPACT Cloud</h1>
<p>The best graphical user interface for <a href="https://cran.r-project.org/package=rpact">rpact</a> is available at <a href="https://rpact.cloud">rpact.cloud</a>. Upon loading the app, you will see the “Design” box where you can click on “Create new design”.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_0.png" class="img-fluid figure-img" width="481"></p>
<figcaption>Starting with a new design in RPACT Cloud.</figcaption>
</figure>
</div>
</div>
</div>
<p>The new design will be started, and opens with a new window. The default setting is for a fixed sample design, which means that there is only one look at the data (<code>1 (fixed sample)</code>). In other words, the default setting is not for a sequential design, but a traditional fixed design where the data is analyzed once.</p>
<p>Using the drop-down menu for the “Maximum number of stages” you can increase the number of looks in the design (you can select a maximum of up to 6 looks).</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_1.png" class="img-fluid figure-img" width="610"></p>
<figcaption>Screenshot of the default settings in the design tab of the scenario.</figcaption>
</figure>
</div>
</div>
</div>
<p>The <a href="https://cran.r-project.org/package=rpact">rpact</a> package focuses on Confirmatory Adaptive Clinical Trial Design and Analysis. In clinical trials, researchers mostly test directional predictions, and thus the default setting is to perform a one-sided test. Outside of clinical trials, it might be less common to design studies testing a directional prediction, but it is often a good idea. In clinical trials, it is common to use a significance level (or Type I error rate) <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> for one-sided tests, as it is deemed preferable in regulatory settings to set the Type I error rate for one-sided tests at half the conventional Type I error <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.05"> used in two-sided tests. In other fields, such as psychology, researchers typically use a <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.05"> significance level, regardless of whether they perform a one-sided or two-sided test. A default <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.2"> Type II error rate (or power of <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta%20=%200.8">) is common in many fields, and is thus the default setting for the Type II error rate in <a href="https://rpact.cloud">RPACT Cloud</a>.</p>
<p>Remember that you always need to justify your error rates – the defaults are most often not optimal choices in any real-life design (and it might be especially useful to choose a higher power, if possible).</p>
</section>
<section id="type-i-error-rate-control-in-sequential-designs" class="level1">
<h1>Type I error rate control in sequential designs</h1>
<p>We can explore a group sequential design by using the drop-down menu and select, say, 2 stages. The option to choose a design appears below in a new drop-down menu (“Inverse Normal”, “Group Sequential”, and “Fisher’s combination test”), which by default is set to an inverse normal design. Let’s select the group sequential design – this is the type of design we will focus on in this step by step tutorial. The other options are relevant for adaptive designs, which we will not discuss here.</p>
<p>Once a design with more than one stage has been specified, a new drop-down menu which asks you to specify the “Type of design” appears below the “Type II error rate” field. This allows you to choose how you want to control the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level across looks. By default, the choice is an O’Brien-Fleming design. Set the “Type of Design” option to “Pocock (P)”. Note there is also a Pocock type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending (asP) option – we will use that later.</p>
<p>Because most people in social sciences will probably have more experience with two-sided tests at an <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.05">, we will choose a two-sided test and an <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.05"> for demonstration purposes by altering the respective input fields. The input window should now look like the example below:</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_2.png" class="img-fluid figure-img" width="671"></p>
<figcaption>Screenshot of the updated settings in the design tab.</figcaption>
</figure>
</div>
</div>
</div>
<p>Have a look on the “Plot” widget on the right-hand side of the app. The default plot shows the cumulative Type I error rate across the stages. By clicking on the little gear or settings icon on the top right corner in the plot widget, you can change the type of plot. Let’s select “Plot type” to be “Boundaries [1]”.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_2a.png" class="img-fluid figure-img" width="435"></p>
<figcaption>Screenshot of the updated settings in the plot widget.</figcaption>
</figure>
</div>
</div>
</div>
<p>The critical <img src="https://latex.codecogs.com/png.latex?z"> score at each look is presented, as is a reference line at <img src="https://latex.codecogs.com/png.latex?z%20=%201.96"> and <img src="https://latex.codecogs.com/png.latex?z%20=%20-1.96">. These reference lines are the critical value for a two-sided test with a single look (i.e., a fixed design) with an <img src="https://latex.codecogs.com/png.latex?%5Calpha"> of 5%. We see that the boundaries on the <img src="https://latex.codecogs.com/png.latex?z"> scale are further away from 0 for the two-stage case compared to the fixed design. This means we need to observe a more extreme <img src="https://latex.codecogs.com/png.latex?z"> score at an analysis to reject <img src="https://latex.codecogs.com/png.latex?H_0">. Furthermore, we see that the critical boundaries are constant across both looks. This is exactly the goal of the Pocock correction: At each look, the same proportion of the overall <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level is spent, where this proportion is calculated in such a way that the overall <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level is controlled at the pre-specified number (here, 5%). It is conceptually very similar to the Bonferroni correction. We can reproduce the design and the plot in R using the following code:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb1-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb1-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>,</span>
<span id="cb1-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb1-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb1-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/index_files/figure-html/unnamed-chunk-1-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>In the drop-down menu in the “Design” widget on the left again, we can easily change the type of design from “Pocock (P)” to “O’Brien-Fleming (OF)” to see the effect of using different corrections for the critical values across looks in the plot. We see in the plot below that the O’Brien-Fleming correction has a different goal.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_2b.png" class="img-fluid figure-img" width="1262"></p>
<figcaption>Screenshot with O’Brien-Fleming boundaries.</figcaption>
</figure>
</div>
</div>
</div>
<p>The critical value at the first look is very high (which also means the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level for this look is very low), but the critical value at the final look is extremely close to the unadjusted critical value of 1.96 (or the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level of 0.05). In the code, this change is equally easily achieved by replacing <code>typeOfDesign = "P"</code> with <code>typeOfDesign = "OF"</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb2-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb2-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb2-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb2-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb2-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/index_files/figure-html/unnamed-chunk-2-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>To more clearly illustrate the differences between design types, we can plot the corrections for different types of designs for each of 3 looks (2 interim looks and one final look) in the same plot in R. The plot below shows the Pocock, O’Brien-Fleming, Haybittle-Peto, and Wang-Tsiatis correction with <img src="https://latex.codecogs.com/png.latex?%5CDelta%20=%200.25">. We see that researchers can choose different approaches to spend their <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level across looks. Researchers can choose to spend their <img src="https://latex.codecogs.com/png.latex?%5Calpha"> conservatively (keeping most of the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> for the last look), or more liberally (spending more <img src="https://latex.codecogs.com/png.latex?%5Calpha"> at the earlier looks, which increases the probability of stopping early for many true effect sizes). The comparison of multiple design types is facilitated by the <a href="https://cran.r-project.org/package=rpact">rpact</a> function <code>getDesignSet()</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Comparison corrections</span></span>
<span id="cb3-2">d1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb3-6">)</span>
<span id="cb3-7">d2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>,</span>
<span id="cb3-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb3-11">)</span>
<span id="cb3-12">d3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>,</span>
<span id="cb3-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>,</span>
<span id="cb3-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb3-17">)</span>
<span id="cb3-18">d4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"HP"</span>,</span>
<span id="cb3-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb3-22">)</span>
<span id="cb3-23"></span>
<span id="cb3-24"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignSet</span>(</span>
<span id="cb3-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">designs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(d1, d2, d3, d4),</span>
<span id="cb3-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">variedParameters =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typeOfDesign"</span></span>
<span id="cb3-27">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/index_files/figure-html/unnamed-chunk-3-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Because the statistical power of a test depends on the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level (and the effect size and the sample size), this means that at the final look the statistical power of an O’Brien-Fleming or Haybittle-Peto design is very similar to the statistical power for a fixed design with only one look. If the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> is lowered, the sample size of a study needs to be increased to maintain the same statistical power at the last look. Therefore, the Pocock correction requires a remarkably larger increase in the maximum sample size than the O’Brien-Fleming or Haybittle-Peto correction. We will discuss these issues in more detail when we consider sample size planning below.</p>
<p>If you head to the “Reporting” tab, you can download an easily readable summary of the main results. Here, you can also see the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level you would use for each look at the data (e.g., <img src="https://latex.codecogs.com/png.latex?p%20%3C%200.0052">, and <img src="https://latex.codecogs.com/png.latex?p%20%3C%200.0480"> for a O’Brien-Fleming type design with 2 looks): In the table, the row is called “Stage levels (two-sided)”.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_3.png" class="img-fluid figure-img" width="1260"></p>
<figcaption>Screenshot of the default settings in the ‘Reporting’ tab of RPACT Cloud.</figcaption>
</figure>
</div>
</div>
</div>
<p>Corrected <img src="https://latex.codecogs.com/png.latex?%5Calpha"> levels can be computed to many digits, but this quickly reaches a level of precision that is meaningless in real life. The observed type I error rate for all tests you will do in your lifetime is not noticeably different if you set the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level at 0.0194, 0.019, or 0.02 (see the concept of <a href="https://en.wikipedia.org/wiki/Significant_figures">significant digits</a>). Even as we calculate and use <img src="https://latex.codecogs.com/png.latex?%5Calpha"> thresholds up to many digits in sequential tests, the messiness of most research makes these <img src="https://latex.codecogs.com/png.latex?%5Calpha"> levels have <a href="https://en.wikipedia.org/wiki/False_precision">false precision</a>. Keep this in mind when interpreting your data.</p>
<p>Note that the <a href="https://rpact.cloud">RPACT Cloud</a> usefully shows the R code required to reproduce the output in both the “Reporting” and “Design Interim Stages” tabs.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_4.png" class="img-fluid figure-img" width="487"></p>
<figcaption>Screenshot of the R command required to reproduce the output taken from the ‘Design Interim Stages’ tab.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb4-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 2 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming design, two-sided overall significance level 5%, power 80%, undefined endpoint, inflation factor 1.0078, ASN H1 0.9022, ASN H01 0.9897, ASN H0 1.0052.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0052</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0052</td>
<td>0.0480</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.797</td>
<td>1.977</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.2096</td>
<td>0.8000</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="alpha-spending-functions" class="level1">
<h1>Alpha spending functions</h1>
<p>An important contribution to the sequential testing literature was made by Lan and DeMets (1983) who proposed the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function approach. In the figure below, the O’Brien-Fleming-like and Pocock-like <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions are plotted against the discrete O’Brien-Fleming and Pocock boundaries. We can see that the two approaches are not identical, but very comparable. The main benefit of these spending functions is that the error rate of the study can be controlled, while neither the number nor the timing of the looks needs to be specified in advance. This makes <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending approaches much more flexible. When using an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, it is important that the decision to perform an interim analysis is not based on collected data, as this can still increase the Type I error rate.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">d1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>,</span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb5-4">)</span>
<span id="cb5-5">d2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asP"</span>,</span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb5-8">)</span>
<span id="cb5-9">d3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb5-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb5-12">)</span>
<span id="cb5-13">d4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb5-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb5-16">)</span>
<span id="cb5-17"></span>
<span id="cb5-18"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignSet</span>(</span>
<span id="cb5-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">designs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(d1, d2, d3, d4),</span>
<span id="cb5-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">variedParameters =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typeOfDesign"</span></span>
<span id="cb5-21">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="updating-boundaries-during-a-study" class="level1">
<h1>Updating boundaries during a study</h1>
<p>Although <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions control the Type I error rate even when there are deviations from the pre-planned number of looks, or their timing, this does require recalculating the boundaries used in the statistical test based on the amount of information that has been observed. Let us assume a researcher designs a study with three equally spaced looks at the data (two interim looks, one final look), using a Pocock-type spending function, where results will be analyzed in a two-sided t-test with an overall desired Type I error rate of 0.05, and a desired power of 0.9 for a Cohen’s d of 0.5. An a-priori power analysis (which we will explain later in this tutorial) shows that we achieve the desired power in our sequential design if we plan to look after 65.4, 130.9, and 196.3 total observations. Since we cannot collect partial participants, we should round these numbers up, and because we have 2 independent groups, we will collect 66 observations for look 1 (33 in each condition), 132 at the second look (66 in each condition) and 198 at the third look (99 in each condition).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asP"</span>,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb6-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb6-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb6-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb6-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), two-sided overall significance level 5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.5, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0226</td>
<td>0.0382</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0226</td>
<td>0.0217</td>
<td>0.0217</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.279</td>
<td>2.295</td>
<td>2.296</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-0.578</td>
<td>-0.406</td>
<td>-0.330</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>0.578</td>
<td>0.406</td>
<td>0.330</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3940</td>
<td>0.7316</td>
<td>0.9000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>65.4</td>
<td>130.9</td>
<td>196.3</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>122.6</td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0226</td>
<td>0.0155</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.3940</td>
<td>0.3375</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>Now imagine that due to logistical issues, we do not manage to analyze the data until we have collected data from 76 observations (38 in each condition) instead of the planned 66 observations. So our first look at the data does not occur at 33.3% of planned sample, but at 76/198 = 38.4% of the planned sample. We can recalculate the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> level we should use for each look at the data, based on the current look, and planned future looks. Instead of using the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-levels 0.0226, 0.0217, and 0.0217 at the three respective looks (as indicated above in the summary of the originally planned design), we can adjust the information rates in <a href="https://rpact.cloud">RPACT Cloud</a>:</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_5.png" class="img-fluid figure-img" width="441"></p>
<figcaption>Screenshot of adapted information rates.</figcaption>
</figure>
</div>
</div>
</div>
<p>The updated <img src="https://latex.codecogs.com/png.latex?%5Calpha">-levels are 0.0253 for the current look, 0.0204 for the second look, and 0.0216 for the final look. To compute updated bounds in R directly, we can use the code:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asP"</span>,</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">76</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">198</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb7-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>Pocock type alpha spending design, two-sided overall significance level 5%, power 80%, undefined endpoint, inflation factor 1.1697, ASN H1 0.8167, ASN H01 1.0686, ASN H0 1.1464.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>38.4%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0253</td>
<td>0.0382</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0253</td>
<td>0.0204</td>
<td>0.0216</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.236</td>
<td>2.318</td>
<td>2.296</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3597</td>
<td>0.5999</td>
<td>0.8000</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>It is also possible to correct the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level if the final look at the data changes, for example because you are not able to collect the intended sample size, or because due to unforeseen circumstances you collect more data than planned. If this happens, we can no longer use the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function we chose, and instead have to provide a user-defined <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function by updating the timing and <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function to reflect the data collection as it actually occurred up to the final look.</p>
<p>Assuming the second look in our earlier example occurred as originally planned, but the last look occurred at 206 participants instead of 198 we can compute an updated <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level for the last look. Given the current total sample size, we need to recompute the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-levels for the earlier looks, which now occurred at 72/206 = 0.369, 132/206 = 0.641, and for the last look at 206/206 = 1.</p>
<p>Because the first and second look occurred with the adjusted <img src="https://latex.codecogs.com/png.latex?%5Calpha">-levels we computed after the first adjustment (<img src="https://latex.codecogs.com/png.latex?%5Calpha">-levels of 0.0253 and 0.0382) we can look at the “Cumulative alpha spent” row and see how much of our Type I error rate we spent so far (0.0253 and 0.0382). We also know we want to spend the remainder of our Type I error rate at the last look, for a total of 0.05.</p>
<p>Our actual <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function is no longer captured by the Pocock spending function after collecting more data than planned, but instead, we have a user defined spending function. We can enter both the updated information rates and the final <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function directly in <a href="https://rpact.cloud">RPACT Cloud</a> by selecting the “User defined alpha spending (asUser)” option as “Type of design”:</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_7a.png" class="img-fluid figure-img" width="245"></p>
<figcaption>Screenshot of a user defined alpha spending function.</figcaption>
</figure>
</div>
</div>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_7b.png" class="img-fluid figure-img" width="563"></p>
<figcaption>Screenshot of a user defined alpha spending function.</figcaption>
</figure>
</div>
</div>
</div>
<p>The output shows the computed <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level for this final look is 0.0208 instead of 0.0216. The difference is very small in this specific case, but might be larger depending on the situation. This example shows the flexibility of group sequential designs when <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions are used. We can also perform these calculations in R directly:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asUser"</span>,</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">72</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">206</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">132</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">206</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb8-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb8-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">userAlphaSpending =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0253</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0382</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb8-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>User defined alpha spending design (0.0253, 0.0382, 0.05), two-sided overall significance level 5%, power 80%, undefined endpoint, inflation factor 1.1833, ASN H1 0.8213, ASN H01 1.0795, ASN H0 1.1583.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>35%</td>
<td>64.1%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0253</td>
<td>0.0382</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0253</td>
<td>0.0199</td>
<td>0.0208</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.237</td>
<td>2.329</td>
<td>2.312</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3317</td>
<td>0.5826</td>
<td>0.8000</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="power-analysis-for-group-sequential-designs" class="level1">
<h1>Power analysis for group sequential designs</h1>
<p>To illustrate an analysis of the sample size/power, we will once again start with the default settings of <a href="https://rpact.cloud">RPACT Cloud</a> which is for a fixed design with one look. Click on the “Plan a Trial” tab to choose how you want to specify the desired endpoint in this study. We will assume we plan to perform a <img src="https://latex.codecogs.com/png.latex?t"> test, and therefore, that our endpoint is based on the means we observe.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_8.png" class="img-fluid figure-img" width="474"></p>
<figcaption>Screenshot of endpoint selection.</figcaption>
</figure>
</div>
</div>
</div>
<p>In the “Planning” area, you can specify if you want to calculate the required sample size (to achieve a desired power) or compute the expected power (based on a chosen sample size). For now, we will calculate the sample size required to reach a power of 80%, which is the default value in <a href="https://cran.r-project.org/package=rpact">rpact</a>. By default, the calculation will be for a two-group (independent) <img src="https://latex.codecogs.com/png.latex?t"> test.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_9.png" class="img-fluid figure-img" width="316"></p>
<figcaption>Screenshot of the input for a two-group design with an expected effect size of d = 0.5.</figcaption>
</figure>
</div>
</div>
</div>
<p>The same number of individuals are collected in each group (allocation ratio = 1). It is possible to choose to use a normal approximation (which some software programs use) but the default settings where the calculations are based on the <img src="https://latex.codecogs.com/png.latex?t"> distribution, will be (ever so slightly) more accurate.</p>
<p>The effect under the null hypothesis <img src="https://latex.codecogs.com/png.latex?H_0"> is 0 by default, the default effect under the alternative is 0.2, and the default standard deviation is 1. This means that by default the power analysis is for a standardized effect size of Cohen’s d = 0.2/1 = 0.2. That is a small effect. In this example, we will assume a researcher is interested in detecting a somewhat more substantial effect size, a mean difference of 0.5. This can be specified by changing the effect under the alternative to 0.5. Note that it is possible to compute the sample size or power for multiple values by selecting a value larger than 1 in the “# values” drop-down menu (but we will calculate power for a single alternative for now).</p>
<p>We can also directly perform these calculations in R. Here, for a fixed sample size design, the significance level and <code>sided = 2</code> can directly be used within the <code>getSampleSizeMeans()</code> function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb9-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.5, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-0.350</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>0.350</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>127.5</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>These calculations show that for a fixed design, we should collect 128 participants (64 in each condition) to achieve 80% power for a Cohen’s d of 0.5 (or a mean difference of 0.5 with an expected population standard deviation of 1) at a two-sided significance level of 5%.</p>
<p>This result is similar to what can be computed in power analysis software for non-sequential designs, such as G*power.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_11.png" class="img-fluid figure-img" width="600"></p>
<figcaption>Screenshot of the output of a power analysis in G*Power.</figcaption>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-sizes-and-power-across-looks" class="level1">
<h1>Sample sizes and power across looks</h1>
<p>We will now look at power in a sequential design. Change the slider for the number of looks (kMax) in the “Design” tab to 3. Furthermore, change the Type II error rate to 0.1 (a default of 0.2 is, regardless of what Cohen thought, really a bit large). By default, <a href="https://cran.r-project.org/package=rpact">rpact</a> assumes we will look at the data at equally spaced intervals – after 33%, 67%, and 100% of the data is collected. The default design is an O’Brien-Fleming design, with a one-sided test. Set the effect under the alternative hypothesis in the “Trial Settings” tab to 0.5. We can compute the sample size we would need for a group sequential design to achieve the desired error rates for a specified alternative using the <code>getSampleSizeMeans()</code> function in R.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">seq_design_OF <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb10-7">)</span>
<span id="cb10-8"></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compute the sample size we need</span></span>
<span id="cb10-10">power_res_OF <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> seq_design_OF <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb10-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb10-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb10-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb10-17">    )</span>
<span id="cb10-18"></span>
<span id="cb10-19">power_res_OF <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.5, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0015</td>
<td>0.0187</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0015</td>
<td>0.0181</td>
<td>0.0437</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.961</td>
<td>2.094</td>
<td>1.710</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.910</td>
<td>0.437</td>
<td>0.289</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.1055</td>
<td>0.6295</td>
<td>0.9000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>47.3</td>
<td>94.6</td>
<td>141.8</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>107.1</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0015</td>
<td>0.0172</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.1055</td>
<td>0.5240</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>The same output is available in <a href="https://rpact.cloud">RPACT Cloud</a> under the “Sample Size” tab.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_12_pow.png" class="img-fluid figure-img" width="780"></p>
<figcaption>Summary of power analysis for an O’Brien-Fleming design with 3 looks and a one-sided test with alpha = 0.05.</figcaption>
</figure>
</div>
</div>
</div>
<p>This output shows that at the first look, with a very strict <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level of 0.0015, we will have almost no power. Even if there is a true effect of d = 0.5, in only 10.55% of the studies we run will we be able to stop after 33% of the data has been collected (as we see in the row “Overall power” or “Cumulative Power”). One might wonder whether it would even be worth looking at the data at this time point (the answer might very well be ‘no’, and it is not necessary to design equally spaced looks). At the second look, overall power is 62.95%, which gives us a reasonable chance to stop if there is an effect, at the the final look it should be 90%, as this is what we designed the study to achieve. We can also print the full results (instead of just a summary), or select “Details” in <a href="https://rpact.cloud">RPACT Cloud</a>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">power_res_OF</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.333, 0.667, 1.000</li>
<li><em>Critical values</em>: 2.961, 2.094, 1.710</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.001533, 0.018739, 0.050000</li>
<li><em>Local one-sided significance levels</em>: 0.001533, 0.018138, 0.043669</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.1000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 0.5</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Standard deviation</em>: 1</li>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 141.8</li>
<li><em>Maximum number of subjects (1)</em>: 70.9</li>
<li><em>Maximum number of subjects (2)</em>: 70.9</li>
<li><em>Number of subjects [1]</em>: 47.3</li>
<li><em>Number of subjects [2]</em>: 94.6</li>
<li><em>Number of subjects [3]</em>: 141.8</li>
<li><em>Expected number of subjects under H0</em>: 140.9</li>
<li><em>Expected number of subjects under H0/H1</em>: 132</li>
<li><em>Expected number of subjects under H1</em>: 107.1</li>
<li><em>Reject per stage [1]</em>: 0.1055</li>
<li><em>Reject per stage [2]</em>: 0.5240</li>
<li><em>Reject per stage [3]</em>: 0.2705</li>
<li><em>Early stop</em>: 0.6295</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.910</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.437</li>
<li><em>Critical values (treatment effect scale) [3]</em>: 0.289</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>We see that the maximum number of subjects we would need to collect is 141.8, or rounded up, 142. The expected number of subjects under <img src="https://latex.codecogs.com/png.latex?H_0"> (when there is no true effect) is 140.9 - we will almost always collect data up to the third look, unless we make a Type I error and stop at the first two looks.</p>
<p>The expected number of subjects under <img src="https://latex.codecogs.com/png.latex?H_1"> (i.e., d = 0.5) is 107.1. If there is a true effect of d = 0.5, we will stop early in some studies, and therefore the average expected sample size is lower than the maximum.</p>
<p>We can plot the results across a range of possible effect sizes:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">sample_res_plot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> seq_design_OF <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb12-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb12-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb12-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb12-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">142</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rounded up</span></span>
<span id="cb12-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb12-9">    )</span>
<span id="cb12-10"></span>
<span id="cb12-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># code for plot (not run, we show an annotated version of this plot)</span></span>
<span id="cb12-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plot(sample_res_plot, type = 6, legendPosition = 6)</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_12.png" class="img-fluid figure-img" width="480"></p>
<figcaption>Plot of power and average expected sample size for an O’Brien-Fleming design with 3 looks.</figcaption>
</figure>
</div>
</div>
</div>
<p>To create this plot in <a href="https://rpact.cloud">RPACT Cloud</a>, you need to specify the design, in the endpoint tab select “Means”, and in the trial settings select “Power” as the calculation target, two groups, and for the number of values, select 20 from the drop-down menu. Specify the lower (i.e., 0) and upper (i.e., 1) value of the mean difference (given the standard deviation of 1, these values will also be Cohen’s d effect sizes). The maximum number of subjects is set to 142 (based on the power analysis we performed above). Go to the “Plot” tab and select the “Expacted Sample Size [6]” plot.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_12_shiny.png" class="img-fluid figure-img" width="780"></p>
<figcaption>Screenshot of power and average expected sample size for an O’Brien-Fleming design with 3 looks in RPACT Cloud.</figcaption>
</figure>
</div>
</div>
</div>
<p>You see that depending on the true effect size there is a decent probability of stopping early (green line) compared to at the final look (red line). Furthermore, the larger the effect size, the lower the Average sample size will be (blue line).</p>
<p>Without sequential analyses, we would collect 142 participants (the maximum sample size specified). But when the true effect size is large, we have a high probability to stop early, and the sample size that one needs to collect will on average (in the long run of doing many sequential designs) be lower.</p>
<p>After this general introduction to the benefits of group sequential designs to efficiently design well powered studies, we will look at more concrete examples of how to perform an a-priori power analysis for sequential designs.</p>
</section>
<section id="a-priori-power-analysis-in-sequential-designs" class="level1">
<h1>A-priori power analysis in sequential designs</h1>
<p>When designing a study where the goal is to test whether a specific effect can be statistically rejected, researchers often want to make sure their sample size is large enough to have sufficient power for an effect size of interest. This is done by performing an a-priori power analysis. Given a specified effect size, <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level, and desired power, an a-priori power analysis will indicate the number of observations that should be collected.</p>
<p>An informative study has a high probability of correctly concluding an effect is present when it is present, and absent when it is absent. An a-priori power analysis is used to choose a sample size to achieve desired Type I and Type II error rates, in the long run, given assumptions about the null and alternative model.</p>
<p>We will assume that we want to design a study that can detect a difference of 0.5, with an assumed standard deviation in the population of 1, which means the expected effect is a Cohen’s d of 0.5. If we plan to analyze our hypothesis in a one-sided <img src="https://latex.codecogs.com/png.latex?t"> test (given our directional prediction), set the overall <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level to 0.05, and want to achieve a Type II error probability of 0.1 (or a power of 0.9). Finally, we believe it is feasible to perform 2 interim analyses, and one final analysis (e.g., collect the data across three weeks, and we are willing to stop the data collection after any Friday). How many observations would we need?</p>
<p>The decision depends on the final factor we need to decide in a sequential design: the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function. We can choose an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function as we design our experiment, and compare different choices of a spending function. We will start by examining the sample size we need to collect if we choose an O’Brien-Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function.</p>
<!-- ```{r tut-13, echo = FALSE, fig.cap = "Screenshot of the output of a power analysis in G*Power."} -->
<!-- knitr::include_graphics("tut_images/tut_13.png", dpi = 120) -->
<!-- ``` -->
<p>On the “Endpoint” drop-down menu of <a href="https://rpact.cloud">RPACT Cloud</a>, we specify means. It is easy to plot power across a range of effect sizes in <a href="https://cran.r-project.org/package=rpact">rpact</a>, by selecting multiple values from the drop-down menu (i.e., 5). We set 0.3 and 0.7 as the lower and upper value, and keep the standard deviation at 1, so that we get the sample sizes for the range of Cohen’s d 0.3 to 0.7.</p>
<p>Sometimes you might have a clearly defined effect size to test against – such as a theoretically predicted effect size, or a smallest practically relevant effect size. Other times, you might primarily know the sample size you can achieve to collect, and you want to perform a sensitivity analysis, where you examine which effect size you can detect with a desired power, given a certain sample size. Plotting power across a range of effect sizes is typically useful. Even if you know which effect size you expect, you might want to look at what would be the consequences of the true effect size being slightly different than expected.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_14.png" class="img-fluid figure-img" width="291"></p>
<figcaption>Screenshot of trial settings tab in RPACT Cloud where power is plotted for a range of 5 effect sizes under the alternative hypothesis ranging from 0.3 to 0.7.</figcaption>
</figure>
</div>
</div>
</div>
<p>IN the “Plot” tab and from the drop-down menu select “Expected Sample size [6]”. You will see a plot like the one below, created with the R package. From the results (in the row “Maximum number of subjects”), we see that if the true effect size is indeed d = 0.5, we would need to collect at most 141 participants (the result differs very slightly from the power analysis reported above, as we use the O’Brien-Fleming alpha spending function, and not the O’Brien-Fleming correction). In the two rows below, we see that this is based on 71 (rounded up) participants in each condition, so in practice, we would actually collect a total of 142 participants due to upward rounding within each condition.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb13-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb13-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb13-8">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/index_files/figure-html/unnamed-chunk-16-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<hr>
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0007</td>
<td>0.0164</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0007</td>
<td>0.0161</td>
<td>0.0451</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.200</td>
<td>2.141</td>
<td>1.695</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.3</td>
<td>0.575</td>
<td>0.267</td>
<td>0.172</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.4</td>
<td>0.779</td>
<td>0.357</td>
<td>0.230</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.5</td>
<td>0.995</td>
<td>0.448</td>
<td>0.287</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.6</td>
<td>1.229</td>
<td>0.541</td>
<td>0.345</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.7</td>
<td>1.486</td>
<td>0.634</td>
<td>0.403</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0675</td>
<td>0.6077</td>
<td>0.9000</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.3</td>
<td>129.7</td>
<td>259.4</td>
<td>389.1</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.4</td>
<td>73.2</td>
<td>146.3</td>
<td>219.5</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.5</td>
<td>47.0</td>
<td>94.0</td>
<td>141.0</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.6</td>
<td>32.8</td>
<td>65.6</td>
<td>98.3</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.7</td>
<td>24.2</td>
<td>48.4</td>
<td>72.6</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.3</td>
<td></td>
<td></td>
<td>301.6</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>170.1</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.5</td>
<td></td>
<td></td>
<td>109.3</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>76.2</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.7</td>
<td></td>
<td></td>
<td>56.3</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0007</td>
<td>0.0157</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0675</td>
<td>0.5402</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
</div>
<p>This maximum is only slightly higher than if we had used a fixed design. For a fixed design (which you can examine by moving the slider for the maximum number of stages back to 1), we would need to collect 69.2 participants, or 138.4 in total, while for a sequential design, the maximum sample size per condition is 70.5.</p>
<p>The difference between a fixed design and a sequential design can be calculated by looking at the “Inflation factor”. We can find the inflation factor for the sequential design in the summary title which is 1.0187. In other words, the maximum sample size increased to 69.2 x 1.0187 = 70.5 per condition. The inflation is essentially caused by the reduction in the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level at the final look, and differs between designs (e.g., for a Pocock type alpha spending function, the inflation factor for the current design is larger, namely 1.1595).</p>
<p>However, the maximum sample size is not the expected sample size for this design, because of the possibility that we can stop data collection at an earlier look in the sequential design. In the long run, if d = 0.5, and we use an O’Brien-Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, and ignoring upward rounding because we can only collect a complete number of observations, we will sometimes collect 47 participants and stop after the first look (see the row “Number of subjects, alt. = 0.5”), sometimes 94 and stop after the second look, and sometimes 141 and stop after the last look.</p>
<p>As we see in the row “Exit probability for efficacy (under H1)”, we can stop early 6.75% of the time after look 1, 54.02% after look two, and in the remaining cases we will stop 1 - (0.0675 + 0.5402) = 39.23% of the time at the last look.</p>
<p>This means that, assuming there is a true effect of d = 0.5, the <em>expected</em> sample size on average is the probability of stopping at each look, multiplied by the number of observations we collect at each look, so 0.0675 * 47.0 + 0.5402 * 94.0 + ((1 - (0.0675 + 0.5402)) * 141.0) = 109.3, which matches the row “Expected number of subjects under H1, alt. = 0.5” (again, assuming the alternative hypothesis of d = 0.5 is correct). So, in any single study we might need to collect slightly more data than in a fixed design, but on average we will need to collect fewer observations in a sequential design, namely 109.3, instead of 138.4 in a fixed design (assuming the alternative hypothesis is true).</p>
<p>For a Pocock <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function the maximum sample size is larger (you can check by changing the spending function). The reason is that the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level at the final look is lower for a Pocock spending function than for the O’Brien-Fleming spending function, and the sample size required to achieve a desired power is thus higher. However, because the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level at the first look is higher, there is a higher probability of stopping early, and therefore the expected sample size is lower for a Pocock spending function (97.7 compared to 109.3). It is up to the researcher to choose a spending function, and weigh how desirable it would be to stop early, given some risk in any single study of increasing the sample size at the final look. For these specific design parameters, the Pocock <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function might be more efficient on average, but also more risky in any single study.</p>
</section>
<section id="stopping-for-futility" class="level1">
<h1>Stopping for futility</h1>
<p>So far, the sequential design would only stop at an interim analysis if we can reject <img src="https://latex.codecogs.com/png.latex?H_0">. It is also possible to stop for futility, for example, based on a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function. We can directly compare the previous design with a design where we allow stopping for futility. Just as we are willing to distribute our Type I error rate across interim analyses, we can distribute our Type II error rate across looks, and decide to stop for futility when we can reject the presence of an effect at least as large as 0.5, even if we may then be making a Type II error.</p>
<p>If there actually is no effect, such designs are more efficient. One can choose in advance to stop data collection when the presence of the effect the study was designed to detect can be rejected (i.e., binding <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending), but it is typically recommended to allow the possibility to continue data collection (i.e., non-binding <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending). Adding futility bounds based on <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending functions reduces power, and increases the required sample size to reach a desired power, but this is on average compensated by the fact that studies stop earlier due to futility, which can make designs more efficient.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_15.png" class="img-fluid figure-img" width="663"></p>
<figcaption>Screenshot of the rpact input for an beta-spending function.</figcaption>
</figure>
</div>
</div>
</div>
<p>When an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function is chosen in <a href="https://rpact.cloud">RPACT Cloud</a>, a new drop-drown menu appears that allows users to choose a beta-spending function. In the R package, we simply add <code>typeBetaSpending = "bsOF"</code> to the specification of the design. You do not need to choose the same spending approach for <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> as is done in this example.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span></span>
<span id="cb14-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.5, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0007</td>
<td>0.0164</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0044</td>
<td>0.0440</td>
<td>0.1000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0007</td>
<td>0.0161</td>
<td>0.0451</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>3.200</td>
<td>2.141</td>
<td>1.695</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>-0.873</td>
<td>0.751</td>
<td></td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.968</td>
<td>0.437</td>
<td>0.280</td>
</tr>
<tr class="even">
<td>Futility boundary (t)</td>
<td>-0.251</td>
<td>0.152</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0733</td>
<td>0.6308</td>
<td>0.9000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>49.4</td>
<td>98.8</td>
<td>148.2</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>111.0</td>
</tr>
<tr class="even">
<td>Overall exit probability (under H0)</td>
<td>0.1921</td>
<td>0.5998</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H1)</td>
<td>0.0777</td>
<td>0.5971</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0007</td>
<td>0.0157</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0733</td>
<td>0.5575</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H0)</td>
<td>0.1915</td>
<td>0.5841</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H1)</td>
<td>0.0044</td>
<td>0.0396</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>We see that with a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function, the Expected number of subjects under <img src="https://latex.codecogs.com/png.latex?H_1"> has increased from 109.3 to 111.0. The maximum number of subjects has increased from 141 to 148.2. So, if the alternative hypothesis is true, stopping for futility comes at a cost. However, it is possible that <img src="https://latex.codecogs.com/png.latex?H_0"> is true.</p>
<p>At the last look in our sequential design, which we designed to have 90% power, we are willing to act as if <img src="https://latex.codecogs.com/png.latex?H_0"> is true with a 10% error rate. We can reverse the null and alternative hypothesis, and view the same decision process as an equivalence test. In this view, we test whether we can reject the presence of a meaningful effect. For example, if our smallest effect size of interest is a mean difference of 0.5, and we observe a mean difference that is surprisingly far away from 0.5, we can reject the presence of an effect that is large enough to care about. In essence, in such an equivalence test, the Type II error of the original null hypothesis significance test has now become the Type I error rate. Because we have designed our null hypothesis significance test to have 90% power for a mean difference of 0.5, 10% of the time we would incorrectly decide to act as if an effect of at least 0.5 is absent. This is statistically comparable to performing an equivalence test with an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level of 10%, and decide to act as if we can reject the presence of an effect at least as large as 0.5, which should also happen 10% of the time, in the long run.</p>
<p>If we can reject the presence of a meaningful effect, whenever <img src="https://latex.codecogs.com/png.latex?H_0"> is true, at an earlier look, we would save resources when <img src="https://latex.codecogs.com/png.latex?H_0"> is true. We see that, in the previous example which did not allow for futility stopping, the expected number of subjects under <img src="https://latex.codecogs.com/png.latex?H_0"> was 140.2. In other words, when <img src="https://latex.codecogs.com/png.latex?H_0"> is true, we would continue to the last look most of the time (unless we made a Type 1 error at look 1 or 2). With a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function, the expected number of subjects under <img src="https://latex.codecogs.com/png.latex?H_0"> has decreased substantially, to 99.6 (= 0.1921 * 49.4 + 0.5998 <em> 98.8 + (1 - 0.1921 - 0.5998)</em>148.2, or see the print output). The choice of whether you want to use a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function depends on the goals of your study. If you believe there is a decent probability <img src="https://latex.codecogs.com/png.latex?H_0"> is true, and you would like to efficiently conclude this from the data, the use of a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending approach might be worth considering.</p>
</section>
<section id="reporting-the-results-of-a-sequential-analysis" class="level1">
<h1>Reporting the results of a sequential analysis</h1>
<p>A challenge when wanting to interpret the observed effect size is that whenever a study is stopped early when rejecting <img src="https://latex.codecogs.com/png.latex?H_0">, there is a risk that we stopped because, due to random variation, we happened to observe a large effect size at the time of the interim analysis. This means that the observed effect size at these interim analyses over-estimates the true effect.</p>
<p>A similar issue is at play when reporting <img src="https://latex.codecogs.com/png.latex?p">-values and confidence intervals. When a sequential design is used, the distribution of a <img src="https://latex.codecogs.com/png.latex?p">-value that does not account for the sequential nature of the design is no longer uniform when <img src="https://latex.codecogs.com/png.latex?H_0"> is true. A <img src="https://latex.codecogs.com/png.latex?p">-value is the probability of observing a result at least as extreme as the result that was observed, given that <img src="https://latex.codecogs.com/png.latex?H_0"> is true. It is no longer straightforward to determine what ‘at least as extreme’ means in a sequential design (Cook, 2002). It is possible to compute adjusted effect size estimates, confidence intervals, and <img src="https://latex.codecogs.com/png.latex?p">-values in <a href="https://cran.r-project.org/package=rpact">rpact</a>. This currently cannot be done in the <a href="https://rpact-cloud.share.connect.posit.cloud/">rpact cloud</a>.</p>
<p>Imagine we have performed a study planned to have at most 3 equally spaced looks at the data, where we perform a two-sided test with an <img src="https://latex.codecogs.com/png.latex?%5Calpha"> of 0.05, and we use a Pocock type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, and we observe mean differences between the two conditions of <img src="https://latex.codecogs.com/png.latex?%5CDelta%20M%20=%200.59">, 95% CI <img src="https://latex.codecogs.com/png.latex?%5B0.04,%201.13%5D">, <img src="https://latex.codecogs.com/png.latex?t(64)%20=%202.16">, <img src="https://latex.codecogs.com/png.latex?p%20=%200.034"> at stage 1, <img src="https://latex.codecogs.com/png.latex?%5CDelta%20M%20=%200.39">, 95% CI <img src="https://latex.codecogs.com/png.latex?%5B0.00,%200.78%5D">, <img src="https://latex.codecogs.com/png.latex?t(130)%20=%201.98">, <img src="https://latex.codecogs.com/png.latex?p%20=%200.049"> at stage 2, and <img src="https://latex.codecogs.com/png.latex?%5CDelta%20M%20=%200.47">, 95% CI <img src="https://latex.codecogs.com/png.latex?%5B0.15,%200.79%5D">, <img src="https://latex.codecogs.com/png.latex?t(196)%20=%202.92">, <img src="https://latex.codecogs.com/png.latex?p%20=%200.004"> at the last look. Based on a Pocock-like <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function with three equally spaced looks the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level at each look for a two-sided <img src="https://latex.codecogs.com/png.latex?t"> test is 0.02264, 0.02174, and 0.02168. We can thus reject <img src="https://latex.codecogs.com/png.latex?H_0"> after look 3. But we would also like to report an effect size, and adjusted <img src="https://latex.codecogs.com/png.latex?p">-values and confidence intervals.</p>
<p>The first step is to create a dataset with the results at each look, consisting of the sample sizes, means, and standard deviations. Note that these are the sample sizes, means, and standard deviations only based on the data at each stage. In other words, we compute the means and standard deviations of later looks by excluding the data in earlier looks, so every mean and standard deviation in this example is based on 33 observations in each condition.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">data_means <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>),</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6067868</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2795294</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7132186</span>),</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01976029</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08212538</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08982903</span>),</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.135266</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35426</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.013671</span>),</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.068052</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9610714</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.225192</span>)</span>
<span id="cb15-8">)</span>
<span id="cb15-9">data_means <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of means</strong></p>
<p>The dataset contains the sample sizes, means, and standard deviations of one treatment and one control group. The total number of looks is three; stage-wise and cumulative data are included.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>2</th>
<th>2</th>
<th>3</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>1</td>
<td>2</td>
<td>1</td>
<td>2</td>
</tr>
<tr class="even">
<td>Stage-wise sample size</td>
<td>33</td>
<td>33</td>
<td>33</td>
<td>33</td>
<td>33</td>
<td>33</td>
</tr>
<tr class="odd">
<td>Cumulative sample size</td>
<td>33</td>
<td>33</td>
<td>66</td>
<td>66</td>
<td>99</td>
<td>99</td>
</tr>
<tr class="even">
<td>Stage-wise mean</td>
<td>0.607</td>
<td>0.020</td>
<td>0.280</td>
<td>0.082</td>
<td>0.713</td>
<td>0.090</td>
</tr>
<tr class="odd">
<td>Cumulative mean</td>
<td>0.607</td>
<td>0.020</td>
<td>0.443</td>
<td>0.051</td>
<td>0.533</td>
<td>0.064</td>
</tr>
<tr class="even">
<td>Stage-wise standard deviation</td>
<td>1.135</td>
<td>1.068</td>
<td>1.354</td>
<td>0.961</td>
<td>1.014</td>
<td>1.225</td>
</tr>
<tr class="odd">
<td>Cumulative standard deviation</td>
<td>1.135</td>
<td>1.068</td>
<td>1.251</td>
<td>1.009</td>
<td>1.179</td>
<td>1.079</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We then take our design:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">seq_design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb16-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb16-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asP"</span>,</span>
<span id="cb16-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb16-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb16-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb16-7">)</span></code></pre></div></div>
</div>
<p>and compute the results based on the data we entered:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">res <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> seq_design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb17-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">equalVariances =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb17-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> data_means</span>
<span id="cb17-5">    )</span></code></pre></div></div>
</div>
<p>We can then print a summary of the results:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">res <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), two-sided overall significance level 5%. The results were calculated using a two-sample t-test, unequal variances option. H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) != 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0226</td>
<td>0.0382</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0226</td>
<td>0.0217</td>
<td>0.0217</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.279</td>
<td>2.295</td>
<td>2.296</td>
</tr>
<tr class="odd">
<td>Cumulative effect size</td>
<td>0.587</td>
<td>0.392</td>
<td>0.469</td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation</td>
<td>1.102</td>
<td>1.136</td>
<td>1.130</td>
</tr>
<tr class="odd">
<td>Overall test statistic</td>
<td>2.163</td>
<td>1.983</td>
<td>2.921</td>
</tr>
<tr class="even">
<td>Overall p-value</td>
<td>0.0171</td>
<td>0.0248</td>
<td>0.0019</td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject</td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.1706</td>
<td>0.1151</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval</td>
<td>[-0.047; 1.221]</td>
<td>[-0.067; 0.852]</td>
<td>[0.097; 0.841]</td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.0757</td>
<td>0.1067</td>
<td>0.0105</td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0393</td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>[0.022; 0.743]</td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>0.403</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The results show that the action after look 1 and 2 was to continue data collection, and that we could reject <img src="https://latex.codecogs.com/png.latex?H_0"> at the third look. The unadjusted mean difference is provided in the row “Cumulative effect size” and at the final look this was 0.469. The adjusted mean difference is provided in the row “Median unbiased estimate” and is lower, and the adjusted confidence interval is in the row “Final confidence interval”, giving the result 0.403, 95% CI [0.022, 0.743].</p>
<p>The unadjusted <img src="https://latex.codecogs.com/png.latex?p">-values for a one-sided tests are reported in the row “Overall p-value”. The actual <img src="https://latex.codecogs.com/png.latex?p">-values for our two-sided test would be twice as large, so 0.0342596, 0.0495679, 0.0038994. The adjusted <img src="https://latex.codecogs.com/png.latex?p">-value at the final look is provided in the row “Final p-value” and it is 0.03928.</p>
</section>
<section id="conditional-power-analysis" class="level1">
<h1>Conditional power analysis</h1>
<p>The probability of finding a significant result, given the data that have been observed up to an interim analysis, is called <em>conditional power</em>. This approach can be useful in adaptive designs - designs where the final sample size is updated based on an early look at the data. In <em>blinded</em> sample size recalculation, no effect size is calculated at an earlier look, but other aspects of the design, such as the standard deviation, are updated. In an <em>unblinded</em> sample size recalculation, the effect size estimate at an early look is used to determine the final sample size.</p>
<p>Let us imagine that we perform a sequential design using a Pocock <img src="https://latex.codecogs.com/png.latex?%5Calpha">- and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">seq_design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb19-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb19-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb19-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb19-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asP"</span>,</span>
<span id="cb19-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsP"</span>,</span>
<span id="cb19-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb19-8">)</span></code></pre></div></div>
</div>
<p>We perform an a-priori power analysis based on a smallest effect size of interest of d = 0.38, which yields a maximum number of subjects of 330.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">seq_design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb20-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb20-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.38</span>,</span>
<span id="cb20-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb20-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb20-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb20-8">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 5%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 0.38, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0226</td>
<td>0.0382</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0453</td>
<td>0.0763</td>
<td>0.1000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0226</td>
<td>0.0231</td>
<td>0.0238</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>2.002</td>
<td>1.994</td>
<td>1.980</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>0.293</td>
<td>1.175</td>
<td></td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.387</td>
<td>0.271</td>
<td>0.219</td>
</tr>
<tr class="even">
<td>Futility boundary (t)</td>
<td>0.056</td>
<td>0.159</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.4933</td>
<td>0.8045</td>
<td>0.9000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>109.8</td>
<td>219.6</td>
<td>329.4</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>173.5</td>
</tr>
<tr class="even">
<td>Overall exit probability (under H0)</td>
<td>0.6378</td>
<td>0.2888</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H1)</td>
<td>0.5386</td>
<td>0.3422</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0226</td>
<td>0.0148</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.4933</td>
<td>0.3112</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H0)</td>
<td>0.6152</td>
<td>0.2740</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H1)</td>
<td>0.0453</td>
<td>0.0311</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>We first looked at the data after we collected 110 observations. At this time, we observed a mean difference of 0.1. Let us say we assume the population standard deviation is 1, and that we are willing to collect 330 observations in total, as this gave us 90% power for the effect we wanted to detect, a mean difference of 0.38. Given the effect size we observed, which is smaller than our smallest effect size of interest, what is the probability we will find a significant effect if we continue? We create a dataset:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">data_means <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb21-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span>),</span>
<span id="cb21-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span>),</span>
<span id="cb21-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for directional test, means 1 &gt; means 2</span></span>
<span id="cb21-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb21-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb21-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb21-8">)</span></code></pre></div></div>
</div>
<p>and calculate the results to be used in the <code>getConditionalPower()</code> function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">stage_res <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> seq_design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getStageResults</span>(</span>
<span id="cb22-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">equalVariances =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb22-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> data_means</span>
<span id="cb22-5">    )</span></code></pre></div></div>
</div>
<p>We can now perform a conditional power analysis based on the data we have observed so far. An important question is which effect size should be entered. Irrespective of the effect size we expected when designing the study, we have observed an effect of d = 0.1, and the smallest effect size of interest was a d = 0.38. We can compute the power under the assumption that the true effect size is d = 0.1 and d = 0.38:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compute conditional power after the first look</span></span>
<span id="cb23-2">stage_res <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getConditionalPower</span>(</span>
<span id="cb23-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The sample size planned for the subsequent stages.</span></span>
<span id="cb23-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alternative effect</span></span>
<span id="cb23-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># standard deviation</span></span>
<span id="cb23-7">    )</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Conditional power results means</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned sample size</em>: NA, 110, 110</li>
<li><em>Assumed effect under alternative</em>: 0.1</li>
<li><em>Assumed standard deviation</em>: 1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Conditional power</em>: NA, 0.0382, 0.0904</li>
</ul>
</div>
</div>
<p>If the true effect size is 0.1, the power is 0.09 at the final look. Under this assumption, there is little use in continuing the data collection. Under the assumption that the smallest effect size of interest would be true:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Compute conditional power after the first look</span></span>
<span id="cb24-2">stage_res <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getConditionalPower</span>(</span>
<span id="cb24-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The sample size planned for the subsequent stages.</span></span>
<span id="cb24-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.38</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alternative effect</span></span>
<span id="cb24-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># standard deviation</span></span>
<span id="cb24-7">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Conditional power results means</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned sample size</em>: NA, 110, 110</li>
<li><em>Assumed effect under alternative</em>: 0.38</li>
<li><em>Assumed standard deviation</em>: 1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Conditional power</em>: NA, 0.3805, 0.7126</li>
</ul>
</div>
</div>
<p>Under the assumption that the smallest effect size of interest exists, there is a reasonable probability of still observing a significant result at the last look (71.26%).</p>
</section>
<section id="preregistration-and-downloading-a-report" class="level1">
<h1>Preregistration and downloading a report</h1>
<p>Because of the flexibility in choosing the number of looks, and the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, it is important to preregister your statistical analysis plan. Preregistration allows other researchers to evaluate the severity of a test – how likely were you to find an effect if it is there, and how likely were you to not find an effect if there was no effect. Flexibility in the data analysis increases the Type 1 error rate, or the probability of finding an effect if there actually isn’t any effect (i.e., a false positive), and preregistering your sequential analysis plan can reveal to future readers that you severely tested your prediction.</p>
<p>The use of sequential analyses gives researchers more flexibility. To make sure this flexibility is not abused, the planned experimental design should be preregistered. The easiest way to do this is by either adding the <a href="https://cran.r-project.org/package=rpact">rpact</a> R code, or when the <a href="https://rpact.cloud">RPACT Cloud</a> is used, to use the export function and store the planned design as a PDF, <a href="https://rmarkdown.rstudio.com">R Markdown</a>, or R file.</p>
<div class="cell">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/tut_images/tut_16.png" class="img-fluid figure-img" width="326"></p>
<figcaption>Screenshot of the option in rpact to export a report of the design.</figcaption>
</figure>
</div>
</div>
</div>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Getting started</category>
  <guid>https://www.rpact.org/vignettes/getting-started/rpact_step-by-step_tutorial/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_21.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Defining Group Sequential Boundaries with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_boundary_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>In <a href="https://cran.r-project.org/package=rpact">rpact</a>, <strong>sample size calculation for a group sequential trial proceeds by following the same two steps regardless of whether the endpoint is a continuous, binary, or a time-to-event endpoint</strong>:</p>
<ol type="1">
<li><strong>Define the (abstract) group sequential boundaries</strong> of the design using the function <code>getDesignGroupSequential()</code>.</li>
<li><strong>Calculate sample size for the endpoint of interest</strong> by feeding the abstract boundaries from step 1 into specific functions for the endpoint of interest. This step uses functions such as <code>getSampleSizeMeans()</code> (for continuous endpoints), <code>getSampleSizeRates()</code> (for binary endpoints), and <code>getSampleSizeSurvival()</code> (for survival endpoints).</li>
</ol>
<p>The mathematical rationale for this two-step approach is that all group sequential trials, regardless of the chosen endpoint type, rely on the fact that the <img src="https://latex.codecogs.com/png.latex?z">-scores at different interim stages follow the same “canonical joint multivariate distribution” (at least asymptotically).</p>
<p>This document covers the more abstract first step, <strong>step 2 is not covered in this document but it is covered in the separate endpoint-specific R Markdown files for continuous, binary, and time-to-event endpoints.</strong> Of note, step 1 can be omitted for trials without interim analyses.</p>
<p>These examples are not intended to replace the official <a href="https://cran.r-project.org/package=rpact">rpact</a> documentation and help pages but rather to supplement them.</p>
<p>In general, <a href="https://cran.r-project.org/package=rpact">rpact</a> supports both one-sided and two-sided group sequential designs. If futility boundaries are specified, however, only one-sided tests are permitted. <strong>For simplicity, it is often preferred to use one-sided tests for group sequential designs</strong> (typically, with <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">).</p>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="designs-with-efficacy-interim-analyses" class="level1">
<h1>Designs with efficacy interim analyses</h1>
<section id="obrien-fleming-type-alpha-spending" class="level2">
<h2 class="anchored" data-anchor-id="obrien-fleming-type-alpha-spending">O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending</h2>
<p><strong>Example:</strong></p>
<ul>
<li>Interim analyses at information fractions 33%, 67%, and 100% ( <code>informationRates = c(0.33, 0.67, 1)</code> ). [Note: For equally spaced interim analyses, one can also specify the maximum number of stages (<code>kMax</code>, including the final analysis) instead of the <code>informationRates</code>.]</li>
<li>Lan &amp; DeMets <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending approximation to the O’Brien &amp; Fleming boundaries (<code>typeOfDesign = "asOF"</code>)</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending approaches allow for flexible timing of interim analyses and corresponding adjustment of boundaries.</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb3-6">)</span></code></pre></div></div>
</div>
</section>
<section id="standard-obrien-fleming-boundaries" class="level2">
<h2 class="anchored" data-anchor-id="standard-obrien-fleming-boundaries">Standard O’Brien &amp; Fleming boundaries</h2>
<p>The originally published O’Brien &amp; Fleming boundaries are obtained via <code>typeOfDesign = "OF"</code> which is also the default (therefore, if you do not specify <code>typeOfDesign</code>, this type is selected). Note that strict Type I error control is only guaranteed for standard boundaries without <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending if the pre-defined interim schedule (i.e., the information fractions at which interim analyses are conducted) is exactly adhered to.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span></span>
<span id="cb4-6">)</span></code></pre></div></div>
</div>
</section>
<section id="standard-pocock-and-haybittle-peto-boundaries" class="level2">
<h2 class="anchored" data-anchor-id="standard-pocock-and-haybittle-peto-boundaries">Standard Pocock and Haybittle &amp; Peto boundaries</h2>
<p>Pocock (<code>typeOfDesign = "P"</code> for constant boundaries over the stages, <code>typeOfDesign = "asP"</code> for corresponding <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending version) or Haybittle &amp; Peto (<code>typeOfDesign = "HP"</code>) boundaries (reject at interim if <img src="https://latex.codecogs.com/png.latex?z">-value exceeds 3) are obtained with, for example,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span></span>
<span id="cb5-6">)</span></code></pre></div></div>
</div>
</section>
<section id="other-pre-defined-boundaries" class="level2">
<h2 class="anchored" data-anchor-id="other-pre-defined-boundaries">Other pre-defined boundaries</h2>
<ul>
<li>Kim &amp; DeMets <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending (<code>typeOfDesign = "asKD"</code>) with parameter <code>gammaA</code> (power function: <code>gammaA = 1</code> is linear spending, <code>gammaA = 2</code> quadratic)</li>
<li>Hwang, Shi &amp; DeCani <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending (<code>typeOfDesign = "asHSD"</code>) with parameter <code>gammaA</code> (for details, see Wassmer &amp; Brannath 2016, p.&nbsp;76)</li>
<li>Standard Wang &amp; Tsiatis Delta classes (<code>typeOfDesign = "WT"</code> with parameter <code>deltaWT</code>, see Wassmer &amp; Brannath 2016, p.&nbsp;36) and the optimum within the Wang &amp; Tsiatis class (<code>typeOfDesign = "WToptimum"</code>)</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Quadratic Kim &amp; DeMets alpha-spending</span></span>
<span id="cb6-2">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>, </span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb6-8">)</span></code></pre></div></div>
</div>
</section>
<section id="user-defined-alpha-spending-functions" class="level2">
<h2 class="anchored" data-anchor-id="user-defined-alpha-spending-functions">User-defined <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions</h2>
<p>User-defined <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions (<code>typeOfDesign = "asUser"</code>) can be obtained via the argument <code>userAlphaSpending</code> which must contain a numeric vector with elements <img src="https://latex.codecogs.com/png.latex?0%3C%20%5Calpha_1%20%3C%20%5Cldots%20%3C%20%5Calpha_%7BkMax%7D%20=%20%5Calpha"> that define the values of the cumulative alpha-spending function at each interim analysis.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: User-defined alpha-spending function which is very conservative at</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first interim (spend alpha = 0.001), conservative at second (spend an additional</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alpha = 0.01, i.e., total cumulative alpha spent is 0.011 up to second interim),</span></span>
<span id="cb7-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and spends the remaining alpha at the final analysis (i.e., cumulative</span></span>
<span id="cb7-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alpha = 0.025)</span></span>
<span id="cb7-6">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb7-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asUser"</span>,</span>
<span id="cb7-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">userAlphaSpending =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>)</span>
<span id="cb7-12">)</span>
<span id="cb7-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># $stageLevels below extract local significance levels across interim analyses.</span></span>
<span id="cb7-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Note that the local significance level is exactly 0.001 at the first</span></span>
<span id="cb7-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interim, but slightly &gt;0.01 at the second interim because the design</span></span>
<span id="cb7-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exploits correlations between interim analyses.</span></span>
<span id="cb7-17">design<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.00100000 0.01052883 0.02004781</code></pre>
</div>
</div>
</section>
</section>
<section id="designs-with-efficacy-and-futility-interim-analyses" class="level1">
<h1>Designs with efficacy and futility interim analyses</h1>
<section id="futility-boundaries-at-interims-manually-defined-on-z-scale" class="level2">
<h2 class="anchored" data-anchor-id="futility-boundaries-at-interims-manually-defined-on-z-scale">Futility boundaries at interims manually defined on <img src="https://latex.codecogs.com/png.latex?z">-scale</h2>
<ul>
<li>The argument <code>futilityBounds</code> contains a vector of futility bounds (on the <img src="https://latex.codecogs.com/png.latex?z">-value scale) for each interim (but not the final analysis).</li>
<li>A futility bound of <img src="https://latex.codecogs.com/png.latex?z%20=%200"> corresponds to an estimated treatment effect of zero or “null”, i.e., in this case futility stopping is recommended if the treatment effect estimate at the interim analysis is zero or “goes in the wrong direction”. Futility bounds of <img src="https://latex.codecogs.com/png.latex?z%20=%20-%5Cinfty"> (which are numerically equivalent to <img src="https://latex.codecogs.com/png.latex?z%20=%20-6">) correspond to no futility stopping at an interim.</li>
<li>Due to the design of <a href="https://cran.r-project.org/package=rpact">rpact</a>, it is not possible to directly define futility boundaries on the treatment effect scale. If this is desired, one would need to manually convert the treatment effect scale to the <img src="https://latex.codecogs.com/png.latex?z">-scale or, alternatively, experiment by varying the boundaries on the <img src="https://latex.codecogs.com/png.latex?z">-scale until this implies the targeted critical values on the treatment effect scale. (Critical values on treatment effect scales are routinely provided by sample size functions for different endpoint types such as <code>getSampleSizeMeans()</code> (for continuous endpoints), <code>getSampleSizeRates()</code> (for binary endpoints), and <code>getSampleSizeSurvival()</code> (for survival endpoints). Please see the R Markdown files for these endpoint types for further details.)</li>
<li>By default, all futility boundaries are non-binding (<code>bindingFutility = FALSE</code>). Binding futility boundaries (<code>bindingFutility = TRUE</code>) are not recommended although they are provided for the sake of completeness.</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: non-binding futility boundary at each interim in case</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># estimated treatment effect is null or goes in "the wrong direction"</span></span>
<span id="cb9-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), </span>
<span id="cb9-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb9-10">)</span></code></pre></div></div>
</div>
</section>
<section id="formal-beta-spending-and-pampallona-tsiatis-approach" class="level2">
<h2 class="anchored" data-anchor-id="formal-beta-spending-and-pampallona-tsiatis-approach">Formal <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending and Pampallona &amp; Tsiatis approach</h2>
<p>Formal <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending functions are defined in the same way as <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions, e.g., a Pocock type <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending can be specified as <code>typeBetaSpending = "bsP"</code> and <code>beta</code> needs to be specified, the default is <code>beta = 0.20</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: beta-spending function approach with O'Brien &amp; Fleming alpha-spending</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># function and Pocock beta-spending function</span></span>
<span id="cb10-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsP"</span></span>
<span id="cb10-9">)</span></code></pre></div></div>
</div>
<p>Another way to formally derive futility bounds is through the Pampallona and Tsiatis approach. This is through defining <code>typeBetaSpending = "PT"</code>, and the specification of two parameters, <code>deltaPT1</code> (shape of decision regions for rejecting the null) and <code>deltaPT0</code> (shape of shifted decision regions for rejecting the alternative), for example</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: beta-spending function approach with O'Brien &amp; Fleming boundaries for</span></span>
<span id="cb11-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rejecting the null and Pocock boundaries for rejecting H1</span></span>
<span id="cb11-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PT"</span>,</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaPT1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaPT0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb11-10">)</span></code></pre></div></div>
</div>
<p>Note that both the <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending as well as the Pampallona &amp; Tsiatis approach can be selected to be one-sided or two-sided and the bounds for rejecting the alternative can be chosen as binding (<code>bindingFutility = TRUE</code>) or non-binding (<code>bindingFutility = FALSE</code>).</p>
</section>
</section>
<section id="designs-with-futility-interim-analyses-only" class="level1">
<h1>Designs with futility interim analyses only</h1>
<p>Designs which only use interim analyses for potential futility stopping can be implemented by using a user-defined <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function which spends all of the Type I error at the final analysis. Note that such designs do not allow stopping for efficacy regardless how persuasive the effect is.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: non-binding futility boundary using an O'Brien &amp; Fleming type</span></span>
<span id="cb12-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># beta spending function. No early stopping for efficacy (i.e., all alpha</span></span>
<span id="cb12-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is spent at the final analysis).</span></span>
<span id="cb12-4">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asUser"</span>,</span>
<span id="cb12-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">userAlphaSpending =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>), </span>
<span id="cb12-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span>,</span>
<span id="cb12-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb12-12">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Changed type of design to 'noEarlyEfficacy'</code></pre>
</div>
</div>
<p>As indicated by the note, you can alternatively specify <code>typeOfDesign = "noEarlyEfficacy"</code> which is a shortcut for <code>typeOfDesign = "asUser"</code> and <code>userAlphaSpending = c(0, 0, 0.025)</code>.</p>
</section>
<section id="interpreting-accessing-and-printing-rpact-boundary-objects" class="level1">
<h1>Interpreting, accessing and printing rpact boundary objects</h1>
<p>We use the design with an O’Brien &amp; Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function and prespecified futility bounds:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb14-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb14-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), </span>
<span id="cb14-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb14-9">)</span></code></pre></div></div>
</div>
<section id="information-contained-in-the-design-object" class="level2">
<h2 class="anchored" data-anchor-id="information-contained-in-the-design-object">Information contained in the <code>design</code> object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">design</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: O’Brien &amp; Fleming type alpha spending</li>
<li><em>Information rates</em>: 0.330, 0.670, 1.000</li>
<li><em>Futility bounds (non-binding)</em>: 0.000, 0.000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Stages</em>: 1, 2, 3</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
<li><em>Type of beta spending</em>: none</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 3</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.00009549, 0.00617560, 0.02500000</li>
<li><em>Critical values</em>: 3.731, 2.504, 1.994</li>
<li><em>Stage levels (one-sided)</em>: 0.00009549, 0.00614213, 0.02309189</li>
</ul>
</div>
</div>
<p>The key information of the design is contained in the object, including <strong>critical values on the <img src="https://latex.codecogs.com/png.latex?z">-scale</strong> (“Critical values” in <a href="https://cran.r-project.org/package=rpact">rpact</a> output, <code>design$criticalValues</code>) and <strong>one-sided local significance levels</strong> (“Stage levels” in <a href="https://cran.r-project.org/package=rpact">rpact</a> output, <code>design$stageLevels</code>). Note that the local significance levels are always given as one-sided levels in <a href="https://cran.r-project.org/package=rpact">rpact</a> even if a two-sided design is specified.</p>
<p><code>names(design)</code> (or, alternatively, using the pipe operator: <code>design |&gt; names()</code>) provides names of all objects included in the <code>design</code> object and <code>as.data.frame(design)</code> collects all design information into one data frame. <code>summary(design)</code> gives a slightly more detailed output. For more details about applying R generics to <a href="https://cran.r-project.org/package=rpact">rpact</a> objects, please refer to the separate R Markdown file <a href="https://rpact.com/vignettes/rpact_generic_functions">How to use R generics with rpact</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] "kMax"                   "alpha"                  "stages"                
 [4] "informationRates"       "userAlphaSpending"      "criticalValues"        
 [7] "stageLevels"            "alphaSpent"             "bindingFutility"       
[10] "directionUpper"         "tolerance"              "typeOfDesign"          
[13] "beta"                   "deltaWT"                "deltaPT1"              
[16] "deltaPT0"               "futilityBounds"         "gammaA"                
[19] "gammaB"                 "optimizationCriterion"  "sided"                 
[22] "betaSpent"              "typeBetaSpending"       "userBetaSpending"      
[25] "efficacyStops"          "futilityStops"          "power"                 
[28] "twoSidedPower"          "constantBoundsHP"       "betaAdjustment"        
[31] "delayedInformation"     "decisionCriticalValues" "reversalProbabilities" </code></pre>
</div>
</div>
<p><code>summary()</code> creates a nice presentation of the design that also contains information about the sample size of the design (see below):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming type alpha spending design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0605, ASN H1 0.8628, ASN H01 0.8689, ASN H0 0.6589.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33%</td>
<td>67%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0062</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0061</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.731</td>
<td>2.504</td>
<td>1.994</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0191</td>
<td>0.4430</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.049</td>
<td>0.003</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="stopping-probabilities-and-expected-sample-size-reduction" class="level2">
<h2 class="anchored" data-anchor-id="stopping-probabilities-and-expected-sample-size-reduction">Stopping probabilities and expected sample size reduction</h2>
<p><code>getDesignCharacteristics(design)</code> provides more detailed information about the design:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">designChar <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>()</span>
<span id="cb19-2">designChar</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Group sequential design characteristics</strong></p>
<ul>
<li><em>Number of subjects fixed</em>: 7.8489</li>
<li><em>Shift</em>: 8.3241</li>
<li><em>Inflation factor</em>: 1.0605</li>
<li><em>Informations</em>: 2.747, 5.577, 8.324</li>
<li><em>Power</em>: 0.01907, 0.44296, 0.80000</li>
<li><em>Rejection probabilities under H1</em>: 0.01907, 0.42389, 0.35704</li>
<li><em>Futility probabilities under H1</em>: 0.048720, 0.003437</li>
<li><em>Ratio expected vs fixed sample size under H1</em>: 0.8628</li>
<li><em>Ratio expected vs fixed sample size under a value between H0 and H1</em>: 0.8689</li>
<li><em>Ratio expected vs fixed sample size under H0</em>: 0.6589</li>
<li><em>%.probs% [1]</em>: 0.049, 0.003, 0.00000000000000116912549753808</li>
<li><em>%.probs% [2]</em>: 0.981, 0.508, 0.148</li>
<li><em>%.probs% [3]</em>: 1, 0.932, 0.505</li>
</ul>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">designChar <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] "nFixed"                 "shift"                  "inflationFactor"       
 [4] "stages"                 "information"            "power"                 
 [7] "rejectionProbabilities" "futilityProbabilities"  "averageSampleNumber1"  
[10] "averageSampleNumber01"  "averageSampleNumber0"  </code></pre>
</div>
</div>
<p><strong>Note that the design characteristics depend on beta that needs to be specified in <code>getDesignGroupSequential()</code>. By default, <code>beta = 0.20</code>.</strong></p>
<p>Explanations regarding the output:</p>
<ul>
<li><strong>Maximum sample size inflation factor</strong> (<code>$inflationFactor</code>): This is the maximal sample size a group sequential trial requires relative to the sample size of a fixed design without interim analyses.</li>
<li>Probabilities of stopping due to a significant result at each interim or the final analysis (<code>$rejectionProbabilities</code>), cumulative power (<code>$power</code>), and probability of stopping for futility at each interim (<code>$futilityProbabilities</code>). All of these are calculated under the alternative H1.</li>
<li><strong>Expected sample size</strong> of group sequential design (relative to fixed design) under the alternative hypothesis H1 (<code>$averageSampleNumber1</code>), under the null hypothesis H0 (<code>$averageSampleNumber0</code>), and under the parameter in the middle between H0 and H1 (<code>$averageSampleNumber01</code>).</li>
<li>In addition, <code>getDesignCharacteristics(design)</code> provides the required sample size for an abstract group sequential single arm trial with a normal outcome, effect size 1, and standard deviation 1 (i.e., the simplest group sequential setting from a mathematical point of view). The sample size for such a trial without interim analyses is given as <code>$nFixed</code> and the maximum sample size of the corresponding group sequential design as <code>$shift</code>.</li>
</ul>
<p>The practical relevance of this abstract design is that the <strong>properties of the design</strong> (critical values, sample size inflation factor, rejection probabilities, etc) <strong>carry over to group sequential designs regardless of the endpoint (e.g. continuous, binary, or survival)</strong> as they all share the same underlying canonical multivariate normal distribution of the <img src="https://latex.codecogs.com/png.latex?z">-scores.</p>
<p><strong>Overall stopping probabilities, rejection probabilities, and futility probabilities under the null (H0) and the alternative (H1)</strong> (overall and at each stage) can be calculated using the function <code>getPowerAndAverageSampleNumber()</code>. To get these numbers, one needs to provide the maximum sample size and the effect size of the corresponding type of design. We use the maximum sample size of the abstract design we mentioned above via <code>designChar$shift</code>. Under the null hypothesis, the corresponding effect size <code>theta</code> is 0 for this design and under the alternative hypothesis, the effect size <code>theta</code> is 1.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># theta = 0 for calculations under H0</span></span>
<span id="cb22-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerAndAverageSampleNumber</span>(design,</span>
<span id="cb22-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), </span>
<span id="cb22-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> designChar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>shift</span>
<span id="cb22-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power and average sample size (ASN)</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>N_max</em>: 8.3241</li>
<li><em>Effect</em>: 0</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Average sample sizes (ASN)</em>: 5.172</li>
<li><em>Power</em>: 0.02377</li>
<li><em>Early stop</em>: 0.6323</li>
<li><em>Early stop [1]</em>: 0.5001</li>
<li><em>Early stop [2]</em>: 0.1322</li>
<li><em>Early stop [3]</em>: NA</li>
<li><em>Overall reject</em>: 0.02377</li>
<li><em>Reject per stage [1]</em>: 0.00009549</li>
<li><em>Reject per stage [2]</em>: 0.00605889</li>
<li><em>Reject per stage [3]</em>: 0.01761940</li>
<li><em>Overall futility</em>: 0.6262</li>
<li><em>Futility stop per stage [1]</em>: 0.5000</li>
<li><em>Futility stop per stage [2]</em>: 0.1262</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># theta = 1 for calculations under alternative H1</span></span>
<span id="cb23-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerAndAverageSampleNumber</span>(design,</span>
<span id="cb23-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb23-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> designChar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>shift</span>
<span id="cb23-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power and average sample size (ASN)</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>N_max</em>: 8.3241</li>
<li><em>Effect</em>: 1</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Average sample sizes (ASN)</em>: 6.772</li>
<li><em>Power</em>: 0.8000</li>
<li><em>Early stop</em>: 0.4951</li>
<li><em>Early stop [1]</em>: 0.06779</li>
<li><em>Early stop [2]</em>: 0.42733</li>
<li><em>Early stop [3]</em>: NA</li>
<li><em>Overall reject</em>: 0.8000</li>
<li><em>Reject per stage [1]</em>: 0.01907</li>
<li><em>Reject per stage [2]</em>: 0.42389</li>
<li><em>Reject per stage [3]</em>: 0.35704</li>
<li><em>Overall futility</em>: 0.05216</li>
<li><em>Futility stop per stage [1]</em>: 0.048720</li>
<li><em>Futility stop per stage [2]</em>: 0.003437</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>Note that the power under H0, i.e., the significance level, is slightly below 0.025 in this example as it is calculated under the assumption that the non-binding futility boundaries are adhered to.</p>
<p>Both (and even more) values can be obtained with one command <code>getPowerAndAverageSampleNumber(design, theta = c(0, 1), nMax = designChar$shift)</code></p>
</section>
</section>
<section id="plotting-rpact-boundary-objects" class="level1">
<h1>Plotting rpact boundary objects</h1>
<p>We use again the design with an O’Brien &amp; Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function and prespecified futility bounds:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb24-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb24-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb24-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb24-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb24-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), </span>
<span id="cb24-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb24-9">)</span></code></pre></div></div>
</div>
<p>Boundaries can be plotted using the <code>plot</code> (or <code>plot.TrialDesign</code>) function which produces a <a href="https://ggplot2.tidyverse.org">ggplot2</a> object.</p>
<p>The most relevant plots for (abstract) boundaries without easily interpretable treatment effect are boundary plots on <img src="https://latex.codecogs.com/png.latex?z">-scale (<code>type = 1</code>) or <img src="https://latex.codecogs.com/png.latex?p">-value-scale (<code>type = 3</code>) as well as plots of the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function (<code>type = 4</code>). Conveniently, argument <code>showSource = TRUE</code> also provides the source data for the plot. For examples of all available plots, see the R Markdown document <a href="https://rpact.com/vignettes/rpact_plot_examples">How to create admirable plots with rpact</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showSource =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Source data of the plot (type 1):
  x-axis: &lt;environment&gt;$informationRates
  y-axes:
    y1: c(&lt;environment&gt;$futilityBounds, &lt;environment&gt;$criticalValues[length(&lt;environment&gt;$criticalValues)])
    y2: &lt;environment&gt;$criticalValues
Simple plot command examples:
  plot(&lt;environment&gt;$informationRates, c(&lt;environment&gt;$futilityBounds, &lt;environment&gt;$criticalValues[length(&lt;environment&gt;$criticalValues)]), type = "l")
  plot(&lt;environment&gt;$informationRates, &lt;environment&gt;$criticalValues, type = "l")</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_boundary_examples/index_files/figure-html/unnamed-chunk-20-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showSource =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Source data of the plot (type 3):
  x-axis: &lt;environment&gt;$informationRates
  y-axis: &lt;environment&gt;$stageLevels
Simple plot command example:
  plot(&lt;environment&gt;$informationRates, &lt;environment&gt;$stageLevels, type = "l")</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_boundary_examples/index_files/figure-html/unnamed-chunk-20-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showSource =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Source data of the plot (type 4):
  x-axis: &lt;environment&gt;$informationRates
  y-axis: &lt;environment&gt;$alphaSpent
Simple plot command example:
  plot(&lt;environment&gt;$informationRates, &lt;environment&gt;$alphaSpent, type = "l")</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_boundary_examples/index_files/figure-html/unnamed-chunk-20-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Decision regions for two-sided tests with futility bounds are displayed accordingly:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb31-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb31-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb31-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb31-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb31-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb31-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsP"</span>,</span>
<span id="cb31-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb31-9">)</span>
<span id="cb31-10">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_boundary_examples/index_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="comparison-of-multiple-designs" class="level1">
<h1>Comparison of multiple designs</h1>
<p>Multiple designs can be combined into a design set (<code>getDesignSet()</code>) and their properties plotted jointly:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># O'Brien &amp; Fleming, 3 equally spaced stages</span></span>
<span id="cb32-2">d1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb32-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb32-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb32-5">)</span>
<span id="cb32-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pocock</span></span>
<span id="cb32-7">d2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb32-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>, </span>
<span id="cb32-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb32-10">)</span>
<span id="cb32-11">designSet <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignSet</span>(</span>
<span id="cb32-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">designs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(d1, d2), </span>
<span id="cb32-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">variedParameters =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typeOfDesign"</span></span>
<span id="cb32-14">)</span>
<span id="cb32-15"></span>
<span id="cb32-16">designSet <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_boundary_examples/index_files/figure-html/unnamed-chunk-22-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Even simpler, in <a href="https://cran.r-project.org/package=rpact">rpact</a> 3.0, you can also use <code>plot(d1, d2)</code>.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_boundary_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_06.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Delayed Response Designs with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Stephen Schueuerhuis](https://www.linkedin.com/in/stephen-sch%C3%BC%C3%BCrhuis-150843183 &quot;Visit Stephen Schueuerhuis&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 5371 $
Last changed: $Date: 2021-10-11 07:59:37 +0200 (Mo, 11 Okt 2021) $
Last changed by: $Author: wassmer $
Copyright (c) 2022 by Friedrich Pahlke and Gernot Wassmer. All rights reserved.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>In <a href="https://cran.r-project.org/package=rpact">rpact</a> version 3.3, the group sequential methodology from Hampson and Jennison (2013) is implemented. As traditional group sequential designs are characterized specifically by the underlying boundary sets, one main task was to write a function returning the decision critical values according to the calculation rules in Hampson and Jennison (2013). The function returning the respective critical values has been validated, particularly via simulation towards Type I error rate control in various settings (for an example see below). Subsequently, functions characterizing a delayed response group sequential test in terms of power, maximum sample size and expected sample size have been written. These functions were integrated in the <a href="https://cran.r-project.org/package=rpact">rpact</a> functions <code>getDesignGroupSequential()</code>, <code>getDesignCharacteristics()</code>, and the corresponding <code>getSampleSize...()</code> and <code>getPower...()</code> functions.</p>
</section>
<section id="methodology" class="level1">
<h1>Methodology</h1>
<p>The classical group sequential methodology works on the assumptions of having no treatment response delay, i.e., it is assumed that enrolled subjects are observed upon recruitment or at least shortly after. In many practical situations, this assumption does not hold true. Instead, it might be that there is a latency between the timing of recruitment and the actual measurement of a primary endpoint. That is, at interim <img src="https://latex.codecogs.com/png.latex?k"> there is some information <img src="https://latex.codecogs.com/png.latex?I_%7B%5CDelta_t,%20k%7D%20%3E%200"> in pipeline.</p>
<p>One method to handle this pipeline information was proposed by Hampson &amp; Jennison (2013) and is called <em>delayed response group sequential design</em>. Assume that, in a <img src="https://latex.codecogs.com/png.latex?K">-stage trial, given we will proceed to the trial end, we will observe an information sequence <img src="https://latex.codecogs.com/png.latex?(I_1,%20%5Cdots,%20I_K)">, and the corresponding <img src="https://latex.codecogs.com/png.latex?Z">-statistics <img src="https://latex.codecogs.com/png.latex?(Z_1,%20%5Cdots,%20Z_K)">. As we now have information in pipeline, define <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BI%7D_k%20=%20I_k%20+%20I_%7B%5CDelta_t,%20k%7D"> as the information available after awaiting the delay after having observed <img src="https://latex.codecogs.com/png.latex?I_k">. Let <img src="https://latex.codecogs.com/png.latex?(%5Ctilde%7BZ%7D_1,%5Cdots,%5Ctilde%7BZ%7D_%7BK-1%7D)"> be the vector of <img src="https://latex.codecogs.com/png.latex?Z">-statistics that are calculated based upon the information levels <img src="https://latex.codecogs.com/png.latex?(%5Ctilde%7BI%7D_1,%5Cdots,%5Ctilde%7BI%7D_%7BK-1%7D)">. Given boundary sets <img src="https://latex.codecogs.com/png.latex?%5C%7Bu%5E0_1,%5Cdots,u%5E0_%7BK-1%7D%5C%7D">, <img src="https://latex.codecogs.com/png.latex?%5C%7Bu_1,%5Cdots,u_K%5C%7D"> and <img src="https://latex.codecogs.com/png.latex?%5C%7Bc_1,%5Cdots,c_K%5C%7D">, a <img src="https://latex.codecogs.com/png.latex?K">-stage delayed response group sequential design has the following structure:</p>
<div class="cell" data-layout-align="center" data-fig.cps="...">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/rpact_delayed_response_designs_files/table.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:90.0%"></p>
</figure>
</div>
</div>
</div>
<!-- \begin{tabbing} -->
<!-- \hspace*{0.5cm} \= \hspace*{0.4cm} \= \hspace*{5.1cm} \= \kill -->
<!-- \textbf{At stage $1$} \\[0.3cm] -->
<!-- \> If $Z_1 \notin (u^0_1, u_1)$ \> \> stop recruitment, wait for pipeline data \\ -->
<!-- \> \> If $\tilde{Z}_1 \geq c_1$ \> stop for efficacy \\ -->
<!-- \> \> Otherwise \> terminate with non-rejection \\ -->
<!-- \> Else if $Z_1 \in (u^0_1, u_1)$ \> \> recruit additional subjects, proceed to stage $2$ \\[0.3cm] -->
<!-- \textbf{At stage $2$} \\[0.3cm] -->
<!-- \> If $Z_2 \notin (u^0_2, u_2)$ \> \> stop recruitment, wait for pipeline data \\ -->
<!-- \> \> If $\tilde{Z}_2 \geq c_2$ \> stop for efficacy \\ -->
<!-- \> \> Otherwise \> terminate with non-rejection \\ -->
<!-- \> Else if $Z_2 \in (u^0_2, u_2)$ \> \> recruit additional subjects, proceed to stage $3$ \\[0.3cm] -->
<!-- \> \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \> \> \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \\ -->
<!-- \> \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \> \>\vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \hspace{1cm} \vdots \\[0.3cm] -->
<!-- \textbf{At stage $K-1$} \\[0.3cm] -->
<!-- \> If $Z_{K-1} \notin (u^0_{K-1}, u_{K-1})$ \> \> stop recruitment, wait for pipeline data \\ -->
<!-- \> \> If $\tilde{Z}_{K-1} \geq c_{K-1}$ \> stop for efficacy \\ -->
<!-- \> \> Otherwise \> terminate with non-rejection \\ -->
<!-- \> Else if $Z_{K-1} \in (u^0_{K-1}, u_{K-1})$ \> \> recruit additional subjects, proceed to final analysis \\[0.3cm] -->
<!-- \textbf{At the final analysis} \\[0.3cm] -->
<!-- \> If $Z_K \geq u_K = c_K$ \> \> reject null hypothesis \\ -->
<!-- \> Otherwise \> \> accept null hypothesis -->
<!-- \end{tabbing} -->
<p>That is, at each of the <img src="https://latex.codecogs.com/png.latex?k=1,%5Cdots,K-1"> interim analyses, there is <img src="https://latex.codecogs.com/png.latex?I_%7B%5CDelta_t,%20k%7D"> information outstanding. If <img src="https://latex.codecogs.com/png.latex?Z_k"> does not fall within <img src="https://latex.codecogs.com/png.latex?(u%5E0_k,%20u_k)">, the conclusion is to stop the trial neither for efficacy nor for futility (as it would be in a traditional group sequential design), but to <em>irreversibly</em> stop the recruitment. Afterwards, the outstanding data is awaited such that after awaiting the delayed information fraction <img src="https://latex.codecogs.com/png.latex?I_%7B%5CDelta_t,%20k%7D"> of time, <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BI%7D_k%20:=%20I_k%20+%20I_%7B%5CDelta_t,%20k%7D"> information is available and a new <img src="https://latex.codecogs.com/png.latex?Z">-statistic <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BZ%7D_k"> can be calculated. This statistic is then used to test the actual hypothesis of interest using a <em>decision critical value</em> <img src="https://latex.codecogs.com/png.latex?c_k">. The heuristic idea is that the recruitment is stopped only if one is “confident about the subsequent decision”. This means that if the recruitment has been stopped for <img src="https://latex.codecogs.com/png.latex?Z_k%20%5Cgeq%20u_k">, it should be likely to obtain a subsequent <img src="https://latex.codecogs.com/png.latex?H_0"> rejection. In contrast, if the recruitment is stopped for <img src="https://latex.codecogs.com/png.latex?Z_k%20%5Cleq%20u%5E0_k">, obtaining a subsequent rejection should be rather unlikely (but still possible).</p>
<p>The main difference to a group sequential design is that due to the delayed information, each interim potentially consists of two analyses: a recruitment stop analysis and, if indicated, a subsequent decision analysis. Hampson &amp; Jennison (2013) propose to define the boundary sets <img src="https://latex.codecogs.com/png.latex?%5C%7Bu%5E0_1,%5Cdots,u%5E0_K%5C%7D"> and <img src="https://latex.codecogs.com/png.latex?%5C%7Bu_1,%5Cdots,u_K%5C%7D"> as error-spending boundaries determined using <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending functions in the one-sided testing setting with <em>binding</em> futility boundaries. In <a href="https://cran.r-project.org/package=rpact">rpact</a>, this methodology is extended to (one-sided) testing situations where (binding or non-binding) futility boundaries are available. According to Hampson &amp; Jennison (2013), the boundaries <img src="https://latex.codecogs.com/png.latex?%5C%7Bc_1,%20%5Cdots,%20c_K%5C%7D"> with <img src="https://latex.codecogs.com/png.latex?c_K%20=%20u_K"> are chosen such that “reversal probabilities” are balanced. More precisely, <img src="https://latex.codecogs.com/png.latex?c_1"> is chosen as the (unique) solution of:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseCondition1%7D%20%20%20P_%7BH_0%7D(Z_1%20%5Cgeq%0Au_1,%20%5Ctilde%7BZ%7D_1%20%3C%20c_1)%20=%20P_%7BH_0%7D(Z_1%20%5Cleq%20u%5E0_1,%20%5Ctilde%7BZ%7D_1%20%5Cgeq%20c_1)%0A%5Cend%7Balign%7D"></p>
<p>and for <img src="https://latex.codecogs.com/png.latex?k=2,%5Cdots,K-1">, <img src="https://latex.codecogs.com/png.latex?c_k"> is the (unique) solution of:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseCondition2%7D%0A%5Cbegin%7Bsplit%7D%20%20%20&amp;P_%7BH_0%7D(Z_1%20%5Cin%0A(u%5E0_1,%20u_1),%20%5Cdots,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%20u_%7Bk-1%7D),%20Z_k%20%5Cgeq%20u_k,%20%5Ctilde%7BZ%7D_k%0A%5Cleq%20c_k)%20%5C%5C%20%20%20&amp;=%20P_%7BH_0%7D(Z_1%20%5Cin%20(u%5E0_1,%20u_1),%20%5Cdots,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%0Au_%7Bk-1%7D),%20Z_k%20%5Cleq%20u%5E0_k,%20%5Ctilde%7BZ%7D_k%20%5Cgeq%20c_k).%0A%5Cend%7Bsplit%7D%0A%5Cend%7Balign%7D"></p>
<p>It can easily be shown that this constraint yields critical values that ensure Type I error rate control. We call this approach the <em>reverse probabilities approach</em>.</p>
<p>The values <img src="https://latex.codecogs.com/png.latex?c_k">, <img src="https://latex.codecogs.com/png.latex?k%20=%201,%5Cldots,K-1">, are determined via a root-search. Having determined all applicable boundaries, the rejection probability of the procedure given a treatment effect <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponsePower%7D%0A%5Cbegin%7Bsplit%7D%20P_%7B%5Cdelta%7D(Z_1%0A&amp;%5Cnotin%20(u%5E0_1,%20u_1),%20%5Ctilde%7BZ%7D_1%20%3E%20c_1)%20%5C%5C%20&amp;+%20%5Csum_%7Bk=2%7D%5E%7BK-1%7D%20P_%7B%5Cdelta%7D(Z_1%0A%5Cin%20(u%5E0_1,%20u_1),%20%5Cdots%20,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%20u_%7Bk-1%7D),%20Z_k%20%5Cnotin%20(u%5E0_k,%0Au_k),%20%5Ctilde%7BZ%7D_k%20%5Cgeq%20c_k)%20%5C%5C%20&amp;+%20P_%7B%5Cdelta%7D(Z_1%20%5Cin%20(u%5E0_1,%20u_1),%20%5Cdots%20,%0AZ_%7BK-1%7D%20%5Cin%20(u%5E0_%7BK-1%7D,%20u_%7BK-1%7D),%20Z_K%20%5Cgeq%20c_K)%5C,,%0A%5Cend%7Bsplit%7D%0A%5Cend%7Balign%7D"></p>
<p>i.e., the probability to firstly stop the recruitment, followed by a rejection at any of the <img src="https://latex.codecogs.com/png.latex?K"> stages. Setting <img src="https://latex.codecogs.com/png.latex?%5Cdelta=0">, this expression gives the Type I error rate. These values are calculated also for <img src="https://latex.codecogs.com/png.latex?%5Cdelta%5Cnot=%200"> and specified maximum sample size <img src="https://latex.codecogs.com/png.latex?N"> (in the prototype case of testing <img src="https://latex.codecogs.com/png.latex?H_0:%20%5Cmu%20=%200"> against <img src="https://latex.codecogs.com/png.latex?H_1:%5Cmu%20=%20%5Cdelta"> with <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%201">).</p>
<p>As for the group sequential designs, the <em>inflation factor</em>, <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7BIF%7D">, of a delayed response design is the maximum sample size, <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20N">, to achieve power <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cbeta"> for testing <img src="https://latex.codecogs.com/png.latex?H_0"> against <img src="https://latex.codecogs.com/png.latex?H_1"> (in the prototype case) relative to the fixed sample size, <img src="https://latex.codecogs.com/png.latex?n_%7Bfix%7D">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%5Clabel%7Bfs:delayedResponseInflationFactor%7D%20%5Cwidetilde%7BIF%7D%20=%0A%5Cwidetilde%7BIF%7D(%5Calpha,%20%5Cbeta,%20K%20,%20I_%7B%5CDelta_t%7D)%20=%20%5Cfrac%7B%5Cwidetilde%0AN%7D%7Bn_%7Bfix%7D%7D%5C;.%0A%5Cend%7Bequation%7D"></p>
<p>Let <img src="https://latex.codecogs.com/png.latex?n_k"> denote the number of subjects observed at the <img src="https://latex.codecogs.com/png.latex?k">-th recruitment stop analysis and <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Bn%7D_k"> the number of subjects recruited at the subsequent <img src="https://latex.codecogs.com/png.latex?k">-th decision analysis. Given <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%20N">, it holds that</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseSampleSize%7D%20%20%20%0An_k%20=%20I_k%20%5Cwidetilde%20N%20%5C,%5C,%5C,%5C,%20%5Ctext%7Band%7D%20%5C,%5C,%5C,%5C,%20%5Ctilde%7Bn%7D_k%20=%20%5Ctilde%7BI%7D_k%0A%5Cwidetilde%20N%20%5C;.%0A%5Cend%7Balign%7D"></p>
<p>The expected sample size, <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7BASN%7D_%5Cdelta">, of a delayed response design is:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseASN%7D%0A%5Cbegin%7Bsplit%7D%20%20%5Cwidetilde%7BASN%7D_%7B%5Cdelta%7D%20=%20%5Ctilde%7Bn%7D_1%20&amp;P_%7B%5Cdelta%7D(Z_1%20%5Cnotin%0A(u%5E0_1,%20u_1))%20%5C%5C%20%20&amp;+%20%5Csum_%7Bk=2%7D%5E%7BK-1%7D%20%5Ctilde%7Bn%7D_kP_%7B%5Cdelta%7D(Z_1%20%5Cin%20(u%5E0_1,%20u_1),%0A%5Cdots%20,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%20u_%7Bk-1%7D),%20Z_k%20%5Cnotin%20(u%5E0_k,%20u_k))%20%5C%5C%20%20&amp;+%0A%5Ctilde%7Bn%7D_K%20P_%7B%5Cdelta%7D(Z_1%20%5Cin%20(u%5E0_1,%20u_1),%20%5Cdots%20,%20Z_%7BK-1%7D%20%5Cin%20(u%5E0_%7BK-1%7D,%0Au_%7BK-1%7D))%20%5Cend%7Bsplit%7D%0A%5Cend%7Balign%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Bn%7D_K%20=%20%5Cwidetilde%20N">. As for the maximum sample size, this is provided relative to the sample size in a fixed sample design, i.e., as the expected reduction in sample size.</p>
</section>
<section id="examples" class="level1">
<h1>Examples</h1>
<p>We illustrate the calculation of decision critical values and design characteristics using the described approach for a three-stage group sequential design with Kim &amp; DeMets <img src="https://latex.codecogs.com/png.latex?%5Calpha">- and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending functions with <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%202">.</p>
<p><strong>First, load the rpact package </strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.3 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<section id="decision-critical-values" class="level2">
<h2 class="anchored" data-anchor-id="decision-critical-values">Decision critical values</h2>
<p>The delayed responses utility is simply to add the parameter <code>delayedInformation</code> to the <code>getDesignGroupSequential()</code> (or <code>getDesignInverseNormal()</code>) function. <code>delayedInformation</code> is either a positive constant or a vector of length <img src="https://latex.codecogs.com/png.latex?K-1"> with positive elements describing the amount of pipeline information at interim <img src="https://latex.codecogs.com/png.latex?k,%5Cldots,K-1">:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">gsdWithDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>,</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaB =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsKD"</span>,</span>
<span id="cb3-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delayedInformation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.16</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>),</span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb3-12">)</span></code></pre></div></div>
</div>
<p>Note that the entered <code>informationRates</code> correspond to the information rates at which the decision to potentially stop recruitment is made (i.e., using the notation above, <img src="https://latex.codecogs.com/png.latex?I_1,...,I_%7BK-1%7D"> for the interim analyses) rather than the information rates achieved at the efficacy decision (which are, in contrast, <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BI%7D_1,...%5Ctilde%7BI%7D_%7BK-1%7D">).</p>
<p>The output contains the continuation region for each interim analysis defined through the upper and lower boundary of the continuation region. The interim analyses are additionally characterized through decision critical values (1.387, 1.82, 2.03):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">gsdWithDelay</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Kim &amp; DeMets alpha spending</li>
<li><em>Information rates</em>: 0.300, 0.700, 1.000</li>
<li><em>Binding futility</em>: TRUE</li>
<li><em>Parameter for alpha spending function</em>: 2</li>
<li><em>Parameter for beta spending function</em>: 2</li>
<li><em>Delayed information</em>: 0.160, 0.200</li>
<li><em>Type of beta spending</em>: Kim &amp; DeMets beta spending</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Stages</em>: 1, 2, 3</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 3</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Power</em>: 0.1053, 0.5579, 0.8000</li>
<li><em>Lower bounds of continuation (binding)</em>: -0.508, 1.096</li>
<li><em>Cumulative alpha spending</em>: 0.00225, 0.01225, 0.02500</li>
<li><em>Cumulative beta spending</em>: 0.0180, 0.0980, 0.2000</li>
<li><em>Upper bounds of continuation</em>: 2.841, 2.295, 2.030</li>
<li><em>Stage levels (one-sided)</em>: 0.00225, 0.01087, 0.02116</li>
<li><em>Decision critical values</em>: 1.387, 1.820, 2.030</li>
<li><em>Reversal probabilities</em>: 0.00007335, 0.00179791</li>
</ul>
</div>
</div>
<p>Note that the last decision critical value (2.03) is equal to the last critical value of the corresponding group sequential design without delayed response. To obtain the design characteristics, the function <code>getDesignCharacteristics()</code> calculates the maximum sample size for the design (<code>shift</code>), the inflation factor and the average sample sizes under the null hypothesis, the alternative hypothesis, and under a value in between <img src="https://latex.codecogs.com/png.latex?H_0"> and <img src="https://latex.codecogs.com/png.latex?H_1">:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">gsdWithDelay <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Delayed response group sequential design characteristics</strong></p>
<ul>
<li><em>Number of subjects fixed</em>: 7.8489</li>
<li><em>Shift</em>: 8.2521</li>
<li><em>Inflation factor</em>: 1.0514</li>
<li><em>Informations</em>: 2.476, 5.777, 8.252</li>
<li><em>Power</em>: 0.1026, 0.5563, 0.8000</li>
<li><em>Rejection probabilities under H1</em>: 0.1026, 0.4537, 0.2437</li>
<li><em>Futility probabilities under H1</em>: 0.01869, 0.08335</li>
<li><em>Ratio expected vs fixed sample size under H1</em>: 0.9269</li>
<li><em>Ratio expected vs fixed sample size under a value between H0 and H1</em>: 0.9329</li>
<li><em>Ratio expected vs fixed sample size under H0</em>: 0.8165</li>
<li><em>%.probs% [1]</em>: 0.019, 0.083, 0.106</li>
<li><em>%.probs% [2]</em>: 0.897, 0.433, 0.106</li>
<li><em>%.probs% [3]</em>: 1, 0.879, 0.349</li>
</ul>
</div>
</div>
<p>Using the <code>summary()</code> function, these number can be directly displayed without using the <code>getDesignCharacteristics()</code> function as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">gsdWithDelay <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (delayed response group sequential design)</strong></p>
<p>Kim &amp; DeMets alpha spending design with delayed response (gammaA = 2) and Kim &amp; DeMets beta spending (gammaB = 2), one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0514, ASN H1 0.9269, ASN H01 0.9329, ASN H0 0.8165.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>30%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Delayed information</td>
<td>16%</td>
<td>20%</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative alpha spent</td>
<td>0.0022</td>
<td>0.0122</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Cumulative beta spent</td>
<td>0.0180</td>
<td>0.0980</td>
<td>0.2000</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0022</td>
<td>0.0109</td>
<td>0.0212</td>
</tr>
<tr class="even">
<td>Upper bounds of continuation</td>
<td>2.841</td>
<td>2.295</td>
<td>2.030</td>
</tr>
<tr class="odd">
<td>Lower bounds of continuation (binding)</td>
<td>-0.508</td>
<td>1.096</td>
<td></td>
</tr>
<tr class="even">
<td>Decision critical values</td>
<td>1.387</td>
<td>1.820</td>
<td>2.030</td>
</tr>
<tr class="odd">
<td>Reversal probabilities</td>
<td>&lt;0.0001</td>
<td>0.0018</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.1026</td>
<td>0.5563</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.019</td>
<td>0.083</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>It might be of interest to check whether this in fact yields Type I error rate control. This can be done with the internal function <code>getSimulatedRejectionsDelayedResponse()</code> as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">rpact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulatedRejectionsDelayedResponse</span>(gsdWithDelay, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">iterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$simulatedAlpha
[1] 0.024733

$delta
[1] 0

$iterations
[1] 1000000

$seed
[1] -945806944

$confidenceIntervall
[1] 0.02442859 0.02503741

$alphaWithin95ConfidenceIntervall
[1] TRUE

$time
Time difference of 4.870353 secs</code></pre>
</div>
</div>
<p>It also checks whether the simulated Type I error rate is within the 95% error boundaries.</p>
<p>Compared to the design with no delayed information, it turns out that the inflation factor is quite similar though the average sample sizes are different. This is due to the fact that, compared to the design with no delayed response, the actual number of patients to be used for the analysis is larger:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">gsdWithoutDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>,</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaB =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsKD"</span>,</span>
<span id="cb9-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb9-11">)</span>
<span id="cb9-12">gsdWithoutDelay <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb9-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>Kim &amp; DeMets alpha spending design (gammaA = 2) and Kim &amp; DeMets beta spending (gammaB = 2), binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.072, ASN H1 0.8082, ASN H01 0.8268, ASN H0 0.6573.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>30%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0022</td>
<td>0.0122</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0180</td>
<td>0.0980</td>
<td>0.2000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0022</td>
<td>0.0109</td>
<td>0.0212</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>2.841</td>
<td>2.295</td>
<td>2.030</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>-0.508</td>
<td>1.096</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.1053</td>
<td>0.5579</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Futility probabilities under H1</td>
<td>0.018</td>
<td>0.080</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="power-and-average-sample-size-calculation" class="level2">
<h2 class="anchored" data-anchor-id="power-and-average-sample-size-calculation">Power and average sample size calculation</h2>
<p>It might be also of interest to evaluate the expected sample size under a range of parameter values, e.g., to obtain an optimum design under some criterion that is based on all parameter values within some specified range. Keeping in mind that the prototype case is for testing <img src="https://latex.codecogs.com/png.latex?H_0:%5Cmu%20=%200"> against <img src="https://latex.codecogs.com/png.latex?H_1:%5Cmu%20=%20%5Cdelta"> with (known) <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%201">, this is obtained with the following commands:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># use calculated sample size for the prototype case</span></span>
<span id="cb10-2">nMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>(gsdWithDelay)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>shift </span>
<span id="cb10-3">deltaRange <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb10-4">ASN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(gsdWithDelay,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> deltaRange,</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> nMax</span>
<span id="cb10-7">)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects</span>
<span id="cb10-8">dat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta =</span> deltaRange, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ASN =</span> ASN, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delay =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delay"</span>)</span>
<span id="cb10-9">ASN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(gsdWithoutDelay,</span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> deltaRange,</span>
<span id="cb10-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> nMax</span>
<span id="cb10-12">)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects</span>
<span id="cb10-13">dat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(dat, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta =</span> deltaRange, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ASN =</span> ASN, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delay =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no delay"</span>))</span>
<span id="cb10-14"></span>
<span id="cb10-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb10-16">myTheme <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb10-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.title.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>),</span>
<span id="cb10-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>),</span>
<span id="cb10-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.title.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>),</span>
<span id="cb10-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span>
<span id="cb10-21">)</span>
<span id="cb10-22"></span>
<span id="cb10-23"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> dat, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> delta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> ASN, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> delay, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(delay))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(nMax)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-26">    myTheme <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternative"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected number of subjects"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-30">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> nMax, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-31">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> nMax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fixed sample size"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Note that, in contrast, the rejection probabilities are very similar for the different designs:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">reject <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb11-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(gsdWithDelay,</span>
<span id="cb11-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> deltaRange,</span>
<span id="cb11-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> nMax</span>
<span id="cb11-5">    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject,</span>
<span id="cb11-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(gsdWithoutDelay,</span>
<span id="cb11-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> deltaRange,</span>
<span id="cb11-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> nMax</span>
<span id="cb11-9">    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span>
<span id="cb11-10">)</span>
<span id="cb11-11">dat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>reject <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> reject</span>
<span id="cb11-12"></span>
<span id="cb11-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> dat, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> delta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> reject, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> delay, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(delay))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-16">    myTheme <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternative"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rejection probability"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gsdWithDelay<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>beta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Since we used the maximum sample size <code>nMax</code> from the design with delayed responses, the power is 80% for this design (for the design without delayed response it is slightly lower).</p>
<p>We illustrate the calculation of power and average sample size with an example provided by Schüürhuis (2022), p.68: Suppose it is planned to conduct a parallel group trial with <img src="https://latex.codecogs.com/png.latex?N%20=%20175"> subjects per arm to be linearly recruited within <img src="https://latex.codecogs.com/png.latex?24"> months in presence of a delay of <img src="https://latex.codecogs.com/png.latex?%5CDelta_t%20=%205">. The significance level is <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">, the nominal type II error is <img src="https://latex.codecogs.com/png.latex?%5Cbeta=%200.2"> at a treatment effect of <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20=%200.3">. The boundaries are chosen to be calculated using O’Brien-Fleming-like <img src="https://latex.codecogs.com/png.latex?%5Calpha">- and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending functions and the interim is planned after <img src="https://latex.codecogs.com/png.latex?I_1%20=%200.3"> information has been fully collected. Note that due to the delay, this occurs at <img src="https://latex.codecogs.com/png.latex?t_1%20=%200.3%5Ccdot%2024%20+%205%20=%2012.2"> months. Based on the test statistic available at this point (denoted <img src="https://latex.codecogs.com/png.latex?Z_1"> above), it is decided whether or not to stop recruitment. In case the recruitment is stopped, the pipeline data are awaited and the interim analysis then takes place at <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Bt%7D_1%20=%2012.2%20+5%20=17.2"> months. Consequently, the efficacy decision in the interim analysis (if recruitment was stopped) will be performed based on the test statistic <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BZ%7D_1"> with an information fraction of <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7BI%7D_1%20=%200.3%20+%205/24%20=%200.508">. If, on the other hand, recruitment was not stopped at the interim analysis, the second stage is performed and the final analysis takes place at <img src="https://latex.codecogs.com/png.latex?24+5=29"> months.</p>
<p>The numbers provided in Table 5.2 of Schüürhuis (2022) for the <em>Hampson and Jennison</em> approach can be obtained with the following commands:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">gsdTwoStagesWithDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb12-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb12-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span>,</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delayedInformation =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>,</span>
<span id="cb12-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb12-10">)</span>
<span id="cb12-11">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb12-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> gsdTwoStagesWithDelay,</span>
<span id="cb12-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb12-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb12-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb12-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">350</span></span>
<span id="cb12-18">)</span>
<span id="cb12-19"></span>
<span id="cb12-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expected number of subjects table 5.2</span></span>
<span id="cb12-21"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 172.6</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expected trial duration table 5.2</span></span>
<span id="cb14-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>earlyStop <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">17.2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>earlyStop) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 28.671</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># power table 5.2</span></span>
<span id="cb16-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.798</code></pre>
</div>
</div>
<p>It has to be noted that the time points of analysis are derived under the assumption of a <em>linear recruitment</em> of patients. Otherwise, these calculations need to be adapted for a non-linear case (which is easy to be done).</p>
<p>The <em>Recruitment Pause</em> approach can be obtained with the following commands (without using the <code>delayedInformation</code> parameter). As above, the interim analysis information is fully observed after <img src="https://latex.codecogs.com/png.latex?7.2%20+%202%5Ccdot%205%20=%2017.2"> months, whereas the final information is here after <img src="https://latex.codecogs.com/png.latex?24%20+%202%5Ccdot%205%20=%2034"> months:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">gsdTwoStagesWithoutDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb18-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb18-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb18-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span>,</span>
<span id="cb18-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb18-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb18-9">)</span>
<span id="cb18-10"></span>
<span id="cb18-11">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb18-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> gsdTwoStagesWithoutDelay,</span>
<span id="cb18-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb18-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb18-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb18-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb18-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">350</span></span>
<span id="cb18-18">)</span>
<span id="cb18-19"></span>
<span id="cb18-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expected number of subjects table 5.2</span></span>
<span id="cb18-21"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 153.053</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expected trial duration table 5.2</span></span>
<span id="cb20-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>earlyStop <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">17.2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>earlyStop) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 29.715</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># power table 5.2</span></span>
<span id="cb22-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(results<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.779</code></pre>
</div>
</div>
</section>
<section id="plotting-designs" class="level2">
<h2 class="anchored" data-anchor-id="plotting-designs">Plotting designs</h2>
<p>The decision boundaries of the delayed response group sequential design can be illustrated as <code>type = 1</code> plot for the design. This adds the decision boundaries as crosses together with the continuation region. Note that other plot types are directly accounting for the delayed response situation as the required numbers are calculated for this case.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">gsdWithDelay <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/index_files/figure-html/unnamed-chunk-14-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="an-alternative-approach" class="level1">
<h1>An alternative approach</h1>
<p>The approach described so far uses the identity of reversal probabilities to derive the decision boundaries. An alternative approach is to demand <em>two</em> conditions for rejecting the null at a given stage of the trial and spend a specified amount of significance at this stage. This definition is independent of the specification of futility boundaries but can be used with these as well. We show how the (new) <a href="https://cran.r-project.org/package=rpact">rpact</a> function <code>getGroupSequentialProbabilities()</code> can handle this situation.</p>
<section id="the-definition" class="level2">
<h2 class="anchored" data-anchor-id="the-definition">The definition</h2>
<p>At stage <img src="https://latex.codecogs.com/png.latex?k">, in order to reject <img src="https://latex.codecogs.com/png.latex?H_0">, the test statistic <img src="https://latex.codecogs.com/png.latex?Z_k"> needs to exceed the upper continuation bound <img src="https://latex.codecogs.com/png.latex?u_k"> <em>and</em> <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20Z_k"> needs to exceed the critical value <img src="https://latex.codecogs.com/png.latex?c_k">. Hence, the set of upper continuation boundaries and critical values is defined through the conditions</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseCondition3%7D%0A%5Cbegin%7Bsplit%7D%20%20%20&amp;P_%7BH_0%7D(Z_1%20%5Cgeq%20u_1,%20%5Ctilde%7BZ%7D_k%20%5Cgeq%20c_1)%20=%20%5Calpha(t_1)%5C%5C%0A&amp;P_%7BH_0%7D(Z_1%20%3C%20u_1,%20%5Cdots,%20Z_%7Bk-1%7D%20%3C%20u_%7Bk-1%7D,%20Z_k%20%5Cgeq%20u_k,%20%5Ctilde%7BZ%7D_k%20%5Cgeq%20c_k)%20=%0A%5Calpha(t_k)%20-%20%5Calpha(t_%7Bk-1%7D),%20k%20=%202,%20%5Cldots%20K%20-%201,%20%5C%5C%0A&amp;P_%7BH_0%7D(Z_1%20%3C%20u_1,%20%5Cdots,%20Z_%7BK-1%7D%20%3C%20u_%7BK-1%7D,%20Z_K%20%5Cgeq%20u_K)%20=%0A%5Calpha(t_K)%20-%20%5Calpha(t_%7BK-1%7D)%5C;.%0A%5Cend%7Bsplit%7D%0A%5Cend%7Balign%7D"></p>
<p>Since this cannot be solved without additional constraints, the critical values <img src="https://latex.codecogs.com/png.latex?c_k"> are fixed as <img src="https://latex.codecogs.com/png.latex?c_k%20=%20%5CPhi%5E%7B-1%7D(1%20-%20%5Calpha)">. This makes sense since it often turns out that the optimum boundaries using the <em>reversal probabilities approach</em> are smaller than <img src="https://latex.codecogs.com/png.latex?%5CPhi%5E%7B-1%7D(1%20-%20%5Calpha)"> and the unadjusted boundary is a reasonable choice for a minimum requirement for rejecting <img src="https://latex.codecogs.com/png.latex?H_0">.</p>
<p>Starting by <img src="https://latex.codecogs.com/png.latex?k%20=%201">, the values <img src="https://latex.codecogs.com/png.latex?u_k">, <img src="https://latex.codecogs.com/png.latex?k%20=%201,%5Cldots,K"> with fixed <img src="https://latex.codecogs.com/png.latex?c_k">, are successively determined via a root-search.</p>
<p>The conditions for the Type II error rate are the following:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign%7D%5Clabel%7Bfs:delayedResponseCondition4%7D%0A%5Cbegin%7Bsplit%7D%0AP_%7B%5Cdelta%7D(Z_1%20%5Cleq%20&amp;u%5E0_1)%20+%20P_%7B%5Cdelta%7D(Z_1%20%5Cgeq%20u_1,%20%5Ctilde%7BZ%7D_1%20%5Cleq%20c_1)%20=%20%5Cbeta(t_1)%5C%5C%0AP_%7B%5Cdelta%7D(Z_1%20%5Cin%20&amp;(u%5E0_1,%20u_1),%20%5Cdots%20,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%20u_%7Bk-1%7D),%20Z_k%20%5Cleq%20u%5E0_k)%20%5C%5C%0A&amp;+%5C;%20P_%7B%5Cdelta%7D(Z_1%20%5Cin%20(u%5E0_1,%20u_1),%20%5Cdots%20,%20Z_%7Bk-1%7D%20%5Cin%20(u%5E0_%7Bk-1%7D,%20u_%7Bk-1%7D),%20Z_k%20%5Cgeq%20u_k%20,%20%5Ctilde%7BZ%7D_k%20%5Cleq%0Ac_k)%20=%20%5Cbeta(t_k)%20-%20%5Cbeta(t_%7Bk-1%7D),%20k%20=%202,%20%5Cldots%20K%20-%201,%20%5C%5C%0AP_%7B%5Cdelta%7D(Z_1%20%5Cin%20&amp;(u%5E0_1,%20u_1),%20%5Cdots%20,%20Z_%7BK-1%7D%20%5Cin%20(u%5E0_%7BK-1%7D,%20u_%7BK-1%7D),%20Z_K%20%5Cleq%20u_K)%20=%20%5Cbeta(t_K)%20-%0A%5Cbeta(t_%7BK-1%7D)%5C;.%20%5Cend%7Bsplit%7D%0A%5Cend%7Balign%7D"></p>
<p>The algorithm to derive the acceptance boundaries <img src="https://latex.codecogs.com/png.latex?u_1%5E0,%20%5Cldots,%20u_%7BK-1%7D%5E0"> can be briefly described as follows: At given rejection boundaries <img src="https://latex.codecogs.com/png.latex?u_1,%5Cldots,%20u_K"> (calculated from above) the algorithm successively calculates the acceptance boundaries using the specifed <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function and an arbitrary sample size or “shift” value. If the last stage acceptance critical value is smaller than the last stage critical value, the shift value is increased, otherwise it is decreased. This is repeated until the last stage critical values coincide. The resulting shift value can be interpreted as the maximum necessary sample size to achieve power <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cbeta">. Using the algorithm, we have to additionally specify upper and lower boundaries for the <code>shift</code> (which can be interpreted as the maximum sample size for the group sequential design in the prototype case, cf., Wassmer &amp; Brannath, 2016). This is set to be within 0 and 100 which covers practically relevant situations.</p>
</section>
<section id="calculation-of-boundaries" class="level2">
<h2 class="anchored" data-anchor-id="calculation-of-boundaries">Calculation of boundaries</h2>
<p>We use the function <code>getGroupSequentialProbabilities()</code> to calculate the critical values by a numerical root search. For this, we define a <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function <code>spend()</code> which can be arbitrarily chosen. Here, we define a function according to the power family of Kim &amp; DeMets with <code>gammaA = 1.345</code>. This value was shown by Hampson &amp; Jennison (2013) to be optimal in a specific context but this does not matter here. The (upper) continuation boundaries <img src="https://latex.codecogs.com/png.latex?u_1,%5Cldots,u_%7BK%20-1%7D"> together with the decision boundaries <img src="https://latex.codecogs.com/png.latex?c_1=%5Ccdots%20=%20c_%7BK%20-%201%7D%20=%20%5CPhi%5E%7B-1%7D(1%20-%20%5Calpha)%20=%201.96"> and the last stage critical boundary <img src="https://latex.codecogs.com/png.latex?u_K"> are computed using the <code>uniroot()</code> function as follows.</p>
<p>For <img src="https://latex.codecogs.com/png.latex?k%20=%201">, <code>decisionMatrix</code> is set equal to <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation*%7D%0A%5Cbegin%7Bpmatrix%7D%0Au_1%20&amp;%20c_1%5C%5C%0A%5Cinfty%20&amp;%20%5Cinfty%0A%5Cend%7Bpmatrix%7D%5C;,%0A%5Cend%7Bequation*%7D"> for <img src="https://latex.codecogs.com/png.latex?1%20%3C%20k%20%3C%20K">, we use <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation*%7D%0A%5Cbegin%7Bpmatrix%7D%20-%5Cinfty%20&amp;%20%5Cldots%20&amp;-%5Cinfty%20&amp;u_k%20&amp;%20c_k%5C%5C%20u_1%20&amp;%20%5Cldots%20&amp;%20u_%7Bk-1%7D%20&amp;%20%5Cinfty%20&amp;%20%5Cinfty%0A%5Cend%7Bpmatrix%7D%5C;,%0A%5Cend%7Bequation*%7D"> whereas, for <img src="https://latex.codecogs.com/png.latex?k%20=%20K">, we use <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation*%7D%0A%5Cbegin%7Bpmatrix%7D%0A-%5Cinfty%20&amp;%20%5Cldots%20&amp;%20-%5Cinfty%20&amp;u_K%20%5C%5C%0Au_1%20&amp;%20%5Cldots%20&amp;%20u_%7BK-1%7D%20&amp;%20%5Cinfty%20%20%0A%5Cend%7Bpmatrix%7D%0A%5Cend%7Bequation*%7D"><br>
for calculating the stagewise rejection probabilities that yield Type I error rate control with appropriately defined information rates.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">###   Derive decision boundaries for delayed response alpha spending approach</span></span>
<span id="cb25-2">alpha <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb25-3">gammaA <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.345</span></span>
<span id="cb25-4">tolerance <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1E-6</span></span>
<span id="cb25-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     Specify use function</span></span>
<span id="cb25-6">spend <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, size, gamma) {</span>
<span id="cb25-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(size <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>gamma)</span>
<span id="cb25-8">}</span>
<span id="cb25-9"></span>
<span id="cb25-10">infRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">54</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span></span>
<span id="cb25-11">kMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(infRates)</span>
<span id="cb25-12">delay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, kMax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span></span>
<span id="cb25-13">u <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, kMax)</span>
<span id="cb25-14">c <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> alpha), kMax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb25-15"></span>
<span id="cb25-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>kMax)) {</span>
<span id="cb25-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> kMax) {</span>
<span id="cb25-18">        infRatesPlusDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(infRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>k], infRates[k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> delay[k])</span>
<span id="cb25-19">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb25-20">        infRatesPlusDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> infRates</span>
<span id="cb25-21">    }</span>
<span id="cb25-22">    u[k] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniroot</span>(</span>
<span id="cb25-23">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb25-24">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb25-25">                d <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb25-26">                    x, c[k],</span>
<span id="cb25-27">                    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb25-28">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb25-29">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> kMax) {</span>
<span id="cb25-30">                d <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb25-31">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), x, c[k],</span>
<span id="cb25-32">                    u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb25-33">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb25-34">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb25-35">                d <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb25-36">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), x,</span>
<span id="cb25-37">                    u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb25-38">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb25-39">            }</span>
<span id="cb25-40">            probs <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getGroupSequentialProbabilities</span>(d, infRatesPlusDelay)</span>
<span id="cb25-41">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb25-42">                probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], alpha, gammaA)</span>
<span id="cb25-43">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> kMax) {</span>
<span id="cb25-44">                probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], alpha, gammaA) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span></span>
<span id="cb25-45">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], alpha, gammaA))</span>
<span id="cb25-46">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb25-47">                probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], alpha, gammaA) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span></span>
<span id="cb25-48">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], alpha, gammaA))</span>
<span id="cb25-49">            }</span>
<span id="cb25-50">        },</span>
<span id="cb25-51">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lower =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">upper =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span></span>
<span id="cb25-52">    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>root</span>
<span id="cb25-53">}</span>
<span id="cb25-54"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(u, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2.43743 2.24413 2.06854</code></pre>
</div>
</div>
<p>We note that any other spending function can be used to define the design. That is, you can also use the spending probabilities of, say, an O`Brien &amp; Fleming design approach that is defined through the shape of the boundaries. Furthermore, it is also possible to use the boundaries <img src="https://latex.codecogs.com/png.latex?u_1,%20%5Cldots,%20u_K"> together with the unadjusted critical values <img src="https://latex.codecogs.com/png.latex?c_1,%5Cldots,%20c_%7BK%20-%201%7D"> in an inverse normal <img src="https://latex.codecogs.com/png.latex?p">-value combination test where the weights are fixed through the planned information rates and the delay.</p>
</section>
<section id="calculation-of-test-characteristics" class="level2">
<h2 class="anchored" data-anchor-id="calculation-of-test-characteristics">Calculation of test characteristics</h2>
<p>The calculation of the test characteristics is straightforward and can be derived for designs with or without futility boundaries. In the following example, we show how to derive lower continuation (or futility) boundaries <img src="https://latex.codecogs.com/png.latex?u%5E0_1,%20%5Cldots,u%5E0_%7BK%20-1%20%7D"> that are based on a <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending function approach. As above, we use the same Kim &amp; DeMets spending function with <code>gammaB = 1.345</code>. Due to numerical reasons, we do not use the <code>uniroot()</code> function here but a bisection method to numerically search for the boundaries.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">beta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb27-2">gammaB <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.345</span></span>
<span id="cb27-3">u0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, kMax)</span>
<span id="cb27-4">cLower1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb27-5">cUpper1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb27-6">prec1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb27-7">iteration <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1E5</span></span>
<span id="cb27-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> (prec1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> tolerance) {</span>
<span id="cb27-9">    shift <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (cLower1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cUpper1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb27-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>kMax)) {</span>
<span id="cb27-11">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> kMax) {</span>
<span id="cb27-12">            infRatesPlusDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(infRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>k], infRates[k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> delay[k])</span>
<span id="cb27-13">        } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb27-14">            infRatesPlusDelay <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> infRates</span>
<span id="cb27-15">        }</span>
<span id="cb27-16">        nz <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(infRatesPlusDelay), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(shift)</span>
<span id="cb27-17">        prec2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb27-18">        cLower2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span></span>
<span id="cb27-19">        cUpper2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span></span>
<span id="cb27-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> (prec2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> tolerance) {</span>
<span id="cb27-21">            x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (cLower2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cUpper2) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb27-22">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb27-23">                d2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb27-24">                    u[k], c[k],</span>
<span id="cb27-25">                    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb27-26">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nz</span>
<span id="cb27-27">                probs <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getGroupSequentialProbabilities</span>(d2, infRatesPlusDelay)</span>
<span id="cb27-28">                <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pnorm</span>(x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nz[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], beta, gammaB),</span>
<span id="cb27-29">                    cLower2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x, cUpper2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x</span>
<span id="cb27-30">                )</span>
<span id="cb27-31">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> kMax) {</span>
<span id="cb27-32">                d1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb27-33">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(u0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]), x,</span>
<span id="cb27-34">                    u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb27-35">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nz[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>k]</span>
<span id="cb27-36">                probs1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getGroupSequentialProbabilities</span>(d1, infRatesPlusDelay[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>k])</span>
<span id="cb27-37">                d2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb27-38">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(u0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]), u[k], c[k],</span>
<span id="cb27-39">                    u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb27-40">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nz</span>
<span id="cb27-41">                probs2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getGroupSequentialProbabilities</span>(d2, infRatesPlusDelay)</span>
<span id="cb27-42">                <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(probs1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> probs2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], beta, gammaB) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span></span>
<span id="cb27-43">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(</span>
<span id="cb27-44">                        infRates[k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb27-45">                        beta, gammaB</span>
<span id="cb27-46">                    ),</span>
<span id="cb27-47">                cLower2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x, cUpper2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x</span>
<span id="cb27-48">                )</span>
<span id="cb27-49">            } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb27-50">                d1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb27-51">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(u0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]), x,</span>
<span id="cb27-52">                    u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span></span>
<span id="cb27-53">                ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nz</span>
<span id="cb27-54">                probs <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getGroupSequentialProbabilities</span>(d1, infRates)</span>
<span id="cb27-55">                <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(probs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, k] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k], beta, gammaB) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span></span>
<span id="cb27-56">                    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spend</span>(infRates[k <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], beta, gammaB),</span>
<span id="cb27-57">                cLower2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x, cUpper2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x</span>
<span id="cb27-58">                )</span>
<span id="cb27-59">            }</span>
<span id="cb27-60">            iteration <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> iteration <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb27-61">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(iteration <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, prec2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cUpper2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cLower2, prec2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb27-62">        }</span>
<span id="cb27-63">        u0[k] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x</span>
<span id="cb27-64">    }</span>
<span id="cb27-65">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(u0[kMax] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> u[kMax], cLower1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> shift, cUpper1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> shift)</span>
<span id="cb27-66">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(iteration <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, prec1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> cUpper1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cLower1, prec1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb27-67">}</span>
<span id="cb27-68"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(u0, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] -0.40891  0.66367  2.06854</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(shift, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 12</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(shift <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> alpha) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> beta))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1.142</code></pre>
</div>
</div>
<p>We can compare these values with the “original” <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-spending approach with non-binding futility boundaries using the function <code>getDesignGroupSequential()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb33-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> infRates,</span>
<span id="cb33-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>, </span>
<span id="cb33-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsKD"</span>,</span>
<span id="cb33-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> gammaA, </span>
<span id="cb33-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaB =</span> gammaB,</span>
<span id="cb33-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> alpha, </span>
<span id="cb33-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> beta, </span>
<span id="cb33-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb33-10">)</span>
<span id="cb33-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>futilityBounds, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] -0.19958  0.80463</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>criticalValues, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2.59231 2.39219 2.10214</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>(x)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>inflationFactor, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1.146</code></pre>
</div>
</div>
</section>
</section>
<section id="conclusions" class="level1">
<h1>Conclusions</h1>
<p>We have shown how to handle a group sequential design with delayed responses in two diffenrent ways. So far, we have implemented the approach proposed by Hampson &amp; Jennison (2013) that is based on reversal probabilities. The direct usage of the delayed information within the design definition make it easy for the user to apply these designs to commonly used trials with continuous, binary, and time to event endpoints. We have also shown how to use the <code>getGroupSequentialProbabilities()</code> function to derive the critical values and the test characteristics for the alternative approach that “more directly” determines the critical values through a spending function approach.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_delayed_response_designs/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_10.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Count Data with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Tobias Muetze](https://www.linkedin.com/in/tobiasmuetze &quot;Visit Tobias Muetze&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0002-4111-1941 &quot;Visit Tobias Muetze&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_count_data_planning/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 5371 $
Last changed: $Date: 2024-02-14 07:59:37 +0200 (We, 14 Feb 2024) $
Last changed by: $Author: wassmer $
Copyright (c) 2024 by Gernot Wassmer, Tobias Muetze, and Friedrich Pahlke. All rights reserved.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>Examples for count data described in the literature are</p>
<ul>
<li>exacerbations in asthma and chronic obstructive pulmonary disease (COPD)</li>
<li>counts of brain lesions by MRI in Multiple Sclerosis (MS)</li>
<li>relapses in pediatric MS</li>
<li>hospitalizations in heart failure trials</li>
<li>number of occurrences of adverse events</li>
</ul>
<p>Typically, the count outcome is assumed to be distributed according to a negative binomial distribution and the hypothesis to be tested is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AH_0%20:%20%5Ctheta%20=%20%5Cfrac%7B%5Clambda_1%7D%7B%5Clambda_2%7D%20=%20%5Cdelta_0%5C;,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Clambda_i"> are the mean rates (in one time unit) of a negative binomial distributed random variable <img src="https://latex.codecogs.com/png.latex?Y_%7Bijk%7D"> with overdispersion (shape) parameter <img src="https://latex.codecogs.com/png.latex?%5Cphi">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY_%7Bijk%7D%20%5Csim%20NB(t_%7Bijk%7D%5C,%5Clambda_i,%20%5Cphi)%5C,%20,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?t_%7Bijk%7D"> refers to the exposure time of subject <img src="https://latex.codecogs.com/png.latex?j"> in treatment group <img src="https://latex.codecogs.com/png.latex?i"> at interim stage <img src="https://latex.codecogs.com/png.latex?k"> of the group sequential test procedure (cf., Mütze et al., 2019). The expectation and variance of <img src="https://latex.codecogs.com/png.latex?Y_%7Bijk%7D"> are given by</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AE(Y_%7Bijk%7D)%20=%20t_%7Bijk%7D%5Clambda_i%20%5Cquad%20%5Ctext%7B%20and%20%7D%5Cquad%20Var(Y_%7Bijk%7D)%20=%20t_%7Bijk%7D%5Clambda_i%20+%20%5Cphi(t_%7Bijk%7D%5Clambda_i)%5E2,%0A"></p>
<p>respectively, i.e., the case <img src="https://latex.codecogs.com/png.latex?%5Cphi%20=%200"> refers to the case where <img src="https://latex.codecogs.com/png.latex?Y_%7Bijk%7D"> is Poisson distributed. For the fixed sample case, the index <img src="https://latex.codecogs.com/png.latex?k"> for the interim stage is omitted. In superiority trials, <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0%20=%201">, whereas, for non-inferiority trials, a positive non-inferiority margin <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0"> is specified.</p>
<p>In many cases, each subject is observed a given length of time, e.g., one year. In this case, <img src="https://latex.codecogs.com/png.latex?t_%7Bijk%7D%20%5Cequiv%20t">, and, as will be shown below, the sample size formulas described in the literature are applicable. If subjects entering the study have different exposure times, typically an accrual time is followed by an additional follow-up time. If subjects enter the study in an accrual period <img src="https://latex.codecogs.com/png.latex?%5B0;%5C,%20a%5D"> and the study time is <img src="https://latex.codecogs.com/png.latex?t_%7Bmax%7D">, at time point <img src="https://latex.codecogs.com/png.latex?t_k">, the time under exposure for subject <img src="https://latex.codecogs.com/png.latex?j"> in treatment <img src="https://latex.codecogs.com/png.latex?i"> at stage <img src="https://latex.codecogs.com/png.latex?k"> of the trial is <img src="https://latex.codecogs.com/png.latex?t_%7Bijk%7D%20=%20t_%7Bk%7D%20-%20a_%7Bij%7D"> with <img src="https://latex.codecogs.com/png.latex?t_K%20=%20t_%7Bmax%7D"> and <img src="https://latex.codecogs.com/png.latex?a_%7Bij%7D"> denoting the recruitment time for subject <img src="https://latex.codecogs.com/png.latex?j"> in treatment <img src="https://latex.codecogs.com/png.latex?i">. This more general approach is specifically necessary if the observation times at interim stages need to be estimated. This will also be illustrated by examples later on.</p>
<p>For group sequential designs, the test statistic is based on the Wald statistic, which is the difference of the rates on the log-scale divided by its standard error. As shown in Mütze et al.&nbsp;(2019), if Maximum Likelihood estimates are used to estimate the true parameters, the sequence of Wald statistics asymptotically has the independent and normally distributed increments property. For designs with interim stages, it is essential that interim analyses take place after specified amounts of information. The information level of the Wald statistic (the Fisher information) at stage <img src="https://latex.codecogs.com/png.latex?k"> is given by</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%7B%5Ccal%20I%7D_k%20=%20%5Cleft(%5Cfrac%7B1%7D%7B%0A%5Csum_%7Bj%20=%201%7D%5E%7Bn_1%7D%20%5Cfrac%7Bt_%7B1jk%7D%5Clambda_1%7D%7B1%20+%20%5Cphi%5C,t_%7B1jk%7D%5Clambda_1%7D%7D%20%20%0A+%20%5Cfrac%7B1%7D%7B%0A%5Csum_%7Bj%20=%201%7D%5E%7Bn_2%7D%5Cfrac%7Bt_%7B2jk%7D%5Clambda_2%7D%7B1%20+%20%5Cphi%5C,t_%7B2jk%7D%5Clambda_2%7D%7D%5Cright)%5E%7B-1%7D%5C;,%0A"> which simplifies to</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%7B%5Ccal%20I%7D%20=%0An_2%5C;%5Cleft(%5Cfrac%7B1%7D%7Bt%7D%20(%5Cfrac%7B1%7D%7B%5Clambda_2%7D%20+%20%5Cfrac%7B1%7D%7Br%5C,%5Clambda_1%7D)%20+%20%5Cphi%5C,(1%20+%20%5Cfrac%7B1%7D%7Br%7D)%5Cright)%5E%7B-1%7D%20%5C;,%0A"></p>
<p>if <img src="https://latex.codecogs.com/png.latex?t_%7Bijk%7D%20%5Cequiv%20t">, i.e., if all subjects have complete observations. From these terms, essentially, the sample size and other calculations for a count data type design are derived.</p>
<p>The sample size calculation to meet power <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta"> for two-sample comparisons is performed for</p>
<ul>
<li>for group sequential designs, the type of design (e.g., <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending),</li>
<li>an assumed <img src="https://latex.codecogs.com/png.latex?%5Clambda_1"> and <img src="https://latex.codecogs.com/png.latex?%5Clambda_2">,</li>
<li>assumed exposure times <img src="https://latex.codecogs.com/png.latex?t_%7Bijk%7D"> for treatment <img src="https://latex.codecogs.com/png.latex?i">, and subjects <img src="https://latex.codecogs.com/png.latex?j%20=%201,%5Cldots,n_i">, at interim stage <img src="https://latex.codecogs.com/png.latex?k">,</li>
<li>a planned allocation ratio <img src="https://latex.codecogs.com/png.latex?r%20=%20n_1/n_2">,</li>
<li>and an assumed overdispersion <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cgeq%200">.</li>
</ul>
</section>
<section id="rpact-functions-for-count-data" class="level1">
<h1>rpact Functions for Count Data</h1>
<p><code>getSampleSizeCounts()</code> performs sample size calculations for count data designs. You can specify</p>
<ul>
<li>a group sequential or a fixed sample size setting</li>
<li>either <img src="https://latex.codecogs.com/png.latex?%5Clambda_1"> and <img src="https://latex.codecogs.com/png.latex?%5Clambda_2">, or <img src="https://latex.codecogs.com/png.latex?%5Clambda_2"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, or the pooled <img src="https://latex.codecogs.com/png.latex?%5Clambda"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, the latter being essential for blinded sample size reassessment (SSR) procedures (see below). <img src="https://latex.codecogs.com/png.latex?%5Clambda_1"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> can be vectors</li>
<li>different ways of calculation: fixed exposure time, accrual and study time, or accrual and fixed number of subjects</li>
<li>staggered subjects entry</li>
</ul>
<p>The usage of the function (listing the parameters that can be specified) is as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb1-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>,</span>
<span id="cb1-3">    ...,</span>
<span id="cb1-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb1-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb1-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb1-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb1-16">)</span></code></pre></div></div>
</div>
<p>which will now be illustrated by examples.</p>
<p><code>getPowerCounts()</code> conversely calculates the power at given sample sizes, and essentially the same parameters can be specified.</p>
</section>
<section id="fixed-sample-size-designs-and-blinded-sample-size-reassessment" class="level1">
<h1>Fixed Sample Size Designs and Blinded Sample Size Reassessment</h1>
<section id="fixed-exposure-time" class="level2">
<h2 class="anchored" data-anchor-id="fixed-exposure-time">Fixed exposure time</h2>
<p>Consider the clinical trial in COPD subjects from Zhu and Lakkis (2014). Assume that a new therapy is assumed to decrease the exacerbation rate from 0.80 to 0.68 (15% decrease relative to control) within an observation period of 0.75 years, i.e., each subject has a equal follow-up of 0.75 years. Subjects are randomly allocated to treatment and control with equal allocation 1:1.</p>
<p>The sample size that yields 80% power for detecting such a difference, if the overdispersion is assumed to be equal to 0.4, is obtained as follows.</p>
<p>First, load the <a href="https://cran.r-project.org/package=rpact">rpact</a> package</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.5.0 or higher</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>The planned sample sizes are achieved by the following code:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">example1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>,</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb4-8">)</span></code></pre></div></div>
</div>
<p>The <code>example1$nFixed1</code> element is the number of subjects in the treatment group, <code>example1$nFixed2</code> refers to the number of subjects in the control group:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(example1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed1, example1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed2)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1316 1316</code></pre>
</div>
</div>
<p>and we conclude that N = 2632 subjects in total are needed to provide 80% power.</p>
<p>Conversely, <code>getPowerCounts()</code> performs the power calculation at given sample size, and note <code>directionUpper = FALSE</code> to specify that the power is directed for <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%3C%201">:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">example2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerCounts</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>,</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> example1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed</span>
<span id="cb7-9">)</span>
<span id="cb7-10">example2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.8000924</code></pre>
</div>
</div>
<p>The following graph illustrates the sample sizes for stronger effects <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. Note that for this plot only the lower and upper bound of <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> need to be specified:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>),</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb9-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb9-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_count_data_planning/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>In the fixed sample case this is the only available plot type (<code>type = 5</code>).</p>
<p>For <code>getPowerCounts()</code>, the only available plot type in the fixed sample case is <code>type = 7</code>. The following graph also illustrates how elements can be added to the <code>ggplot2</code> object:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerCounts</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> example1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed</span>
<span id="cb10-9">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb10-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">markdown =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power for count data design for varying effect"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_count_data_planning/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>The influence of the overdispersion parameter <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cgeq%200"> on the total sample size is illustrated in the following graph for increasing effect <img src="https://latex.codecogs.com/png.latex?%5Ctheta">:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb11-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (theta <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)) {</span>
<span id="cb11-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) {</span>
<span id="cb11-4">        results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(</span>
<span id="cb11-5">            results, </span>
<span id="cb11-6">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb11-7">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb11-8">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb11-9">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb11-10">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> theta,</span>
<span id="cb11-11">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb11-12">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb11-13">            ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb11-14">                <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>()</span>
<span id="cb11-15">        )</span>
<span id="cb11-16">    }</span>
<span id="cb11-17">}</span>
<span id="cb11-18"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(</span>
<span id="cb11-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> results,</span>
<span id="cb11-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> overdispersion, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> nFixed, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> theta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.factor</span>(theta))</span>
<span id="cb11-21">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Overdispersion"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total sample size"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Theta"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>()</span></code></pre></div></div>
<p><img src="https://www.rpact.org/vignettes/planning/rpact_count_data_planning/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid" width="672"></p>
<p>Zhu and Lakkis (2014) proposed three methods for calculating the sample size and the methodology implemented in <a href="https://cran.r-project.org/package=rpact">rpact</a> refers to the M2 method described in their paper. The M2 method corresponds to the sample size formulas given in, e.g., Friede and Schmidli (2010a, 2010b) and Mütze et al (2019). It is in fact easy to recalculate the sample sizes in Table 1 of their paper:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb12-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)) {</span>
<span id="cb12-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (theta <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>)) {</span>
<span id="cb12-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lambda2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)) {</span>
<span id="cb12-5">            results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(results, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb12-6">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb12-7">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb12-8">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> lambda2,</span>
<span id="cb12-9">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> theta,</span>
<span id="cb12-10">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb12-11">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb12-12">            )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed1)</span>
<span id="cb12-13">        }</span>
<span id="cb12-14">    }</span>
<span id="cb12-15">}</span>
<span id="cb12-16"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span></code></pre></div></div>
<p>1316, 1101, 957, 854, 1574, 1324, 1157, 1037, 1494, 1279, 1135, 1033, 1815, 1565, 1398, 1278, 1673, 1457, 1313, 1211, 2056, 1806, 1639, 1520, 1970, 1754, 1611, 1508, 2458, 2208, 2041, 1921</p>
<p>Similarly, Table 2 results (column M2) with varying allocation between the treatment arms can be reconstructed by</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb13-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)) {</span>
<span id="cb13-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (theta <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)) {</span>
<span id="cb13-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lambda2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)) {</span>
<span id="cb13-5">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) {</span>
<span id="cb13-6">                results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(results, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb13-7">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb13-8">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb13-9">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> lambda2,</span>
<span id="cb13-10">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> theta,</span>
<span id="cb13-11">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb13-12">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> r,</span>
<span id="cb13-13">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb13-14">                )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed)</span>
<span id="cb13-15">            }</span>
<span id="cb13-16">        }</span>
<span id="cb13-17">    }</span>
<span id="cb13-18">}</span>
<span id="cb13-19"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span></code></pre></div></div>
<p>124, 116, 117, 90, 86, 88, 80, 76, 79, 280, 272, 287, 232, 224, 235, 215, 208, 217, 395, 376, 389, 363, 348, 360, 352, 338, 350, 1075, 1036, 1082, 1027, 988, 1030, 1012, 972, 1013</p>
<p>Slight deviations resulting from rounding errors.</p>
</section>
<section id="optimum-allocation-ratio" class="level2">
<h2 class="anchored" data-anchor-id="optimum-allocation-ratio">Optimum allocation ratio</h2>
<p>With the <code>getSampleSizeCounts()</code> function, it is easy to determine the allocation ratio that provides the smallest overall sample size at given power <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cbeta">. This can be done by setting <code>allocationRatioPlanned = 0</code>. In the example from above,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">example3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>,</span>
<span id="cb14-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb14-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb14-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb14-9">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">example3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>allocationRatioPlanned</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1.068791</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">example3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2629</code></pre>
</div>
</div>
<p>calculates the optimum allocation ratio to be equal to 1.069, thereby reducing the necessary sample size only very slightly from 2632 to 2629. With this result, it might not be reasonable at all to deviate from a planned 1:1 allocation.</p>
</section>
<section id="usage-in-blinded-sample-size-reestimation-ssr" class="level2">
<h2 class="anchored" data-anchor-id="usage-in-blinded-sample-size-reestimation-ssr">Usage in blinded sample size reestimation (SSR)</h2>
<p>Friede and Schmidli (2010a, 2010b) consider blinded SSR procedures with count data. They show that blinded SSR to reestimate the overdispersion parameter maintains the required power without increasing the Type I error rate. The procedure is simply to calculate the overdispersion at interim in a blinded manner and to recalculate the sample size with a pooled event rate estimate and <em>under the assumption of the originally assumed effect</em>.</p>
<p>For example, if in the situation from above, the overdispersion was estimated from the pooled sample to be, say, 0.352, and the overall event rate is estimated as <img src="https://latex.codecogs.com/png.latex?%5Chat%5Clambda%20=%200.921">, the recalculated sample size is</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">example4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb19-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb19-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb19-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.921</span>,</span>
<span id="cb19-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>,</span>
<span id="cb19-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.352</span>,</span>
<span id="cb19-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb19-8">)</span>
<span id="cb19-9">example4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2152</code></pre>
</div>
</div>
<p>thus reducing the necessary sample size from 2632 to 2152. Note that, of course, it is important when the interim review is performed. If it is done early, the nuisance parameters <img src="https://latex.codecogs.com/png.latex?%5Clambda"> and <img src="https://latex.codecogs.com/png.latex?%5Cphi"> cannot be estimated with sufficient precision, if it is done very late, the recalculated sample size might be smaller than the already obtained sample size. This of course also has an impact on the test characteristics and might be investigated by simulations (Friede and Schmidli, 2010a). Methods for blinded estimation are compared by Schneider et al.&nbsp;(2013).</p>
<p>For checking the results of <a href="https://cran.r-project.org/package=rpact">rpact</a>, the sample sizes in Table 1 from Friede and Schmidli (2010b) can be reconstructed by</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb21-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (theta <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)) {</span>
<span id="cb21-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)) {</span>
<span id="cb21-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lambda <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) {</span>
<span id="cb21-5">            results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(results, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb21-6">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb21-7">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb21-8">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> lambda,</span>
<span id="cb21-9">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> theta,</span>
<span id="cb21-10">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb21-11">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb21-12">            )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed2)</span>
<span id="cb21-13">        }</span>
<span id="cb21-14">    }</span>
<span id="cb21-15">}</span>
<span id="cb21-16"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span></code></pre></div></div>
<p>177, 135, 114, 190, 147, 126, 202, 159, 138, 446, 339, 286, 477, 371, 318, 509, 402, 349</p>
<p>and</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb22-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (theta <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)) {</span>
<span id="cb22-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)) {</span>
<span id="cb22-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lambda <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) {</span>
<span id="cb22-5">            results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(results, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb22-6">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb22-7">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb22-8">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> lambda,</span>
<span id="cb22-9">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> theta,</span>
<span id="cb22-10">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb22-11">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb22-12">            )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed2)</span>
<span id="cb22-13">        }</span>
<span id="cb22-14">    }</span>
<span id="cb22-15">}</span>
<span id="cb22-16"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span></code></pre></div></div>
<p>237, 180, 152, 254, 197, 168, 270, 213, 185, 597, 454, 383, 639, 496, 425, 681, 539, 467</p>
<p>Slight deviations resulting from rounding errors.</p>
</section>
<section id="the-non-inferiority-case" class="level2">
<h2 class="anchored" data-anchor-id="the-non-inferiority-case">The non-inferiority case</h2>
<p>For the non-inferiority case, a non-inferiority margin <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0"> needs to be specified and entered as <code>thetaH0</code>. Typically, as the planning alternative, no difference in the event rates is assumed between the treatment groups (i.e., <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%201">). In that case, the control arm sample sizes from Table 2 and Table 3 from Friede and Schmidli (2010b) are obtained with</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb23-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (delta0 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>)) {</span>
<span id="cb23-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (phi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)) {</span>
<span id="cb23-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lambda <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) {</span>
<span id="cb23-5">            results <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(results, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb23-6">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb23-7">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb23-8">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> lambda,</span>
<span id="cb23-9">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb23-10">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> delta0,</span>
<span id="cb23-11">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> phi,</span>
<span id="cb23-12">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb23-13">            )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed2)</span>
<span id="cb23-14">        }</span>
<span id="cb23-15">    }</span>
<span id="cb23-16">}</span>
<span id="cb23-17"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(results, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span></code></pre></div></div>
<p>1126, 858, 724, 1206, 938, 804, 1286, 1018, 885, 662, 504, 426, 709, 551, 473, 756, 599, 520</p>
</section>
</section>
<section id="designs-with-interim-stages" class="level1">
<h1>Designs with Interim Stages</h1>
<p>We will now consider count data designs with interim stages. First, you need to specify the design which is here defined as an O’Brien and Fleming alpha spending function design with interim analyses planned after 40% and 70% of the information:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb24-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb24-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb24-4">)</span></code></pre></div></div>
</div>
<section id="fixed-exposure-time-1" class="level2">
<h2 class="anchored" data-anchor-id="fixed-exposure-time-1">Fixed exposure time</h2>
<p>Suppose study subjects are observed with fixed exposure time of 12 months and have event rates 0.2 and 0.3 in the treatment and the control arm, respectively, with an overdispersion parameter equal to 1. Specify these parameters as follows to obtain the summary:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb25-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb25-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb25-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb25-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb25-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb25-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb25-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sample size calculation for a count data endpoint</em></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample Wald-test for count data, H0: lambda(1) / lambda(2) = 1, H1: effect = 0.667, lambda(1) = 0.2, lambda(2) = 0.3, overdispersion = 1.5, fixed exposure time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>40%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0004</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0004</td>
<td>0.0073</td>
<td>0.0227</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.357</td>
<td>2.445</td>
<td>2.001</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.459</td>
<td>0.658</td>
<td>0.752</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0580</td>
<td>0.4682</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Maximum number of subjects</td>
<td>360.0</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Information over stages</td>
<td>19.4</td>
<td>33.9</td>
<td>48.5</td>
</tr>
<tr class="odd">
<td>Expected information under H0</td>
<td></td>
<td></td>
<td>48.4</td>
</tr>
<tr class="even">
<td>Expected information under H0/H1</td>
<td></td>
<td></td>
<td>46.9</td>
</tr>
<tr class="odd">
<td>Expected information under H1</td>
<td></td>
<td></td>
<td>40.8</td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0004</td>
<td>0.0070</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0580</td>
<td>0.4102</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>This summary displays the maximum amount of information (<code>round(example5$maxInformation, 2) =</code> 48.47) that needs to be achieved with N = 360 subjects together with stopping probabilities under <img src="https://latex.codecogs.com/png.latex?H_0">, midway between <img src="https://latex.codecogs.com/png.latex?H_0"> and <img src="https://latex.codecogs.com/png.latex?H_1">, under <img src="https://latex.codecogs.com/png.latex?H_1">, and stopping probabilities under <img src="https://latex.codecogs.com/png.latex?H_0"> and <img src="https://latex.codecogs.com/png.latex?H_1"> if interim analyses are performed at <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20I%7D_1%20="> 19.39 and <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20I%7D_2%20="> 33.93, and the final analysis at <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20I%7D_3%20="> 48.47.</p>
<p>If non-binding futility stops are planned, these might be derived from an O’Brien and Fleming beta spending function with <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.2">, i.e., the following design as displayed in the graph below:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">designFutility <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb26-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb26-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb26-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb26-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span>,</span>
<span id="cb26-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb26-7">)</span>
<span id="cb26-8">designFutility <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb26-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_count_data_planning/index_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>This yields the following test characteristics with additional futility stop probabilities, resulting in a slightly higher number of subjects and increased information levels necessary to achieve power 80%:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb27-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designFutility,</span>
<span id="cb27-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb27-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb27-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb27-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb27-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb27-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sample size calculation for a count data endpoint</em></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample Wald-test for count data, H0: lambda(1) / lambda(2) = 1, H1: effect = 0.667, lambda(1) = 0.2, lambda(2) = 0.3, overdispersion = 1.5, fixed exposure time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>40%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0004</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0427</td>
<td>0.1256</td>
<td>0.2000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0004</td>
<td>0.0073</td>
<td>0.0227</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>3.357</td>
<td>2.445</td>
<td>2.001</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>0.152</td>
<td>1.267</td>
<td></td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.476</td>
<td>0.670</td>
<td>0.762</td>
</tr>
<tr class="even">
<td>Futility boundary (t)</td>
<td>0.968</td>
<td>0.814</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0688</td>
<td>0.5133</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Maximum number of subjects</td>
<td>394.0</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Information over stages</td>
<td>21.3</td>
<td>37.3</td>
<td>53.3</td>
</tr>
<tr class="even">
<td>Expected information under H0</td>
<td></td>
<td></td>
<td>29.8</td>
</tr>
<tr class="odd">
<td>Expected information under H0/H1</td>
<td></td>
<td></td>
<td>39.4</td>
</tr>
<tr class="even">
<td>Expected information under H1</td>
<td></td>
<td></td>
<td>41.3</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.5608</td>
<td>0.3491</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.1115</td>
<td>0.5274</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0004</td>
<td>0.0070</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0688</td>
<td>0.4446</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.5604</td>
<td>0.3421</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.0427</td>
<td>0.0829</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="estimate-observation-time-under-uniform-recruitment" class="level2">
<h2 class="anchored" data-anchor-id="estimate-observation-time-under-uniform-recruitment">Estimate observation time under uniform recruitment</h2>
<p>Similar to survival designs (see, e.g., <a href="https://vignettes.rpact.com/html/rpact_survival_planning_example.html">Planning a Survival Trial with rpact</a>) it is possible with the <code>getSampleSizeCounts()</code> function to calculate calendar times where the information is estimated to be observed under the given parameters.</p>
<p>For the first case, suppose there is uniform recruitment of subjects over 6 months, and subjects <em>are followed for a prespecified time period which is identical for all subjects</em> as above. Specify <code>accrualTime = 6</code> as an additional function parameter and obtain the following summary:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">example7 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb28-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designFutility,</span>
<span id="cb28-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb28-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb28-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb28-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fixedExposureTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb28-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb28-8">)</span>
<span id="cb28-9">example7 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb28-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sample size calculation for a count data endpoint</em></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample Wald-test for count data, H0: lambda(1) / lambda(2) = 1, H1: effect = 0.667, lambda(1) = 0.2, lambda(2) = 0.3, overdispersion = 1.5, fixed exposure time = 12, accrual time = 6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>40%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0004</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0427</td>
<td>0.1256</td>
<td>0.2000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0004</td>
<td>0.0073</td>
<td>0.0227</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>3.357</td>
<td>2.445</td>
<td>2.001</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>0.152</td>
<td>1.267</td>
<td></td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.429</td>
<td>0.670</td>
<td>0.762</td>
</tr>
<tr class="even">
<td>Futility boundary (t)</td>
<td>0.964</td>
<td>0.814</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0688</td>
<td>0.5133</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>308.0</td>
<td>394.0</td>
<td>394.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>384.4</td>
</tr>
<tr class="even">
<td>Calendar time</td>
<td>4.70</td>
<td>7.11</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>10.77</td>
</tr>
<tr class="even">
<td>Information over stages</td>
<td>21.3</td>
<td>37.3</td>
<td>53.3</td>
</tr>
<tr class="odd">
<td>Expected information under H0</td>
<td></td>
<td></td>
<td>29.8</td>
</tr>
<tr class="even">
<td>Expected information under H0/H1</td>
<td></td>
<td></td>
<td>39.4</td>
</tr>
<tr class="odd">
<td>Expected information under H1</td>
<td></td>
<td></td>
<td>41.3</td>
</tr>
<tr class="even">
<td>Overall exit probability (under H0)</td>
<td>0.5608</td>
<td>0.3491</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H1)</td>
<td>0.1115</td>
<td>0.5274</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0004</td>
<td>0.0070</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0688</td>
<td>0.4446</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H0)</td>
<td>0.5604</td>
<td>0.3421</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H1)</td>
<td>0.0427</td>
<td>0.0829</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>You might also use the <a href="https://cran.r-project.org/package=gscounts">gscounts</a> package in order to obtain very similar results. The relevant functionality for count data, however, is included in <a href="https://cran.r-project.org/package=rpact">rpact</a> and the maintainer of <code>gscounts</code> encourages the use of <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
</section>
<section id="sample-size-for-variable-exposure-time-with-uniform-recruitment" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-for-variable-exposure-time-with-uniform-recruitment">Sample size for variable exposure time with uniform recruitment</h2>
<p>A different situation is given if subjects <em>have varying exposure time</em>. For this setting, assume we again have uniform recruitment of subjects over 6 months, but the study ends 12 months after the last subject entered the study. That is, the study is planned to be conducted in 18 months, having subjects that are observed (i.e., under exposure) between 12 and 18 months.</p>
<p>In order to perform the sample size calculation for this case, instead of <code>fixedExposureTime</code>, the parameter <code>followUpTime</code> has to specified. It is the assumed (additional) follow-up time for the study and so the total study duration is <code>accrualTime + followUpTime</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">example8 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb29-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designFutility,</span>
<span id="cb29-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb29-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb29-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb29-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>,</span>
<span id="cb29-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb29-8">)</span>
<span id="cb29-9">example8 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb29-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sample size calculation for a count data endpoint</em></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample Wald-test for count data, H0: lambda(1) / lambda(2) = 1, H1: effect = 0.667, lambda(1) = 0.2, lambda(2) = 0.3, overdispersion = 1.5, accrual time = 6, follow-up time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>40%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0004</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0427</td>
<td>0.1256</td>
<td>0.2000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0004</td>
<td>0.0073</td>
<td>0.0227</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>3.357</td>
<td>2.445</td>
<td>2.001</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>0.152</td>
<td>1.267</td>
<td></td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.437</td>
<td>0.670</td>
<td>0.762</td>
</tr>
<tr class="even">
<td>Futility boundary (t)</td>
<td>0.964</td>
<td>0.814</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0688</td>
<td>0.5133</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>304.0</td>
<td>380.0</td>
<td>380.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>371.5</td>
</tr>
<tr class="even">
<td>Calendar time</td>
<td>4.81</td>
<td>7.42</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>10.95</td>
</tr>
<tr class="even">
<td>Information over stages</td>
<td>21.3</td>
<td>37.3</td>
<td>53.3</td>
</tr>
<tr class="odd">
<td>Expected information under H0</td>
<td></td>
<td></td>
<td>29.8</td>
</tr>
<tr class="even">
<td>Expected information under H0/H1</td>
<td></td>
<td></td>
<td>39.4</td>
</tr>
<tr class="odd">
<td>Expected information under H1</td>
<td></td>
<td></td>
<td>41.3</td>
</tr>
<tr class="even">
<td>Overall exit probability (under H0)</td>
<td>0.5608</td>
<td>0.3491</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H1)</td>
<td>0.1115</td>
<td>0.5274</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0004</td>
<td>0.0070</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0688</td>
<td>0.4446</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H0)</td>
<td>0.5604</td>
<td>0.3421</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H1)</td>
<td>0.0427</td>
<td>0.0829</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>As expected, the maximum number of subjects is a bit lower (380 vs.&nbsp;394), having also different calendar time estimates.</p>
<!-- With `gscounts` essentially the same results are obtained through -->
</section>
<section id="calculate-study-duration-given-recruitment-times-and-non-uniform-recruitment" class="level2">
<h2 class="anchored" data-anchor-id="calculate-study-duration-given-recruitment-times-and-non-uniform-recruitment">Calculate study duration given recruitment times and non-uniform recruitment</h2>
<p>In <code>getSampleSizeCounts()</code>, you can specify <code>maxNumberOfSubjects</code> or <code>accrualTime</code> and <code>acrualIntensity</code> and find the study time, i.e., the necessary follow-up time in order to achieve the required information levels. For example, one can calculate how long the study duration should be if subject recruitment is performed over 7.5 months instead of 6 months, i.e., if 475 instead of 380 subjects will be recruited:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">example9 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb30-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designFutility,</span>
<span id="cb30-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb30-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb30-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb30-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>,</span>
<span id="cb30-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> example8<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects</span>
<span id="cb30-8">)</span>
<span id="cb30-9">example9<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>calendarTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 4.799704
[2,] 7.031870
[3,] 9.979368</code></pre>
</div>
</div>
<p>You might also specify the parameter <code>accrualIntensity</code> that describes the <em>number of subjects per time unit</em> in order to obtain the same result:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">example10 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeCounts</span>(</span>
<span id="cb32-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designFutility,</span>
<span id="cb32-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb32-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overdispersion =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb32-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>),</span>
<span id="cb32-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> example8<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span>
<span id="cb32-8">)</span>
<span id="cb32-9">example10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>calendarTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>          [,1]
[1,]  4.815717
[2,]  7.044306
[3,] 10.015182</code></pre>
</div>
</div>
<p>Since <code>accrualTime</code> and <code>accrualIntensity</code> can be defined as vectors, it is also possible to define a non-uniform recruitment scheme and investigate the influence on the estimated parameters.</p>
<p>As an important note, the Fisher information used for the calendar time calculation is bounded for <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%3E%200"> and varying time point. Therefore, it might happen that the numerical search algorithm fails, there is no derivable observation time, and an error message is displayed. For <img src="https://latex.codecogs.com/png.latex?%5Cphi%20=%200">, this problem does not occur.</p>
</section>
</section>
<section id="references" class="level1">
<h1>References</h1>
<p>Friede, T., Schmidli, H. (2010a). Blinded sample size reestimation with count data: methods and applications in multiple sclerosis. <em>Statistics in Medicine</em>, 29, 1145-1156. <a href="https://doi.org/10.1002/sim.3861" class="uri">https://doi.org/10.1002/sim.3861</a></p>
<p>Friede, T., Schmidli, H. (2010b). Blinded sample size reestimation with negative binomial counts in superiority and non-inferiority trials. <em>Methods of Information in Medicine</em>, 49, 618-624. <a href="https://doi.org/10.3414/ME09-02-0060" class="uri">https://doi.org/10.3414/ME09-02-0060</a></p>
<p>Mütze, T., Glimm, E., Schmidli, H., Friede, T. (2019). Group sequential designs for negative binomial outcomes. <em>Statistical Methods in Medical Research</em>, 28(8), 2326-2347. <a href="https://doi.org/10.1177/0962280218773115" class="uri">https://doi.org/10.1177/0962280218773115</a></p>
<p>Schneider, S., Schmidli, H., Friede, T. (2013). Robustness of methods for blinded sample size re‐estimation with overdispersed count data. Statistics in Medicine, 32(21), 3623-3653. <a href="https://doi.org/10.1002/sim.5800" class="uri">https://doi.org/10.1002/sim.5800</a></p>
<p>Wassmer, G and Brannath, W. <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em> (2016), ISBN 978-3319325606 <a href="https://doi.org/10.1007/978-3-319-32562-0" class="uri">https://doi.org/10.1007/978-3-319-32562-0</a></p>
<p>Zhu, H., Lakkis, H. (2014). Sample size calculation for comparing two negative binomial rates. <em>Statistics in Medicine</em>, 33, 376-387. <a href="https://doi.org/10.1002/sim.5947" class="uri">https://doi.org/10.1002/sim.5947</a></p>
<hr>
<p><em>System</em> rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), <em>platform</em> x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Count Data</category>
  <category>Rates</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_count_data_planning/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_27.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Designing Group Sequential Trials with Two Groups and a Continuous Endpoint with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Dietmar Volz](# &quot;Dietmar Volz&quot;) [](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_continuous_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>These examples are not intended to replace the official <a href="https://cran.r-project.org/package=rpact">rpact</a> documentation and help pages but rather to supplement them. They also only cover a selection of all <a href="https://cran.r-project.org/package=rpact">rpact</a> features.</p>
<p>General convention: In <a href="https://cran.r-project.org/package=rpact">rpact</a>, arguments containing the <strong>index “2”</strong> always refer to the <strong>control group</strong>, <strong>“1”</strong> refer to the <strong>intervention group</strong>, and <strong>treatment effects compare treatment versus control</strong>.</p>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="sample-size-calculation-for-a-superiority-trial-without-interim-analyses" class="level1">
<h1>Sample size calculation for a superiority trial without interim analyses</h1>
<p>The <strong>sample size</strong> for a single-stage trial with continuous endpoints can be calculated using the function <code>getSampleSizeMeans()</code>. This function is fully documented in the relevant help page (<code>?getSampleSizeMeans</code>). Some examples are provided below.</p>
<p><code>getSampleSizeMeans()</code> requires that the mean difference between the two arms is larger under the alternative than under the null hypothesis. For superiority trials, this implies that <strong><a href="https://cran.r-project.org/package=rpact">rpact</a> requires that the targeted mean difference is &gt;0 under the alternative hypothesis</strong>. If this is not the case, the function produces an error message. To circumvent this and power for a negative mean difference, <strong>one can simply switch the two arms</strong> (leading to a positive mean difference) as the situation is perfectly symmetric.</p>
<p>By default, <code>getSampleSizeMeans()</code> tests hypotheses about the mean difference. <a href="https://cran.r-project.org/package=rpact">rpact</a> also supports testing hypotheses about mean ratios if the argument <code>meanRatio</code> is set to <code>TRUE</code> but this will not be discussed further in this document.</p>
<p>By default, <a href="https://cran.r-project.org/package=rpact">rpact</a> uses sample size formulas for the <img src="https://latex.codecogs.com/png.latex?t">-test, i.e., it assumes that the standard deviation in the two groups is equal but unknown and estimated from the data. If sample size calculations for the <img src="https://latex.codecogs.com/png.latex?z">-test are desired, one can set the argument <code>normalApproximation</code> to <code>TRUE</code> but this is usually not recommended.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example of a standard trial:</span></span>
<span id="cb3-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - targeted mean difference is 10 (alternative = 10)</span></span>
<span id="cb3-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - standard deviation in both arms is assumed to be 24 (stDev = 24)</span></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - two-sided test (sided = 2), Type I error 0.05 (alpha = 0.05) and power 80%</span></span>
<span id="cb3-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - (beta = 0.2)</span></span>
<span id="cb3-6">sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, </span>
<span id="cb3-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb3-12">)</span>
<span id="cb3-13">sampleSizeResult</span></code></pre></div></div>
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Two-sided power</em>: FALSE</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: two-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 10</li>
<li><em>Standard deviation</em>: 24</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Lower critical values (treatment effect scale)</em>: -Inf</li>
<li><em>Upper critical values (treatment effect scale)</em>: 7.006</li>
<li><em>Number of subjects fixed</em>: 182.8</li>
<li><em>Number of subjects fixed (1)</em>: 91.4</li>
<li><em>Number of subjects fixed (2)</em>: 91.4</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
<p>The generic <code>summary()</code> function produces the output</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 10, standard deviation = 24.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-7.006</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>7.006</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>182.8</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>As per the output above, the required <strong>total sample size</strong> for the trial is 183 (184, when strictly adhering to equal group sizes) and the critical value corresponds to a minimal detectable mean difference of approximately 7.01.</p>
<p>Unequal randomization between the treatment groups can be defind with <code>allocationRatioPlanned</code>, for example,</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extension of standard trial:</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - 2(intervention):1(control) randomization (allocationRatioPlanned = 2)</span></span>
<span id="cb5-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>,</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb5-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb5-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb5-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 10, standard deviation = 24, planned allocation ratio = 2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-7.004</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>7.004</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>205.4</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p><strong>Power</strong> for a given sample size can be calculated using the function <code>getPowerMeans()</code> which has the same arguments as <code>getSampleSizeMeans()</code> except that the maximum total sample is given (<code>maxNumberOfSubjects</code>) instead of the Type II error (<code>beta</code>).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate power for the 2:1 randomized trial with total sample size 206</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (as above) assuming a larger difference of 12</span></span>
<span id="cb6-3">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, </span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">206</span>, </span>
<span id="cb6-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb6-10">)</span>
<span id="cb6-11">powerResult</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Test</em>: two-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 12</li>
<li><em>Standard deviation</em>: 24, 24</li>
<li><em>Planned allocation ratio</em>: 2</li>
<li><em>Maximum number of subjects</em>: 206</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Effect</em>: 12</li>
</ul>
<p><strong>Power and output</strong></p>
<ul>
<li><em>Overall reject</em>: 0.9203</li>
<li><em>Lower critical values (treatment effect scale)</em>: -Inf</li>
<li><em>Upper critical values (treatment effect scale)</em>: 6.994</li>
<li><em>Number of subjects fixed</em>: 206</li>
<li><em>Number of subjects fixed (1)</em>: 137.3</li>
<li><em>Number of subjects fixed (2)</em>: 68.7</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>The calculated <strong>power</strong> is provided in the output as <strong>“Overall reject”</strong> and is 0.92 for the example <code>alternative = 12</code>.</p>
<p>The <code>summary()</code> function produces</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">powerResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 12, standard deviation = 24, number of subjects = 206, planned allocation ratio = 2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-6.994</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>6.994</td>
</tr>
<tr class="odd">
<td>Power</td>
<td>0.9203</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>206.0</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p><code>getPowerMeans()</code> (as well as <code>getSampleSizeMeans()</code>) can also be called with a vector argument for the mean difference under the alternative H1 (<code>alternative</code>). This is illustrated below via a plot of power depending on these values. For examples of all available plots, see the R Markdown document <a href="https://www.rpact.org/vignettes/utilities/rpact_plot_examples">How to create admirable plots with rpact</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Calculate power for design with sample size 206 as above</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alternative values ranging from 5 to 15</span></span>
<span id="cb8-3">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, </span>
<span id="cb8-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, </span>
<span id="cb8-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb8-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb8-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">206</span>, </span>
<span id="cb8-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb8-10">)</span>
<span id="cb8-11">powerResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one of several possible plots</span></span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_continuous_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-size-calculation-for-a-non-inferiority-trial-without-interim-analyses" class="level1">
<h1>Sample size calculation for a non-inferiority trial without interim analyses</h1>
<p>The sample size calculation proceeds in the same fashion as for superiority trials except that the role of the null and the alternative hypothesis are reversed and the test is always one-sided. In this case, the non-inferiority margin <img src="https://latex.codecogs.com/png.latex?%5CDelta"> corresponds to the treatment effect under the null hypothesis (<code>thetaH0</code>) which one aims to reject.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Non-inferiority trial with margin delta = 12, standard deviation = 14</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - One-sided alpha = 0.05, 1:1 randomization</span></span>
<span id="cb9-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - H0: treatment difference &lt;= -12 (i.e., = -12 for calculations, thetaH0 = -12)</span></span>
<span id="cb9-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    vs. alternative H1: treatment difference = 0 (alternative = 0)</span></span>
<span id="cb9-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, </span>
<span id="cb9-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb9-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb9-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb9-12">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 0</li>
<li><em>Standard deviation</em>: 14</li>
<li><em>Theta H0</em>: -12</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Critical values (treatment effect scale)</em>: -3.556</li>
<li><em>Number of subjects fixed</em>: 44.7</li>
<li><em>Number of subjects fixed (1)</em>: 22.4</li>
<li><em>Number of subjects fixed (2)</em>: 22.4</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
<section id="sample-size-calculation-for-group-sequential-designs" class="level1">
<h1>Sample size calculation for group sequential designs</h1>
<p>Sample size calculation for a group sequential trials is performed in <strong>two steps</strong>:</p>
<ol type="1">
<li><strong>Define the (abstract) group sequential design</strong> using the function <code>getDesignGroupSequential()</code>. For details regarding this step, see the R markdown file <a href="https://rpact.com/vignettes/rpact_boundary_examples">Defining group sequential boundaries with rpact</a>.</li>
<li><strong>Calculate sample size</strong> for the continuous endpoint by feeding the abstract design into the function <code>getSampleSizeMeans()</code>.</li>
</ol>
<p>In general, <a href="https://cran.r-project.org/package=rpact">rpact</a> supports both one-sided and two-sided group sequential designs. However, if futility boundaries are specified, only one-sided tests are permitted. <strong>For simplicity, it is often preferred to use one-sided tests for group sequential designs</strong> (typically, with <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">).</p>
<p>R code for a simple example is provided below:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Group-sequential design with  O'Brien &amp; Fleming type alpha-spending</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and one interim at 60% information</span></span>
<span id="cb10-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb10-9">)</span>
<span id="cb10-10"></span>
<span id="cb10-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Trial assumes an effect size of 10 as above, a stDev = 24, and an allocation</span></span>
<span id="cb10-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ratio of 2</span></span>
<span id="cb10-13">sampleSizeResultGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb10-14">    design,</span>
<span id="cb10-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb10-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, </span>
<span id="cb10-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb10-18">)</span>
<span id="cb10-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Standard rpact output (sample size object only, not design object)</span></span>
<span id="cb10-20">sampleSizeResultGS</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.600, 1.000</li>
<li><em>Critical values</em>: 2.669, 1.981</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.003808, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.003808, 0.023798</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 10</li>
<li><em>Standard deviation</em>: 24</li>
<li><em>Planned allocation ratio</em>: 2</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 207.1</li>
<li><em>Maximum number of subjects (1)</em>: 138.1</li>
<li><em>Maximum number of subjects (2)</em>: 69</li>
<li><em>Number of subjects [1]</em>: 124.3</li>
<li><em>Number of subjects [2]</em>: 207.1</li>
<li><em>Number of subjects (1) [1]</em>: 82.9</li>
<li><em>Number of subjects (1) [2]</em>: 138.1</li>
<li><em>Number of subjects (2) [1]</em>: 41.4</li>
<li><em>Number of subjects (2) [2]</em>: 69</li>
<li><em>Expected number of subjects under H0</em>: 206.8</li>
<li><em>Expected number of subjects under H0/H1</em>: 202.4</li>
<li><em>Expected number of subjects under H1</em>: 181.3</li>
<li><em>Reject per stage [1]</em>: 0.3123</li>
<li><em>Reject per stage [2]</em>: 0.4877</li>
<li><em>Early stop</em>: 0.3123</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 12.393</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 7.050</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summary rpact output for sample size object</span></span>
<span id="cb11-2">sampleSizeResultGS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 10, standard deviation = 24, planned allocation ratio = 2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>60%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0038</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0038</td>
<td>0.0238</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.669</td>
<td>1.981</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>12.393</td>
<td>7.050</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.3123</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>124.3</td>
<td>207.1</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>181.3</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0038</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.3123</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Means</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_continuous_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_09.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Simulating Multi-Arm Designs with a Continuous Endpoint using rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>This document provides examples for simulating multi-arm multi-stage (MAMS) designs for testing means in many-to-one comparisons. For designs with multiple arms, <a href="https://cran.r-project.org/package=rpact">rpact</a> enables the simulation of designs that use the <strong>closed combination testing principle</strong>. For a description of the methodology please refer to Part III of the book <a href="https://doi.org/10.1007%2F978-3-319-32562-0">“Group Sequential and Confirmatory Adaptive Designs in Clinical Trials”</a> by Gernot Wassmer &amp; Werner Brannath. Essentially, we show in this vignette how to reproduce part of the simulation results provided in the paper <a href="https://doi.org/10.1080/10543406.2011.551336">“On Sample Size Determination in Multi-Arm Confirmatory Adaptive Designs”</a> by Gernot Wassmer (Journal of Biopharmaceutical Statistics, 2011).</p>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0.1 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="sample-size-calculation-for-the-adaptive-multi-arm-situation" class="level1">
<h1>Sample size calculation for the adaptive multi-arm situation</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> enables the assessment of sample sizes in multiple arms including selection of treatment arms. We will first consider the simple case of a two-stage design with O’Brien &amp; Fleming boundaries assuming three active treatment arms which are tested against control. Let the three treatment arms be referring to three different and increasing doses, say, “low”, “medium”, and “high”. We assume that the highest dose will have response difference <img src="https://latex.codecogs.com/png.latex?10"> as compared to control, and that there will be a linear dose-response relationship. The standard deviation is assumed to be <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%2015">. At interim, the treatment arm with the highest observed response as compared to placebo is selected for testing at the second stage.</p>
<p>One way to adjust for the multiple comparison situation is to use the Bonferroni correction for testing the intersection tests in the closed system of hypotheses. It will show that using <img src="https://latex.codecogs.com/png.latex?%5Calpha/3"> instead of <img src="https://latex.codecogs.com/png.latex?%5Calpha"> for the sample size calculation for the highest dose in the two-arm fixed sample size case can serve as a reasonable first guess for the sample size for the multi-arm case. That is, for <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> and power <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cbeta%20=%2090%5C%25"> we calculate the sample size using the commands</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">nsFixed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb3-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, </span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb3-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>)</span>
<span id="cb3-6">nsFixed <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 0.83%, power 90%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = 10, standard deviation = 15.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0083</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.394</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>6.526</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>124.5</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>yielding 125 as the total number of subjects and hence n = 63 subjects per treatment arm in order to achieve the desired power. As a first guess for the multi-arm two-stage case, we choose 30 subjects per stage and treatment arm and use the following commands for evaluating the MAMS design. Note that <code>plannedSubjects</code> refers to the <strong>cumulative sample sizes over the stages per selected active arm</strong>. The sample size of the control group can be specified via the argument <code>allocationRatioPlanned</code>. Here, we use the default value <code>allocationRatioPlanned = 1</code>, i.e., the same sample size for the control group as for each active treatment arm.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb4-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb4-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb4-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>)</span>
<span id="cb4-5">maxNumberOfIterations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb4-6">simBonfMAMS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb4-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb4-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb4-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb4-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb4-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bonferroni"</span>,</span>
<span id="cb4-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb4-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>,</span>
<span id="cb4-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>,</span>
<span id="cb4-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb4-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb4-18">)</span>
<span id="cb4-19">simBonfMAMS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for means (3 treatments vs.&nbsp;control), H0: mu(i) - mu(control) = 0, power directed towards larger values, H1: mu_max = 10, standard deviation = 15, planned cumulative sample size = c(30, 60), effect shape = linear, dose levels = c(1, 2, 3), intersection test = Bonferroni, selection = best, effect measure based on effect estimate, success criterion: all, simulation runs = 1000, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Arm 1 3.333333 Arm 2 6.666667 Arm 3 10.000000</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0026</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0026</td>
<td>0.0240</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.797</td>
<td>1.977</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td>0.8850</td>
</tr>
<tr class="even">
<td>Rejected arms per stage</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0.0130</td>
<td>0.0080</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.1120</td>
<td>0.0890</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>0.3030</td>
<td>0.4510</td>
</tr>
<tr class="even">
<td>Success per stage</td>
<td>0.0060</td>
<td>0.8790</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>30.0</td>
<td>0.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>30.0</td>
<td>5.6</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>30.0</td>
<td>23.7</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>179.4</td>
</tr>
<tr class="odd">
<td>Overall exit probability</td>
<td>0.0100</td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.1850</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7830</td>
</tr>
<tr class="even">
<td>Number of selected active arms</td>
<td>3.000</td>
<td>1.000</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.5785</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
</ul>
</div>
</div>
<p>We see that the power, which is the probability to reject at least one of the three corresponding hypotheses, is about 88% if a linear dose-response relationship is assumed. Note that there is a small probability to stop the trial for futility which is due to the use of the Bonferroni correction yielding adjusted <img src="https://latex.codecogs.com/png.latex?p">-values equal to 1 at interim (making a rejection at stage 2 impossible).</p>
<p>Using the Dunnett test for testing the intersection hypotheses increases the power to about 90% which is obtained by selecting <code>intersectionTest = "Dunnett"</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">simDunnettMAMS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb5-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb5-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>,</span>
<span id="cb5-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>,</span>
<span id="cb5-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb5-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb5-13">)</span>
<span id="cb5-14">simDunnettMAMS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for means (3 treatments vs.&nbsp;control), H0: mu(i) - mu(control) = 0, power directed towards larger values, H1: mu_max = 10, standard deviation = 15, planned cumulative sample size = c(30, 60), effect shape = linear, dose levels = c(1, 2, 3), intersection test = Dunnett, selection = best, effect measure based on effect estimate, success criterion: all, simulation runs = 1000, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Arm 1 3.333333 Arm 2 6.666667 Arm 3 10.000000</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0026</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0026</td>
<td>0.0240</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.797</td>
<td>1.977</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td>0.8990</td>
</tr>
<tr class="even">
<td>Rejected arms per stage</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0.0130</td>
<td>0.0080</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.1140</td>
<td>0.0910</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>0.3080</td>
<td>0.4580</td>
</tr>
<tr class="even">
<td>Success per stage</td>
<td>0.0060</td>
<td>0.8930</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>30.0</td>
<td>0.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>30.0</td>
<td>5.6</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>30.0</td>
<td>23.7</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>179.6</td>
</tr>
<tr class="odd">
<td>Overall exit probability</td>
<td>0.0060</td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.1870</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7850</td>
</tr>
<tr class="even">
<td>Number of selected active arms</td>
<td>3.000</td>
<td>1.000</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.5761</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
</ul>
</div>
</div>
<p>Changing <code>successCriterion = "all"</code> to <code>successCriterion = "atLeastOne"</code> reduces the expected number of subjects considerably because the trial is stopped at interim in many more cases:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">simDunnettMAMSatLeastOne <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb6-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>,</span>
<span id="cb6-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"atLeastOne"</span>,</span>
<span id="cb6-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb6-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb6-13">)</span>
<span id="cb6-14">simDunnettMAMSatLeastOne <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for means (3 treatments vs.&nbsp;control), H0: mu(i) - mu(control) = 0, power directed towards larger values, H1: mu_max = 10, standard deviation = 15, planned cumulative sample size = c(30, 60), effect shape = linear, dose levels = c(1, 2, 3), intersection test = Dunnett, selection = best, effect measure based on effect estimate, success criterion: at least one, simulation runs = 1000, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Arm 1 3.333333 Arm 2 6.666667 Arm 3 10.000000</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0026</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0026</td>
<td>0.0240</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.797</td>
<td>1.977</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td>0.8990</td>
</tr>
<tr class="even">
<td>Rejected arms per stage</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0.0130</td>
<td>0.0080</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.1140</td>
<td>0.0910</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>0.3080</td>
<td>0.4580</td>
</tr>
<tr class="even">
<td>Success per stage</td>
<td>0.3420</td>
<td>0.5570</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>30.0</td>
<td>0.8</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>30.0</td>
<td>6.3</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>30.0</td>
<td>22.9</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>159.5</td>
</tr>
<tr class="odd">
<td>Overall exit probability</td>
<td>0.3420</td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.0180</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.1380</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.5020</td>
</tr>
<tr class="even">
<td>Number of selected active arms</td>
<td>3.000</td>
<td>1.000</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.3989</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
</ul>
</div>
</div>
<p>For this example, we might conclude that choosing 30 subjects per treatment arm and stage is a reasonable choice. If, however, the effect sizes are smaller for the low and medium dose, the power might decrease and the sample size therefore should be increased. For example, assuming effect sizes of only 1 and 2 in the low and medium dose group, respectively, the test characteristics can be obtained by using the <code>typeOfShape = "userDefined"</code> option. The effect sizes of interest are specified through <code>effectMatrix</code> (which needs to be a matrix because you can also generally consider more than one parameter configuration):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">simDunnettMAMS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMatrix =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>,</span>
<span id="cb7-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"atLeastOne"</span>,</span>
<span id="cb7-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb7-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb7-13">)</span>
<span id="cb7-14">simDunnettMAMS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for means (3 treatments vs.&nbsp;control), H0: mu(i) - mu(control) = 0, power directed towards larger values, H1: mu_max = 10, standard deviation = 15, planned cumulative sample size = c(30, 60), effect shape = user defined, intersection test = Dunnett, selection = best, effect measure based on effect estimate, success criterion: at least one, simulation runs = 1000, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Arm 1 1 Arm 2 2 Arm 3 10</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0026</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0026</td>
<td>0.0240</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.797</td>
<td>1.977</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td>0.8970</td>
</tr>
<tr class="even">
<td>Rejected arms per stage</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0</td>
<td>0.0010</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.0050</td>
<td>0.0040</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>0.3060</td>
<td>0.5860</td>
</tr>
<tr class="even">
<td>Success per stage</td>
<td>0.3060</td>
<td>0.5910</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>30.0</td>
<td>0.3</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>30.0</td>
<td>0.8</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>30.0</td>
<td>29.0</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>161.6</td>
</tr>
<tr class="odd">
<td>Overall exit probability</td>
<td>0.3060</td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.0060</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.0180</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.6700</td>
</tr>
<tr class="even">
<td>Number of selected active arms</td>
<td>3.000</td>
<td>1.000</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.2592</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
</ul>
</div>
</div>
<p>It is interesting (though actually clear) that the power and other test characteristics are quite similar and so the validity of the chosen sample size might be considered as robust against possible deviations for the originally assumed linear dose-response relationship. Note that ’Stage-wise number of subjects` denote the <strong>conditional expected sample size in treatment arm i</strong> and thus account for the fact that a treatment arm is selected given the fact that the second stage was reached.</p>
</section>
<section id="choosing-the-weight" class="level1">
<h1>Choosing the weight</h1>
<p>Since treatment arms are discontinued over the two stages, the sample size and hence the information over the stages is not the same. Despite of this, we used the <strong>unweighted inverse normal method</strong> (with weight = <img src="https://latex.codecogs.com/png.latex?1/%5Csqrt%7B2%7D">) for combining the two stages. The pre-fixed weight, however, does not have a substantial impact on the power of the procedure which is shown in the following plot. The simulated power values show that in a medium range of the weights the power does not change substantially and hence it is reasonable to choose equal weights for the two stages:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">powerValues <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb8-2">weights <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb8-3"></span>
<span id="cb8-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (w <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> weights) {</span>
<span id="cb8-5">    designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb8-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb8-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(w, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span></span>
<span id="cb8-8">    )</span>
<span id="cb8-9">    powerValues <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb8-10">        powerValues,</span>
<span id="cb8-11">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb8-12">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb8-13">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb8-14">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb8-15">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb8-16">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb8-17">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb8-18">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb8-19">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>,</span>
<span id="cb8-20">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"atLeastOne"</span>,</span>
<span id="cb8-21">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb8-22">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb8-23">        )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rejectAtLeastOne</span>
<span id="cb8-24">    )</span>
<span id="cb8-25">}</span>
<span id="cb8-26"></span>
<span id="cb8-27"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(weights, powerValues,</span>
<span id="cb8-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb8-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weight"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span></span>
<span id="cb8-30">)</span>
<span id="cb8-31"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lines</span>(weights, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(weights)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="assessing-different-selection-rules" class="level1">
<h1>Assessing different selection rules</h1>
<p>You might assess different selection rules by using the parameter <code>typeOfSelection</code>. Five options are available: <code>best</code>, <code>rBest</code>, <code>epsilon</code>, <code>all</code>, and <code>userDefined</code>. For <code>rBest</code> (select the r best treatment arms), the parameter <code>rValue</code> has to be specified, for <code>epsilon</code> (select treatment arms not worse than epsilon compared to the best), the parameter <code>epsilonValue</code> has to be specified.</p>
<section id="user-defined-selection-rule" class="level2">
<h2 class="anchored" data-anchor-id="user-defined-selection-rule">User defined selection rule</h2>
<p>If <code>userDefined</code> is selected, <code>selectArmsFunction</code> needs to be specified that depends on <code>effectVector</code>. Note that <code>effectVector</code> is either the test statistic or the effect difference (in absolute terms) which can be selected through the parameter <code>effectMeasure</code>. For example, using the function</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>)</span>
<span id="cb9-2">mySelectionFunction <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(effectVector) {</span>
<span id="cb9-3">    selectedArms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (effectVector <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb9-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(selectedArms)</span>
<span id="cb9-5">}</span></code></pre></div></div>
</div>
<p>defines a selection rule where all treatment arms with effect sizes exceeding 5 (with the default <code>effectMeasure = "effectEstimate"</code>) are selected. Running</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">simSelectionMAMS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb10-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">selectArmsFunction =</span> mySelectionFunction,</span>
<span id="cb10-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"atLeastOne"</span>,</span>
<span id="cb10-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb10-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb10-14">)</span>
<span id="cb10-15">simSelectionMAMS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
</div>
<p>shows that for the second stage the expected number of selected treatment arms is 1.803 indicating that there are cases where more than one arm is selected for the second stage:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Simulation of multi-arm means (inverse normal combination test design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.500, 1.000</li>
<li><em>Critical values</em>: 2.797, 1.977</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.002583, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.002583, 0.023996</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned cumulative subjects</em>: 30, 60</li>
<li><em>Standard deviation</em>: 15</li>
<li><em>Seed</em>: 1234</li>
<li><em>Active arms</em>: 3</li>
<li><em>Maximum number of iterations</em>: 1000</li>
<li><em>Dose levels</em>: 1, 2, 3</li>
<li><em>mu_max</em>: 10</li>
<li><em>Type of selection</em>: userDefined</li>
<li><em>Success criterion</em>: atLeastOne</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Calculate subjects function</em>: default</li>
<li><em>Adaptations</em>: TRUE</li>
<li><em>Slope</em>: 1</li>
<li><em>Intersection test</em>: Dunnett</li>
<li><em>Effect measure</em>: effectEstimate</li>
<li><em>Type of shape</em>: linear</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Effect matrix (1)</em>: 3.333</li>
<li><em>Effect matrix (2)</em>: 6.667</li>
<li><em>Effect matrix (3)</em>: 10.000</li>
</ul>
<p><strong>Results</strong></p>
<ul>
<li><em>Expected number of subjects</em>: 170.8</li>
<li><em>Sample sizes (1) [1]</em>: 30</li>
<li><em>Sample sizes (1) [2]</em>: 6.8</li>
<li><em>Sample sizes (2) [1]</em>: 30</li>
<li><em>Sample sizes (2) [2]</em>: 19.1</li>
<li><em>Sample sizes (3) [1]</em>: 30</li>
<li><em>Sample sizes (3) [2]</em>: 28.3</li>
<li><em>Sample sizes (4) [1]</em>: 30</li>
<li><em>Sample sizes (4) [2]</em>: 30</li>
<li><em>Overall reject at least one</em>: 0.8840</li>
<li><em>Rejected arms per stage (1) [1]</em>: 0.0140</li>
<li><em>Rejected arms per stage (1) [2]</em>: 0.0470</li>
<li><em>Rejected arms per stage (2) [1]</em>: 0.0870</li>
<li><em>Rejected arms per stage (2) [2]</em>: 0.2640</li>
<li><em>Rejected arms per stage (3) [1]</em>: 0.3050</li>
<li><em>Rejected arms per stage (3) [2]</em>: 0.5330</li>
<li><em>Overall futility stop</em>: 0.0700</li>
<li><em>Futility stop per stage</em>: 0.0700</li>
<li><em>Early stop</em>: 0.3960</li>
<li><em>Success per stage [1]</em>: 0.3260</li>
<li><em>Success per stage [2]</em>: 0.5580</li>
<li><em>Selected arms {1} [1]</em>: 1.0000</li>
<li><em>Selected arms {1} [2]</em>: 0.1360</li>
<li><em>Selected arms {2} [1]</em>: 1.0000</li>
<li><em>Selected arms {2} [2]</em>: 0.3840</li>
<li><em>Selected arms {3} [1]</em>: 1.0000</li>
<li><em>Selected arms {3} [2]</em>: 0.5690</li>
<li><em>Selected arms {4} [1]</em>: 1.0000</li>
<li><em>Selected arms {4} [2]</em>: 0.6040</li>
<li><em>Number of selected active arms [1]</em>: 3.000</li>
<li><em>Number of selected active arms [2]</em>: 1.803</li>
<li><em>Conditional power (achieved) [1]</em>: NA</li>
<li><em>Conditional power (achieved) [2]</em>: 0.4021</li>
<li><em>Iterations [1]</em>: 1000</li>
<li><em>Iterations [2]</em>: 604</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>Using <code>getData()</code> enables to show how often this is the case. The following code lines calculate how often 1, 2, and 3 treatment arms were selected for the second stage:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">dat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simSelectionMAMS)</span>
<span id="cb11-2">tab <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(dat[dat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageNumber <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, ]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>iterationNumber))</span>
<span id="cb11-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(tab[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(tab), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<pre><code>  1       2       3 </code></pre>
<p>0.36258 0.47185 0.16556</p>
<p>Note that these probabilities are <strong>conditional probabilities</strong> (conditional on performing the second stage) and sum to one whereas the probabilities for selecting arm 1, 2, or 3 provided in the summary are <strong>unconditional</strong>, i.e., not conditioned on reaching the second stage. In particular, they may become small if the study often stops at interim.</p>
</section>
<section id="epsilon-selection-rule" class="level2">
<h2 class="anchored" data-anchor-id="epsilon-selection-rule">epsilon selection rule</h2>
<p>We now consider a three-stage inverse normal combination test design where no early stops for efficacy are foreseen. At the end, the full significance level of <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> should be used. This is achieved by the definition of the design through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">designIN3Stages <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asUser"</span>,</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">userAlphaSpending =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>)</span>
<span id="cb13-4">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Changed type of design to 'noEarlyEfficacy'</code></pre>
</div>
</div>
<p>As above, we plan a design with three active treatment arms to be tested against control and assume a linear dose-response relationship. We want to consider a range of maximum values for the effect and therefore specify <code>muMaxVector = seq(0,12,3)</code>, i.e., including the null hypothesis case. For the selection of treatment arms, we define the epsilon selection rule with <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%202">, i.e., for the subsequent stages, the treatment arm with the highest response and all treatment arms that differ less than 2 with the highest response are selected. To exclude treatment arms with non-positive response, we additionally specify <code>threshold = 0</code>. In order to simulate a situation with a maximum of 60 subject per treatment arm we set <code>plannedSubjects = c(20, 40, 60)</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">simSelectionEpsilonMAMS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN3Stages,</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb15-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb15-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"epsilon"</span>,</span>
<span id="cb15-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">epsilonValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb15-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">threshold =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb15-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"atLeastOne"</span>,</span>
<span id="cb15-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb15-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb15-15">)</span>
<span id="cb15-16"></span>
<span id="cb15-17"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>)</span>
<span id="cb15-18">simSelectionEpsilonMAMS</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of multi-arm means (inverse normal combination test design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.333, 0.667, 1.000</li>
<li><em>Critical values</em>: Inf, Inf, 1.960</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.0000, 0.0000, 0.0250</li>
<li><em>Local one-sided significance levels</em>: 0.0000, 0.0000, 0.0250</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned cumulative subjects</em>: 20, 40, 60</li>
<li><em>Standard deviation</em>: 15</li>
<li><em>Seed</em>: 1234</li>
<li><em>Active arms</em>: 3</li>
<li><em>Maximum number of iterations</em>: 1000</li>
<li><em>Dose levels</em>: 1, 2, 3</li>
<li><em>mu_max</em>: 0, 2, 4, 6, 8, 10, 12</li>
<li><em>Threshold</em>: 0</li>
<li><em>Epsilon value</em>: 2</li>
<li><em>Type of selection</em>: epsilon</li>
<li><em>Success criterion</em>: atLeastOne</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Calculate subjects function</em>: default</li>
<li><em>Adaptations</em>: TRUE, TRUE</li>
<li><em>Slope</em>: 1</li>
<li><em>Intersection test</em>: Dunnett</li>
<li><em>Effect measure</em>: effectEstimate</li>
<li><em>Type of shape</em>: linear</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Effect matrix (1)</em>: 0.0000, 0.6667, 1.3333, 2.0000, 2.6667, 3.3333, 4.0000</li>
<li><em>Effect matrix (2)</em>: 0.0000, 1.3333, 2.6667, 4.0000, 5.3333, 6.6667, 8.0000</li>
<li><em>Effect matrix (3)</em>: 0.0000, 2.0000, 4.0000, 6.0000, 8.0000, 10.0000, 12.0000</li>
</ul>
<p><strong>Results</strong></p>
<ul>
<li><em>Expected number of subjects</em>: 144.8, 154.7, 165.1, 167.1, 169, 167.9, 167.5</li>
<li><em>Sample sizes (1) [1]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Sample sizes (1) [2]</em>: 9.2, 7.9, 6.4, 4.9, 3.2, 2, 1.3</li>
<li><em>Sample sizes (1) [3]</em>: 7.6, 6.3, 4.6, 3, 1.5, 0.8, 0.3</li>
<li><em>Sample sizes (2) [1]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Sample sizes (2) [2]</em>: 9.2, 9.4, 9.3, 8.6, 8.2, 7, 6.8</li>
<li><em>Sample sizes (2) [3]</em>: 8.1, 7.6, 7.7, 6.8, 6.3, 4.6, 4.3</li>
<li><em>Sample sizes (3) [1]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Sample sizes (3) [2]</em>: 9.6, 11.4, 13.1, 14.8, 16, 17.2, 17.7</li>
<li><em>Sample sizes (3) [3]</em>: 8.4, 10.6, 12.5, 14.6, 15.7, 17, 17.4</li>
<li><em>Sample sizes (4) [1]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Sample sizes (4) [2]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Sample sizes (4) [3]</em>: 20, 20, 20, 20, 20, 20, 20</li>
<li><em>Overall reject at least one</em>: 0.0230, 0.0790, 0.2160, 0.4750, 0.7200, 0.8990, 0.9680</li>
<li><em>Rejected arms per stage (1) [1]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (1) [2]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (1) [3]</em>: 0.0070, 0.0120, 0.0230, 0.0280, 0.0260, 0.0160, 0.0070</li>
<li><em>Rejected arms per stage (2) [1]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (2) [2]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (2) [3]</em>: 0.0060, 0.0170, 0.0680, 0.1020, 0.1620, 0.1730, 0.1920</li>
<li><em>Rejected arms per stage (3) [1]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (3) [2]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Rejected arms per stage (3) [3]</em>: 0.0110, 0.0510, 0.1450, 0.3980, 0.6210, 0.7920, 0.8560</li>
<li><em>Overall futility stop</em>: 0.3550, 0.2350, 0.1080, 0.0660, 0.0240, 0.0080, 0.0040</li>
<li><em>Futility stop per stage [1]</em>: 0.2410, 0.1650, 0.0750, 0.0530, 0.0210, 0.0060, 0.0040</li>
<li><em>Futility stop per stage [2]</em>: 0.1140, 0.0700, 0.0330, 0.0130, 0.0030, 0.0020, 0.0000</li>
<li><em>Early stop [1]</em>: 0.2410, 0.1650, 0.0750, 0.0530, 0.0210, 0.0060, 0.0040</li>
<li><em>Early stop [2]</em>: 0.1140, 0.0700, 0.0330, 0.0130, 0.0030, 0.0020, 0.0000</li>
<li><em>Success per stage [1]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Success per stage [2]</em>: 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000</li>
<li><em>Success per stage [3]</em>: 0.0230, 0.0790, 0.2160, 0.4750, 0.7200, 0.8990, 0.9680</li>
<li><em>Selected arms {1} [1]</em>: 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000</li>
<li><em>Selected arms {1} [2]</em>: 0.3500, 0.3280, 0.2980, 0.2300, 0.1590, 0.1000, 0.0630</li>
<li><em>Selected arms {1} [3]</em>: 0.2450, 0.2410, 0.2060, 0.1380, 0.0730, 0.0410, 0.0160</li>
<li><em>Selected arms {2} [1]</em>: 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000</li>
<li><em>Selected arms {2} [2]</em>: 0.3480, 0.3930, 0.4280, 0.4060, 0.4020, 0.3480, 0.3370</li>
<li><em>Selected arms {2} [3]</em>: 0.2600, 0.2920, 0.3440, 0.3160, 0.3080, 0.2260, 0.2160</li>
<li><em>Selected arms {3} [1]</em>: 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000</li>
<li><em>Selected arms {3} [2]</em>: 0.3630, 0.4770, 0.6060, 0.7030, 0.7840, 0.8530, 0.8830</li>
<li><em>Selected arms {3} [3]</em>: 0.2720, 0.4050, 0.5570, 0.6810, 0.7670, 0.8430, 0.8690</li>
<li><em>Selected arms {4} [1]</em>: 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000</li>
<li><em>Selected arms {4} [2]</em>: 0.7590, 0.8350, 0.9250, 0.9470, 0.9790, 0.9940, 0.9960</li>
<li><em>Selected arms {4} [3]</em>: 0.6450, 0.7650, 0.8920, 0.9340, 0.9760, 0.9920, 0.9960</li>
<li><em>Number of selected active arms [1]</em>: 3.000, 3.000, 3.000, 3.000, 3.000, 3.000, 3.000</li>
<li><em>Number of selected active arms [2]</em>: 1.398, 1.435, 1.440, 1.414, 1.374, 1.309, 1.288</li>
<li><em>Number of selected active arms [3]</em>: 1.205, 1.226, 1.241, 1.215, 1.176, 1.119, 1.105</li>
<li><em>Conditional power (achieved) [1]</em>: NA, NA, NA, NA, NA, NA, NA</li>
<li><em>Conditional power (achieved) [2]</em>: 0, 0, 0, 0, 0, 0, 0</li>
<li><em>Conditional power (achieved) [3]</em>: 0.1018, 0.1637, 0.2969, 0.4578, 0.6416, 0.8353, 0.9184</li>
<li><em>Iterations [1]</em>: 1000, 1000, 1000, 1000, 1000, 1000, 1000</li>
<li><em>Iterations [2]</em>: 759, 835, 925, 947, 979, 994, 996</li>
<li><em>Iterations [3]</em>: 645, 765, 892, 934, 976, 992, 996</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>Note that we explicitly use the <code>options("rpact.summary.output.size" = "medium")</code> command because otherwise the output turns out to be too long. You might also illustrate the results through the generic <code>plot</code> command. For example, generating Overall Power/Early Stopping and Selected Arms per Stage plots are achieved by</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">simSelectionEpsilonMAMS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb16-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb16-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), </span>
<span id="cb16-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb16-5">  )</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples/index_files/figure-html/unnamed-chunk-19-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples/index_files/figure-html/unnamed-chunk-19-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="closing-remarks" class="level1">
<h1>Closing remarks</h1>
<p>This vignette can only give a brief introduction into possible configurations that can be considered within the simulation tool for multi-arm designs. Other than described here, for real-trial applications typically there is much more to take into account to adequately address the situation. For example, it might be of interest to additionally assess a sample size reassessment strategy. This can be performed as for simulating a single hypothesis situation (for example, see the vignette <a href="https://vignettes.rpact.com/html/rpact_sample_size_reassessment_examples.html">“Simulation of a trial with a binary endpoint and unblinded sample size re-calculation”</a>).</p>
<p>For testing rates, the function <code>getSimulationMultiArmRates()</code> and for survival designs, the function <code>getSimulationMultiArmSurvival()</code> is available with very similar options as compared to the considered case. For survival designs, we note that - other than for the single hypothesis case - the function does not generate survival times on the subjects level, but normally distributed log-rank test statistics. As a consequence, for this case no estimates of analysis times, study duration, and expected number of subjects can be obtained.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Means</category>
  <category>Power simulation</category>
  <category>Multi-arm</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_16.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Promising Zone Design with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/</link>
  <description><![CDATA[ 




<section id="summary" class="level1 unnumbered">
<h1 class="unnumbered">Summary</h1>
<p>We demonstrate how <a href="https://cran.r-project.org/package=rpact">rpact</a> enables users to easily define new functions for calculating the number of subjects or events required, based on given conditional power and critical values for specific testing scenarios. This includes the implementation of advanced strategies like the ‘promising zone approach.’</p>
<p>These are the packages used for creating this vignette:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>
Attaching package: 'dplyr'</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>The following objects are masked from 'package:stats':

    filter, lag</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggpubr)</span>
<span id="cb5-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>rpact developer version 4.5.0.9315 loaded</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Installation qualification for rpact 4.5.0.9315 has not yet been performed.</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Please run testPackage() before using the package in GxP relevant environments.</code></pre>
</div>
</div>
</section>
<section id="a-motivating-example-from-hsiao-liu-and-mehta-biometrical-journal-2019" class="level1">
<h1>A Motivating Example from Hsiao, Liu, and Mehta (Biometrical Journal, 2019)</h1>
<ul>
<li><p>Efficacy endpoint PFS</p></li>
<li><p>Assumed hazard ratio = 0.67, <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.1"> requires 263 events</p></li>
</ul>
<ul>
<li><p>280 PFS events yields power 91.8 %.</p></li>
<li><p>If 350 patients are enrolled over 28 months with a median PFS time of 8.5 months in the control group, the final analysis is expected to be after an additional follow-up of about 12 months</p></li>
</ul>
<ul>
<li><p>500 PFS events are needed to have 90% power at HR = 0.75 with more patients and a different expected follow-up</p></li>
<li><p><strong>“Milestone-based” investment:</strong></p>
<ul>
<li><p>Two-stage approach with interim after 140 events</p></li>
<li><p>Enough power for detecting HR = 0.67</p></li>
<li><p>If conditional power CP for detecting HR = 0.75 falls in a “promising zone”, an additional investment would be made that allows the trial to remain open until 420 PFS events were obtained</p></li>
<li><p>Conditional power based on <strong>assumed</strong> minimum clinical relevant effect HR = 0.75</p></li>
</ul></li>
</ul>
</section>
<section id="promising-zone-design" class="level1">
<h1>Promising Zone Design</h1>
<ul>
<li><p>Number of events for the second stage between 140 and 280</p></li>
<li><p>If conditional power for 280 additional events at HR = 0.75 is smaller than <img src="https://latex.codecogs.com/png.latex?cp_%7Bmin%7D">, set number of additional events = 140 (<em>non-promising case</em>)</p></li>
<li><p>If conditional power for 140 additional events at HR = 0.75 exceeds <img src="https://latex.codecogs.com/png.latex?cp_%7Bmax%7D">, set number of additional events = 140, otherwise calculate event number according to <img src="https://latex.codecogs.com/png.latex?CP_%7BHR%20=%200.75%7D%20=%20%20cp_%7Bmax%7D"> (<em>promising case</em>)</p></li>
<li><p>This defined a promising zone for HR within the sample size may be modified.</p></li>
</ul>
<section id="promising-zone-design-using-rpact" class="level2">
<h2 class="anchored" data-anchor-id="promising-zone-design-using-rpact">Promising Zone Design Using <a href="https://cran.r-project.org/package=rpact">rpact</a></h2>
<p>First, define the design</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">myDesign <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb9-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb9-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span></span>
<span id="cb9-4">) </span></code></pre></div></div>
</div>
<p>Define the event number calculation function <code>myEventSizeCalculationFunction()</code></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define promising zone event size function</span></span>
<span id="cb10-2">myEventSizeCalculationFunction <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(..., stage,</span>
<span id="cb10-3">                     plannedEvents,</span>
<span id="cb10-4">                     conditionalPower,</span>
<span id="cb10-5">                     minNumberOfEventsPerStage,</span>
<span id="cb10-6">                     maxNumberOfEventsPerStage,</span>
<span id="cb10-7">                     conditionalCriticalValue,</span>
<span id="cb10-8">                     estimatedTheta) {</span>
<span id="cb10-9">  </span>
<span id="cb10-10">  calculateStageEvents <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(cp) {</span>
<span id="cb10-11">      <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, conditionalCriticalValue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(cp))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> </span>
<span id="cb10-12">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, estimatedTheta))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb10-13">  }</span>
<span id="cb10-14">  </span>
<span id="cb10-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate events required to reach maximum desired conditional power</span></span>
<span id="cb10-16">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cp_max (provided as argument conditionalPower)</span></span>
<span id="cb10-17">  stageEventsCPmax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">calculateStageEvents</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cp =</span> conditionalPower))</span>
<span id="cb10-18">  </span>
<span id="cb10-19">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate events required to reach minimum desired conditional power</span></span>
<span id="cb10-20">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cp_min (**manually set for this example to 0.8**)</span></span>
<span id="cb10-21">  stageEventsCPmin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">calculateStageEvents</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cp =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>))</span>
<span id="cb10-22">  </span>
<span id="cb10-23">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define stageEvents</span></span>
<span id="cb10-24">  stageEvents <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(minNumberOfEventsPerStage[stage], stageEventsCPmax),</span>
<span id="cb10-25">    maxNumberOfEventsPerStage[stage])</span>
<span id="cb10-26">  </span>
<span id="cb10-27">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Set stageEvents to minimal sample size in case minimum conditional power</span></span>
<span id="cb10-28">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cannot be reached with available sample size</span></span>
<span id="cb10-29">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (stageEventsCPmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> maxNumberOfEventsPerStage[stage]) {</span>
<span id="cb10-30">    stageEvents <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> minNumberOfEventsPerStage[stage]</span>
<span id="cb10-31">  </span>
<span id="cb10-32">  }</span>
<span id="cb10-33">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># return overall events for second stage </span></span>
<span id="cb10-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(plannedEvents[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> stageEvents)</span>
<span id="cb10-35">}</span></code></pre></div></div>
</div>
<p>Then, run the Simulation by specifying <code>calcEventsFunction = myEventSizeCalculationFunction</code> and a range of assumed true hazard ratios</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">hazardRatioSeq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">simSurvPromZone <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb12-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> myDesign,</span>
<span id="cb12-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq,</span>
<span id="cb12-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb12-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>), </span>
<span id="cb12-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>,</span>
<span id="cb12-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>),</span>
<span id="cb12-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>),</span>
<span id="cb12-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb12-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb12-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, </span>
<span id="cb12-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">calcEventsFunction =</span> myEventSizeCalculationFunction,</span>
<span id="cb12-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb12-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">longTimeSimulationAllowed =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb12-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span></span>
<span id="cb12-16">) </span></code></pre></div></div>
</div>
</section>
<section id="usual-conditional-power-approach" class="level2">
<h2 class="anchored" data-anchor-id="usual-conditional-power-approach">“Usual” Conditional Power Approach</h2>
<p>For the “usual” conditional power approach, we specify <code>calcEventsFunction = NULL</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">simSurvCondPower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb13-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> myDesign,</span>
<span id="cb13-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq, </span>
<span id="cb13-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb13-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>), </span>
<span id="cb13-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>,</span>
<span id="cb13-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>),</span>
<span id="cb13-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>),</span>
<span id="cb13-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb13-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb13-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, </span>
<span id="cb13-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">calcEventsFunction =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>,</span>
<span id="cb13-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb13-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">longTimeSimulationAllowed =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb13-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span></span>
<span id="cb13-16">) </span></code></pre></div></div>
</div>
</section>
<section id="comparison-of-approaches" class="level2">
<h2 class="anchored" data-anchor-id="comparison-of-approaches">Comparison of Approaches</h2>
<p>To compare the two approaches, we aggregate the data and plot the re-calculated number of events and conditional power:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">aggSimCondPower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simSurvCondPower)</span>
<span id="cb14-2">sumCpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarize</span>(aggSimCondPower, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(iterationNumber, hazardRatio), </span>
<span id="cb14-3">             <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Event re-calculation for cp = 90%"</span>,</span>
<span id="cb14-4">             <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">totalSampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(eventsPerStage), </span>
<span id="cb14-5">             <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Z1 =</span> testStatistic[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], </span>
<span id="cb14-6">               <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> conditionalPowerAchieved[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb14-7"></span>
<span id="cb14-8">aggSimPromZone <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simSurvPromZone)</span>
<span id="cb14-9">sumCPZ <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarize</span>(aggSimPromZone, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(iterationNumber, hazardRatio), </span>
<span id="cb14-10">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ) with cpmin = 80%"</span>,</span>
<span id="cb14-11">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">totalSampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(eventsPerStage), </span>
<span id="cb14-12">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Z1 =</span> testStatistic[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], </span>
<span id="cb14-13">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> conditionalPowerAchieved[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb14-14"></span>
<span id="cb14-15">sumBoth <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sumCpower, sumCPZ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb14-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb14-17"></span>
<span id="cb14-18"></span>
<span id="cb14-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot it</span></span>
<span id="cb14-20"></span>
<span id="cb14-21">plot1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sumBoth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, totalSampleSize1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design,  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> design)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dnorm</span>(Z1, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>  </span>
<span id="cb14-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grids</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb14-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z-score at interim analysis"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re-calculated number of events"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">limits =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orange"</span>))</span>
<span id="cb14-29"></span>
<span id="cb14-30">plot2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sumBoth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, conditionalPower, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> design)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dnorm</span>(Z1, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grids</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb14-35">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z-score at interim analysis"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(</span>
<span id="cb14-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb14-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Conditional power at re-calculated sample size"</span></span>
<span id="cb14-39">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orange"</span>))</span>
<span id="cb14-41"></span>
<span id="cb14-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggarrange</span>(plot1, plot2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">common.legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top"</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="dont-increase-for-e.g.-p-0.15" class="level2">
<h2 class="anchored" data-anchor-id="dont-increase-for-e.g.-p-0.15">Don’t Increase for, e.g., p = 0.15?</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sumBoth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pnorm</span>(Z1), conditionalPower, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> design)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grids</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb15-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p-value at interim analysis"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb15-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Conditional power at re-calculated sample size"</span></span>
<span id="cb15-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">simSurvPromZone <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>) </span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">simSurvCondPower <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pool datasets from simulations (and fixed designs)</span></span>
<span id="cb18-2">simCondPowerData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.list</span>(simSurvCondPower),</span>
<span id="cb18-3">                      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb18-4">                        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Events re-calculation with cp = 90%"</span>,</span>
<span id="cb18-5">                        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatio, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> overallReject,</span>
<span id="cb18-6">                        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfEvents =</span> expectedNumberOfEvents</span>
<span id="cb18-7">                      ))    </span>
<span id="cb18-8"></span>
<span id="cb18-9">simPromZoneData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.list</span>(simSurvPromZone),</span>
<span id="cb18-10">                   <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb18-11">                     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ)"</span>,</span>
<span id="cb18-12">                     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatio, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> overallReject,</span>
<span id="cb18-13">                     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfEvents =</span> expectedNumberOfEvents</span>
<span id="cb18-14">                   ))</span>
<span id="cb18-15"></span>
<span id="cb18-16">simFixed280 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb18-17">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed events = 280"</span>,</span>
<span id="cb18-18">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq,</span>
<span id="cb18-19">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb18-20">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb18-21">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>, </span>
<span id="cb18-22">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>,</span>
<span id="cb18-23">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, </span>
<span id="cb18-24">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb18-25">                          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq</span>
<span id="cb18-26">                    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject,</span>
<span id="cb18-27">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span></span>
<span id="cb18-28">                  )</span>
<span id="cb18-29"></span>
<span id="cb18-30"></span>
<span id="cb18-31">simFixed420 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb18-32">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed events = 420"</span>,</span>
<span id="cb18-33">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq,</span>
<span id="cb18-34">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb18-35">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb18-36">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">420</span>, </span>
<span id="cb18-37">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>,</span>
<span id="cb18-38">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, </span>
<span id="cb18-39">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb18-40">                           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> hazardRatioSeq</span>
<span id="cb18-41">                    )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject,</span>
<span id="cb18-42">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">420</span></span>
<span id="cb18-43">                  )</span>
<span id="cb18-44"></span>
<span id="cb18-45">simdata <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(simCondPowerData, simPromZoneData, simFixed280, simFixed420)</span>
<span id="cb18-46">simdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(simdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>design,</span>
<span id="cb18-47">                         <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">levels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb18-48">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed events = 280"</span>, </span>
<span id="cb18-49">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed events = 420"</span>,</span>
<span id="cb18-50">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Events re-calculation with cp = 90%"</span>, </span>
<span id="cb18-51">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ)"</span></span>
<span id="cb18-52">                         ))</span></code></pre></div></div>
</div>
</section>
<section id="difference-in-power" class="level2">
<h2 class="anchored" data-anchor-id="difference-in-power">Difference in Power</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot difference in power</span></span>
<span id="cb19-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(hazardRatio, power, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> simdata) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grids</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb19-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hazard Ratio"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.67</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#2c7bb6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#abd9e9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-14-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="difference-in-expected-sample-size" class="level2">
<h2 class="anchored" data-anchor-id="difference-in-expected-sample-size">Difference in Expected Sample Size</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot difference in expected sample size</span></span>
<span id="cb20-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(hazardRatio, expectedNumberOfEvents, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> simdata) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grids</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb20-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hazard Ratio"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected Events"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#2c7bb6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#abd9e9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/index_files/figure-html/unnamed-chunk-15-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="summary-1" class="level1">
<h1>Summary</h1>
<ul>
<li>Easy implementation in <code>rpact</code></li>
<li>Simulation very fast</li>
<li>Consideration of efficacy or futility stops straightforward</li>
<li>Trade-off between overall expected sample size and power</li>
<li>Usage of combination test (or equivalent) theoretically mandatory</li>
<li>Adaptations based on test statistic only</li>
</ul>
</section>
<section id="references" class="level1">
<h1>References</h1>
<p>Wassmer, G and Brannath, W. <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em> (2016), ISBN 978-3319325606 <a href="https://doi.org/10.1007/978-3-319-32562-0" class="uri">https://doi.org/10.1007/978-3-319-32562-0</a></p>
<hr>
<p><em>System</em> rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), <em>platform</em> x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Power simulation</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_survival_promizing_zone_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_12.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Designing Group Sequential Trials with a Binary Endpoint with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_binary_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="sample-size-calculation-for-a-superiority-trial-with-two-groups-without-interim-analyses" class="level1">
<h1>Sample size calculation for a superiority trial with two groups without interim analyses</h1>
<p>The <strong>sample size</strong> for a trial with binary endpoints can be calculated using the function <code>getSampleSizeRates()</code>. This function is fully documented in the help page (<code>?getSampleSizeRates</code>). Hence, we only provide some examples below.</p>
<p>First, load the <a href="https://cran.r-project.org/package=rpact">rpact</a> package.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>To get the <strong>direction</strong> of the effects correctly, note that in <a href="https://cran.r-project.org/package=rpact">rpact</a> the <strong>index “2” in an argument name always refers to the control group, “1” to the intervention group, and treatment effects compare treatment versus control</strong>. Specifically, for binary endpoints, the probabilities of an event in the control group and intervention group, respectively, are given by arguments <code>pi2</code> and <code>pi1</code>. The default treatment effect is the absolute risk difference <code>pi1 - pi2</code> but the relative risk scale <code>pi1/pi2</code> is also supported if the argument <code>riskRatio</code> is set to <code>TRUE</code>. For this first example, we assume that occurrence of the event is beneficial, (e.g., a treatment success), so the alternative hypothesis consists of risk differences greater than 0 (or risk ratios greater than 1, respectively).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example of a standard trial:</span></span>
<span id="cb3-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - probability 25% in control (pi2 = 0.25) vs. 40% (pi1 = 0.4) in intervention</span></span>
<span id="cb3-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - one-sided test (sided = 1)</span></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - Type I error 0.025 (alpha = 0.025) and power 80% (beta = 0.2)</span></span>
<span id="cb3-5">sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, </span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb3-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb3-11">)</span>
<span id="cb3-12">sampleSizeResult</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for rates</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.400</li>
<li><em>Assumed control rate</em>: 0.250</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Risk ratio</em>: FALSE</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Critical values (treatment effect scale)</em>: 0.103</li>
<li><em>Number of subjects fixed</em>: 303.7</li>
<li><em>Number of subjects fixed (1)</em>: 151.9</li>
<li><em>Number of subjects fixed (2)</em>: 151.9</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>As per the output above, the required <strong>total sample size</strong> is 304 and the critical value corresponds to a minimal detectable difference (on the absolute risk difference scale, the default) of approximately 0.103. This calculation assumes that <code>pi2 = 0.25</code> is the observed rate in treatment group 2.</p>
<p>A useful summary is provided with the generic <code>summary()</code> function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) = 0.4, control rate pi(2) = 0.25.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.103</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>303.7</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>You can change the randomization allocation between the treatment groups using <code>allocationRatioPlanned</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Extension of standard trial</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># - 2(intervention):1(control) randomization (allocationRatioPlanned = 2)</span></span>
<span id="cb5-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, </span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb5-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb5-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb5-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) = 0.4, control rate pi(2) = 0.25, planned allocation ratio = 2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.104</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>346.3</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>In this case, <code>allocationRatioPlanned = 2</code> determines that twice as many patients should be recruited for the active treatment arm as for the control arm. <code>allocationRatioPlanned = 0</code> can be defined in order to obtain the optimum allocation ratio minimizing the overall sample size (the optimum sample size is only slightly smaller than sample size with equal allocation; practically, this has no effect):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Extension of standard trial</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># optimum randomization ratio</span></span>
<span id="cb6-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, </span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb6-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb6-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) = 0.4, control rate pi(2) = 0.25, optimum planned allocation ratio = 0.953.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.103</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>303.6</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p><strong>Power</strong> at given sample size can be calculated using the function <code>getPowerRates()</code>. This function has the same arguments as <code>getSampleSizeRates()</code> except that the maximum total sample size needs to be defined (<code>maxNumberOfSubjects</code>) and the Type II error <code>beta</code> is no longer needed. For one-sided tests, the direction of the test is also required. The default <code>directionUpper = TRUE</code> indicates that for the alternative, the probability in the intervention group <code>pi1</code> is larger than the probability in the control group <code>pi2</code> (<code>directionUpper = FALSE</code> is the other direction):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Calculate power for a simple trial with total sample size 304</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as in the example above in case of pi2 = 0.25 (control) and</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pi1 = 0.37 (intervention)</span></span>
<span id="cb7-4">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, </span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">304</span>, </span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb7-10">)</span>
<span id="cb7-11">powerResult</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for rates</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.370</li>
<li><em>Assumed control rate</em>: 0.250</li>
<li><em>Maximum number of subjects</em>: 304</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Direction upper</em>: TRUE</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Risk ratio</em>: FALSE</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Effect</em>: 0.12</li>
</ul>
<p><strong>Power and output</strong></p>
<ul>
<li><em>Overall reject</em>: 0.6196</li>
<li><em>Critical values (treatment effect scale)</em>: 0.103</li>
<li><em>Number of subjects fixed</em>: 304</li>
<li><em>Number of subjects fixed (1)</em>: 152</li>
<li><em>Number of subjects fixed (2)</em>: 152</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>The calculated <strong>power</strong> for a slightly lower treatment rate <code>pi1 = 0.37</code> is provided in the output as <strong>“Overall reject”</strong> and is 0.620 for the example.</p>
<p>The <code>summary()</code> command produces the output</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">powerResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, power directed towards larger values, H1: pi(1) = 0.37, control rate pi(2) = 0.25, number of subjects = 304.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.103</td>
</tr>
<tr class="even">
<td>Power</td>
<td>0.6196</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>304.0</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>The <code>getPowerRates()</code> (as well as <code>getSampleSizeRates()</code>) functions can also be called with a vector argument for the probability <code>pi1</code> in the intervention group. This is illustrated below via a plot of power depending on this probability. For examples of all available plots, see the R Markdown document <a href="https://vignettes.rpact.com/html/rpact_plot_examples.html">How to create admirable plots with rpact</a>.</p>
<div class="cell" data-layout-align="center">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Calculate power for simple design (with sample size 304 as above)</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for probabilities in intervention ranging from 0.3 to 0.5</span></span>
<span id="cb9-3">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">304</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb9-6">)</span>
<span id="cb9-7"></span>
<span id="cb9-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one of several possible plots, this one plotting true effect size vs power</span></span>
<span id="cb9-9">powerResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Figure: example for an overall power plot</figcaption>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-size-calculation-for-a-non-inferiority-trial-with-two-groups-without-interim-analyses" class="level1">
<h1>Sample size calculation for a non-inferiority trial with two groups without interim analyses</h1>
<p>For non-inferiority trials, sample size calculation proceeds in the same fashion as for superiority trials except that the role of the null and the alternative hypothesis are reversed. I.e., in this case, the non-inferiority margin <img src="https://latex.codecogs.com/png.latex?%5CDelta"> corresponds to the treatment effect under the null hypothesis (<code>thetaH0</code>) which one aims to reject. Testing in non-inferiority trials is always one-sided. In the following example, we set the non-inferiority margin to <img src="https://latex.codecogs.com/png.latex?%5CDelta%20=%200.1">, meaning that the alternative hypothesis consists of risk differences <code>pi1 - pi2 &lt; 0.1</code>. Note that this means that the event of interest is unfavorable (e.g., a treatment failure), in contrast to the above example.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Sample size for a non-inferiority trial</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Assume pi(control) = pi(intervention) = 0.2</span></span>
<span id="cb10-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Test H0: pi1 - pi2 = 0.1 (risk increase in intervention &gt;= Delta = 0.1)</span></span>
<span id="cb10-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># vs. H1: pi1 - pi2 &lt; 0.1</span></span>
<span id="cb10-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, </span>
<span id="cb10-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb10-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb10-12">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0.1, H1: pi(1) = 0.2, control rate pi(2) = 0.2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.028</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>508.4</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="sample-size-calculation-for-a-single-arm-trial-without-interim-analyses" class="level1">
<h1>Sample size calculation for a single arm trial without interim analyses</h1>
<p>The function <code>getSampleSizeRates()</code> allows to set the number of <code>groups</code> (which is 2 by default) to 1 for the design of single-arm trials. The probability under the null hypothesis can be specified with the argument <code>thetaH0</code>and the specific alternative hypothesis which is used for the sample size calculation is provided using the argument <code>pi1</code>. The sample size calculation can be based either on a normal approximation (<code>normalApproximation = TRUE</code>, the default) or on exact binomial probabilities (<code>normalApproximation = FALSE</code>).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Sample size for a single arm trial which tests</span></span>
<span id="cb11-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># H0: pi = 0.1 vs. H1: pi = 0.25</span></span>
<span id="cb11-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (use conservative exact binomial calculation)</span></span>
<span id="cb11-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, </span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>,</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb11-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb11-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb11-12">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a one-sample test for rates (exact test, conservative solution), H0: pi = 0.1, H1: pi = 0.25.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.181</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>53.0</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="sample-size-calculation-for-group-sequential-designs" class="level1">
<h1>Sample size calculation for group sequential designs</h1>
<p>Sample size calculation for a group sequential trial is performed in <strong>two steps</strong>:</p>
<ol type="1">
<li><strong>Define the (abstract) group sequential design</strong> using the function <code>getDesignGroupSequential()</code>. For details regarding this step, see the vignette <a href="https://rpact.com/vignettes/rpact_boundary_examples">Defining group sequential boundaries with rpact</a>.</li>
<li><strong>Calculate sample size</strong> for the binary endpoint by feeding the abstract design into the function <code>getSampleSizeRates()</code>. Note that the power <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cbeta"> needs to be defined in the design function via the type II error <code>beta</code>, and not in <code>getSampleSizeRates()</code>.</li>
</ol>
<p>In general, <a href="https://cran.r-project.org/package=rpact">rpact</a> supports both one-sided and two-sided group sequential designs. However, if futility boundaries are specified, only one-sided tests are permitted.</p>
<p>R code for a simple example is provided below:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example: Group-sequential design with  O'Brien &amp; Fleming type alpha-spending and</span></span>
<span id="cb12-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one interim at 60% information</span></span>
<span id="cb12-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb12-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb12-9">)</span>
<span id="cb12-10"></span>
<span id="cb12-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sample size calculation assuming event probabilities are 25% in control</span></span>
<span id="cb12-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (pi2 = 0.25) vs 40% (pi1 = 0.4) in intervention</span></span>
<span id="cb12-13">sampleSizeResultGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb12-14">  design, </span>
<span id="cb12-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, </span>
<span id="cb12-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb12-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Standard rpact output (sample size object only, not design object)</span></span>
<span id="cb12-18">sampleSizeResultGS</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for rates</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.600, 1.000</li>
<li><em>Critical values</em>: 2.669, 1.981</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.003808, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.003808, 0.023798</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.400</li>
<li><em>Assumed control rate</em>: 0.250</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Risk ratio</em>: FALSE</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 306.3</li>
<li><em>Maximum number of subjects (1)</em>: 153.2</li>
<li><em>Maximum number of subjects (2)</em>: 153.2</li>
<li><em>Number of subjects [1]</em>: 183.8</li>
<li><em>Number of subjects [2]</em>: 306.3</li>
<li><em>Expected number of subjects under H0</em>: 305.9</li>
<li><em>Expected number of subjects under H0/H1</em>: 299.3</li>
<li><em>Expected number of subjects under H1</em>: 268.1</li>
<li><em>Reject per stage [1]</em>: 0.3123</li>
<li><em>Reject per stage [2]</em>: 0.4877</li>
<li><em>Early stop</em>: 0.3123</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.187</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.104</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>We see from the output that the maximum number of subjects for the trial per treatment group is 153.2 patients. Rounding up, this yields 154 patients per treatment group and a total maximum sample size of 308 patients. The maximum sample size of the two-stage design is thus only marginally larger than the maximum sample size of the fixed design with the same parameters (which was 304 patients).</p>
<p>The <code>summary()</code> command produces the output</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">sampleSizeResultGS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) = 0.4, control rate pi(2) = 0.25.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>60%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0038</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0038</td>
<td>0.0238</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.669</td>
<td>1.981</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.187</td>
<td>0.104</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.3123</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>183.8</td>
<td>306.3</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>268.1</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0038</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.3123</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Rates</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_binary_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_04.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Enrichment Designs for Testing Rates with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_enrichment_designs_simulation_rates/</link>
  <description><![CDATA[ 




<section id="summary" class="level1 unnumbered">
<h1 class="unnumbered">Summary</h1>
<p>This document provides examples for simulating test characteristics for multi-stage enrichment designs for testing rates with <a href="https://cran.r-project.org/package=rpact">rpact</a>. Specifically, it is shown how to obtain the simulation results for the example provided in Wassmer &amp; Brannath (2016), Sect. 11.2. An example showing how to obtain results from a data analysis is provided too.</p>
</section>
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>Adaptive enrichment designs are applicable in situations where studies of unselected patients might be unable to detect a drug effect and therefore it seems necessary to “enrich” the study with potential responders, defined as a subpopulation of the unselected patient population. If this is done in an adaptive and data-driven way (i.e., it is not clear upfront whether to use the selected population and this is decided based on data observed at an interim stage) we might use adaptive population enrichment designs.</p>
</section>
<section id="adaptive-enrichment-designs" class="level1">
<h1>Adaptive Enrichment Designs</h1>
<p>Adaptive population enrichment designs enable the data-driven selection of one or more pre-specified subpopulations in an interim analysis and the confirmatory proof of efficacy in the selected subset(s) at the end of the trial. Sample size reassessment and other adaptive design changes can be performed as well. Strong control of the familywise error rate (FWER) is guaranteed by the use of <img src="https://latex.codecogs.com/png.latex?p">-value combination tests together with the closed testing principle.</p>
<p>Enrichment factors may be predictive biomarkers, or they may be biomarkers or clinicopathologic or demographic characteristics associated with a predictive biomarker or with the target of a therapeutic agent. The lower the proportion of truly benefiting patients, the more advantageous it is to consider studying an enriched population. However, instead of limiting the enrollment only to the narrow subpopulation of interest, prospectively specified adaptive designs may also be used to consider the effect of the experimental treatment both in the wider entire patient population under investigation and in various subpopulations.</p>
<p>Assume that there is a full population <img src="https://latex.codecogs.com/png.latex?F"> with <img src="https://latex.codecogs.com/png.latex?G%20-%201"> pre-specified subpopulations of interest denoted as <img src="https://latex.codecogs.com/png.latex?S_1,%20S_2,%20%5Cldots,%20S_%7BG-1%7D"> such that <img src="https://latex.codecogs.com/png.latex?S_g%20%5Csubset%20F">. Let <img src="https://latex.codecogs.com/png.latex?S_G"> denote the full population <img src="https://latex.codecogs.com/png.latex?F">. Assume a binary endpoint and consider a set of <img src="https://latex.codecogs.com/png.latex?G"> elementary hypotheses</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%20%20%20%20H_0%5E%7BS_g%7D:%20%5Cpi_1%5Eg%20=%20%5Cpi_2%5Eg,%20%5C;%20g%20=%201,%5Cldots,G,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cpi_i%5Eg"> denotes the unknown rates in treatment group <img src="https://latex.codecogs.com/png.latex?i">, <img src="https://latex.codecogs.com/png.latex?i=1,2">, and population <img src="https://latex.codecogs.com/png.latex?g">, <img src="https://latex.codecogs.com/png.latex?g%20=%201,%5Cldots,G">. That is, <img src="https://latex.codecogs.com/png.latex?H_0%5E%7BS_g%7D"> refers to the response rate of the experimental treatment <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%5Eg"> versus control <img src="https://latex.codecogs.com/png.latex?%5Cpi_2%5Eg"> in subpopulation <img src="https://latex.codecogs.com/png.latex?S_g">.</p>
<p>At each stage <img src="https://latex.codecogs.com/png.latex?k">, <img src="https://latex.codecogs.com/png.latex?k=1,%5Cldots,K">, consider the test statistic</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%20%20%20%20Z%5Eg=%5Cfrac%7B%5Chat%5Cpi_1%5Eg%20-%20%5Chat%5Cpi_2%5Eg%7D%7B%5Csqrt%7B%5Chat%7B%5Cbar%5Cpi%7D%5Eg(1-%5Chat%7B%5Cbar%5Cpi%7D%5Eg)%7D%7D%0A%20%20%20%20%5CBig(%5Cfrac%7B1%7D%7Bn_1%5Eg%7D+%5Cfrac%7B1%7D%7Bn_2%5Eg%7D%5CBig)%5E%7B-1/2%7D,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cpi_1%5Eg"> and <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cpi_2%5Eg"> are the observed rates at stage <img src="https://latex.codecogs.com/png.latex?k"> in the two treatment groups and <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Cbar%5Cpi%7D%5Eg%20=%20(n_1%5Eg%5Chat%5Cpi_1%5Eg+n_2%5Eg%5Chat%5Cpi_2%5Eg)/(n_1%5Eg+n_2%5Eg)"> is the observed cumulative rate in population <img src="https://latex.codecogs.com/png.latex?S%5Eg"> (at stage <img src="https://latex.codecogs.com/png.latex?k">). These test statistics are approximately normal and so the stage-wise <img src="https://latex.codecogs.com/png.latex?p%5C,">-values are calculated with the use of the normal cdf. If a subpopulation consists of several subsets, a stratified analysis should be performed where the corresponding Cochran-Mantel-Haenszel (CMH) test is applied.</p>
<p>The closed system of hypotheses consists of all possible intersection hypotheses</p>
<p><img src="https://latex.codecogs.com/png.latex?%20%20%0AH_0%5E%7B%5Ccal%20J%7D%20=%20%5Cbigcap_%7Bg%20%5Cin%20%7B%5Ccal%20J%7D%7D%20H_0%5E%7BS_g%7D,%20%5C;%20%7B%5Ccal%20J%7D%20%5Csubseteq%20%5C%7B1,%5Cldots,G%5C%7D.%0A"></p>
<p>The global test decision follows from testing the global hypothesis</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%20%20%20%20H_0%20=%20%5Cbigcap_%7Bg%20=%201%7D%5EG%20H_0%5E%7BS_g%7D%0A"></p>
<p>with a suitable global intersection test. If the global null hypothesis <img src="https://latex.codecogs.com/png.latex?H_0"> can be rejected, all other intersection hypotheses are then tested. By performing the closed test procedure, an elementary hypothesis <img src="https://latex.codecogs.com/png.latex?H_0%5E%7BS_g%7D"> can be rejected if the combination test fulfills the rejection criterion for all <img src="https://latex.codecogs.com/png.latex?H_0%5E%7B%5Ccal%20J%7D"> with <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20J%7D%20%5Cni%20g">.</p>
<p>Given a combination function <img src="https://latex.codecogs.com/png.latex?C(%5Ccdot,%5Ccdot)">, at the second stage the hypothesis belonging to a selected subpopulation <img src="https://latex.codecogs.com/png.latex?s"> is rejected if</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmin%5Climits_%7B%7B%5Ccal%20J%7D%20%5Cni%20s%7D%20C(p_%7B%7B%5Ccal%20J%7D%7D,q_%7B%7B%5Ccal%20J%7D%20%5Cbackslash%20%7B%5Ccal%20E%7D%7D)%20%5Cgeq%20u_2%5C;,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20E%7D%5Csubset%5C%7B1,%5Cldots,G%5C%7D"> denotes the index set of all excluded <img src="https://latex.codecogs.com/png.latex?H_0%5Eg">, <img src="https://latex.codecogs.com/png.latex?%7B%5Ccal%20J%7D%5Ccap%20%7B%5Ccal%20E%7D%5Cnot=%5Cemptyset">, and <img src="https://latex.codecogs.com/png.latex?u_2"> denotes the critical value for the second stage.</p>
<p>For <img src="https://latex.codecogs.com/png.latex?G%20=%202">, using the adaptive closed test procedure, at an interim stage one can decide to continue to stage 2 to test <img src="https://latex.codecogs.com/png.latex?H_0%5EF"> and <img src="https://latex.codecogs.com/png.latex?H_0%5ES">, <img src="https://latex.codecogs.com/png.latex?H_0%5EF"> only, or <img src="https://latex.codecogs.com/png.latex?H_0%5ES"> only. Note that for a two-stage trial where no subpopulation is selected at interim, the complete set of intersection hypotheses is tested at each stage, yielding <img src="https://latex.codecogs.com/png.latex?p%5C,">-values <img src="https://latex.codecogs.com/png.latex?p_%7B%5Ccal%20J%7D"> and <img src="https://latex.codecogs.com/png.latex?q_%7B%5Ccal%20J%7D"> for each intersection hypothesis <img src="https://latex.codecogs.com/png.latex?H_0%5E%7B%5Ccal%20J%7D">. These <img src="https://latex.codecogs.com/png.latex?p%5C,">-values are combined according to the specified combination test, for example, the inverse normal method or Fisher’s combination test. This combination test might have a power disadvantage as compared to the single-stage non-adaptive test where the <img src="https://latex.codecogs.com/png.latex?p%5C,">-values would be obtained from the pooled data. However, we have the advantage that data-driven adaptations including subgroup selection are possible, thereby improving power.</p>
</section>
<section id="the-simulation-function" class="level1">
<h1>The Simulation Function</h1>
<p>First, load the R packages <code>dplyr</code>, <code>ggplot2</code>, and <code>gridExtra</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gridExtra)</span></code></pre></div></div>
</div>
<p>Second, as always, load the rpact package:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># should be version 3.3 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>The <a href="https://cran.r-project.org/package=rpact">rpact</a> function <code>getSimulationEnrichmentRates()</code> performs the simulation of a population enrichment design for testing the difference of proportions in two treatment groups. The way of how these simulations can be performed is similar to the case of multi-armed designs. Particularly, see the vignettes <a href="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis">Planning and Analyzing a Group-Sequential Multi-Arm Multi-Stage Design with Binary Endpoint using rpact</a> and <a href="https://www.rpact.org/vignettes/planning/rpact_multi_arm_simulation_means_examples">Simulating Multi-Arm Designs with a Continuous Endpoint using rpact</a>. Examples for creating plots for enrichment design simulations are illustrated in the vignette <a href="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/">How to Create One- and Multi-Arm Simulation Result Plots with rpact</a>.</p>
<p>An essentially new part required for enrichment designs is the definition of effect sizes and prevalences for the considered subpopulations. These typically consist of subsets of the considered entire (full) population (see Sect. 11.2 in Wassmer &amp; Brannath, 2016).</p>
<p>For <img src="https://latex.codecogs.com/png.latex?G%20=%202">, one subpopulation <img src="https://latex.codecogs.com/png.latex?S"> is considered. Here, we have to specify the prevalence of <img src="https://latex.codecogs.com/png.latex?S"> and the assumed effect sizes in <img src="https://latex.codecogs.com/png.latex?S"> and <img src="https://latex.codecogs.com/png.latex?R%20=%20F%5Cbackslash%20S">. The effect in <img src="https://latex.codecogs.com/png.latex?F"> is a weighted average of the effect sizes in the disjoint subgroups <img src="https://latex.codecogs.com/png.latex?S"> and <img src="https://latex.codecogs.com/png.latex?R">, respectively. There is typically a large number of possible configurations because each effect size in <img src="https://latex.codecogs.com/png.latex?S"> is combined with the effect sizes in <img src="https://latex.codecogs.com/png.latex?R">. For <img src="https://latex.codecogs.com/png.latex?G%20=%203">, things are more difficult. Generally, prevalences and effect sizes have to be specified for four subsets of <img src="https://latex.codecogs.com/png.latex?F"> and even more possible configurations have to be considered. Note that also the case of nested or non-overlapping subpopulations can be considered as illustrated in Fig. 11.4 in Wassmer &amp; Brannath (2016). <a href="https://cran.r-project.org/package=rpact">rpact</a> allows up to <img src="https://latex.codecogs.com/png.latex?G%20=%204">, however, eight subsets need to be specified here.</p>
<p>In the <a href="https://cran.r-project.org/package=rpact">rpact</a> function <code>getSimulationEnrichmentRates()</code>, the parameter <code>effectList</code> has to be defined which is a list of parameters defining the subsets and yielding the subpopulations and their prevalences and effect sizes. We illustrate this for <img src="https://latex.codecogs.com/png.latex?G%20=%202"> by the example presented in Wassmer &amp; Dragalin (2015) and Wassmer &amp; Brannath (2016), Sect. 11.2, and show how the results given there can be recalculated with the <code>rpact</code> function <code>getSimulationEnrichmentRates()</code>.</p>
</section>
<section id="a-simulation-trial-example" class="level1">
<h1>A Simulation Trial Example</h1>
<p>The study under consideration is the <strong>I</strong>nvestigation of <strong>S</strong>erial Studies to <strong>P</strong>redict <strong>Y</strong>our <strong>T</strong>herapeutic <strong>R</strong>esponse with <strong>I</strong>maging <strong>A</strong>nd mo<strong>L</strong>ecular <strong>A</strong>nalysis (I-SPY 2 TRIAL) which is an ongoing clinical trial in patients with high-risk primary breast cancer. It involves a randomized phase II screening process in which a series of experimental drugs are evaluated in combination with standard neoadjuvant chemotherapy which is given prior to surgery. The primary endpoint is pathologic complete response (pCR) at the time of surgery (for details, see Barker et al., 2009).</p>
<p>The screening process includes a Magnetic Resonance Imaging to establish tumor size at baseline and a biopsy to identify the tumor’s hormone-receptor status (HR) and the HER2/neu status (HER2). Triple negative breast cancer (TNBC) refers to breast cancer that does not express the genes for the estrogen receptor, the progesterone receptor, and HER2.</p>
<p>Assume that one of the experimental drugs has been identified from I-SPY 2 TRIAL with the biomarker signature of TNBC but also with some promising effect in the HER2 negative (HER2-) biomarker signature. The sponsor may consider a confirmatory Phase III trial in TNBC patients only. The prevalence of TNBC, however, is only 34%, while the prevalence of HER2- is 63%. Therefore, an alternative option is to run a confirmatory trial with a two-stage enrichment design starting with the HER2- patients as the full population, but with the preplanned option of selecting the TNBC patients after the first stage if the observed effect is not promising in the HER2- patients with positive hormone-receptor status (HR+).</p>
<p>If a pCR rate in the control arm of 0.3 and a treatment effect of 0.2 (measured as the difference in pCR rates between the new drug and control) is assumed, the required total sample size for a conventional two-arm test with power 90% and one-sided significance level 0.0125 (i.e., applying Bonferroni correction) is 294. This can be found with <a href="https://cran.r-project.org/package=rpact">rpact</a> using the command</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0125</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb4-6">)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>nFixed <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 294</code></pre>
</div>
</div>
<p>It will serve as a first guess for the actually needed sample size and we illustrate the enrichment design for this study assuming that a total sample size of 300 subjects will be enrolled in the trial.</p>
<p>The interim analysis is planned after 150 subjects and no early stopping is intended. The design under consideration therefore will be</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span></span>
<span id="cb6-4">)</span></code></pre></div></div>
</div>
<p>A subpopulation selection using the <img src="https://latex.codecogs.com/png.latex?%5Cepsilon">-selection rule with <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%200.1"> will be considered, i.e., if the difference in pCR is smaller than 0.1, both populations are selected and the decision at the interim analysis will be to either select the TNBC subpopulation or going on with the full population of HER2- patients. If the observed treatment effect difference exceeds 0.1 in favor of the TNBC population, the TNBC subpopulation will be selected, otherwise no selection will be considered. In this case, the test for the full population only will be conducted if the observed treatment effect difference exceeds 0.1 in favor of the F population; otherwise the test for both populations will be conducted. The inverse normal combination testing strategy together with the Simes intersection test will be used. We use the Simes test here to avoid futility stops that are possibly due to the use of the Bonferroni correction.</p>
<p>In I-SPY 1 TRIAL, a prevalence of TNBC patients in the HER2- population of about 54% (<img src="https://latex.codecogs.com/png.latex?%5Capprox%2034/63%5Ccdot%20100">%) and a control pCR rate in TNBC patients of 0.34 was observed. The control pCR rate in the HER2- patients with HR+ hormone receptor is 0.23. The operating characteristics of the enrichment design are investigated for treatment effect differences ranging from 0 to 0.3 by an increment of 0.05 in the TNBC subpopulation and ranging from 0 to 0.2 by an increment of 0.10 in the HER2- patients with HR+ hormone receptor. This yields 21 different scenarios for the effect sizes that are defined in the parameter list <code>effectList</code> as follows.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>),</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.46</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.54</span>),</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span>),</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expand.grid</span>(</span>
<span id="cb7-6">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>,</span>
<span id="cb7-7">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span></span>
<span id="cb7-8">    )</span>
<span id="cb7-9">)</span>
<span id="cb7-10">effectList</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$subGroups
[1] "R" "S"

$prevalences
[1] 0.46 0.54

$piControl
[1] 0.23 0.34

$piTreatments
   Var1 Var2
1  0.23 0.34
2  0.33 0.34
3  0.43 0.34
4  0.23 0.39
5  0.33 0.39
6  0.43 0.39
7  0.23 0.44
8  0.33 0.44
9  0.43 0.44
10 0.23 0.49
11 0.33 0.49
12 0.43 0.49
13 0.23 0.54
14 0.33 0.54
15 0.43 0.54
16 0.23 0.59
17 0.33 0.59
18 0.43 0.59
19 0.23 0.64
20 0.33 0.64
21 0.43 0.64</code></pre>
</div>
</div>
<p>We see that different situations as specified per row of <code>piTreatments</code> can be considered. For the above definition, using the specified prevalences, this yields the following 21 treatment effect differences for the full population <img src="https://latex.codecogs.com/png.latex?F"> (see Table 11.3 in Wassmer &amp; Brannath, 2016):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">diffEffectsF <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piTreatments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span></span>
<span id="cb9-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piControl, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb9-3">(diffEffectsF <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>prevalences, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rowSums</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.matrix</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>       [,1]
 [1,] 0.000
 [2,] 0.046
 [3,] 0.092
 [4,] 0.027
 [5,] 0.073
 [6,] 0.119
 [7,] 0.054
 [8,] 0.100
 [9,] 0.146
[10,] 0.081
[11,] 0.127
[12,] 0.173
[13,] 0.108
[14,] 0.154
[15,] 0.200
[16,] 0.135
[17,] 0.181
[18,] 0.227
[19,] 0.162
[20,] 0.208
[21,] 0.254</code></pre>
</div>
</div>
<p>For the moment, we want to consider only one situation, namely</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>),</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.46</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.54</span>),</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span>),</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.43</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.54</span>)</span>
<span id="cb11-6">)</span></code></pre></div></div>
</div>
<p>That is, we consider the same effect difference (= 0.20) in each of the two subset, S and R. The design characteristics of 10,000 simulations are generated and summarized as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentRates</span>(</span>
<span id="cb12-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>),</span>
<span id="cb12-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stratifiedAnalysis =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"epsilon"</span>,</span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">epsilonValue =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb12-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>,</span>
<span id="cb12-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span></span>
<span id="cb12-11">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output-display">
<p><em>Simulation of a binary endpoint (enrichment design)</em></p>
<p>Sequential analysis with a maximum of 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a population enrichment comparisons for rates (treatment vs.&nbsp;control, 2 populations), H0: pi(treatment) - pi(control) = 0, power directed towards larger values, H1: assumed pi(treatment) = c(0.54, 0.43), subgroups = c(S, R), prevalences = c(0.54, 0.46), control rates pi(control) = c(0.34, 0.23), planned cumulative sample size = c(150, 300), intersection test = Simes, selection = epsilon rule, eps = 0.1, effect measure based on effect estimate, success criterion: all, simulation runs = 500, seed = 12345.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>Inf</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td>0.9160</td>
</tr>
<tr class="even">
<td>Rejected populations per stage</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S</td>
<td>0</td>
<td>0.7360</td>
</tr>
<tr class="even">
<td>Full population F</td>
<td>0</td>
<td>0.8360</td>
</tr>
<tr class="odd">
<td>Success per stage</td>
<td>0</td>
<td>0.8020</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S</td>
<td>81.0</td>
<td>86.5</td>
</tr>
<tr class="even">
<td>Remaining population R</td>
<td>69.0</td>
<td>63.5</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>300.0</td>
</tr>
<tr class="even">
<td>Overall exit probability</td>
<td>0</td>
<td></td>
</tr>
<tr class="odd">
<td>Selected populations</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S</td>
<td>1.0000</td>
<td>0.9280</td>
</tr>
<tr class="odd">
<td>Full population F</td>
<td>1.0000</td>
<td>0.9200</td>
</tr>
<tr class="even">
<td>Number of populations</td>
<td>2.000</td>
<td>1.848</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.7847</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We see in <code>Reject at least one</code> that the power requirement is more or less exactly fulfilled and that there is a considerably higher chance to reject F. By default, <code>successCriterion =  "all"</code> and therefore rejecting both populations, in this situation, has a probability of around 76%.</p>
<p>The design characteristics for the whole number of situations and 10,000 simulations per scenario are generated as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>),</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.46</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.54</span>),</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span>),</span>
<span id="cb13-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expand.grid</span>(</span>
<span id="cb13-6">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>,</span>
<span id="cb13-7">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span></span>
<span id="cb13-8">    )</span>
<span id="cb13-9">)</span>
<span id="cb13-10"></span>
<span id="cb13-11">simResultsPE <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentRates</span>(</span>
<span id="cb13-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>),</span>
<span id="cb13-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb13-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stratifiedAnalysis =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb13-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb13-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"epsilon"</span>,</span>
<span id="cb13-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">epsilonValue =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb13-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>,</span>
<span id="cb13-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span></span>
<span id="cb13-21">    )</span></code></pre></div></div>
</div>
<p>The results from Table 11.3 in Wassmer &amp; Brannath (2016) are obtained from <code>simResultsPE</code> as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">simResultsPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rejectAtLeastOne <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.matrix</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>       [,1]
 [1,] 0.018
 [2,] 0.076
 [3,] 0.220
 [4,] 0.082
 [5,] 0.146
 [6,] 0.406
 [7,] 0.228
 [8,] 0.414
 [9,] 0.598
[10,] 0.450
[11,] 0.536
[12,] 0.758
[13,] 0.712
[14,] 0.784
[15,] 0.872
[16,] 0.876
[17,] 0.908
[18,] 0.968
[19,] 0.964
[20,] 0.976
[21,] 0.994</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">simResultsPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rejectedPopulationsPerStage[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, , ] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>       [,1]  [,2]
 [1,] 0.014 0.016
 [2,] 0.012 0.076
 [3,] 0.024 0.218
 [4,] 0.064 0.050
 [5,] 0.082 0.126
 [6,] 0.092 0.402
 [7,] 0.202 0.108
 [8,] 0.258 0.364
 [9,] 0.232 0.584
[10,] 0.428 0.172
[11,] 0.434 0.386
[12,] 0.430 0.708
[13,] 0.698 0.212
[14,] 0.706 0.588
[15,] 0.658 0.766
[16,] 0.870 0.276
[17,] 0.862 0.568
[18,] 0.850 0.834
[19,] 0.962 0.226
[20,] 0.968 0.484
[21,] 0.954 0.768</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">simResultsPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>selectedPopulations[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, , ] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>       [,1]  [,2]
 [1,] 0.934 0.948
 [2,] 0.782 0.988
 [3,] 0.598 0.992
 [4,] 0.974 0.872
 [5,] 0.862 0.956
 [6,] 0.666 0.994
 [7,] 0.994 0.792
 [8,] 0.930 0.930
 [9,] 0.810 0.980
[10,] 0.992 0.666
[11,] 0.972 0.830
[12,] 0.852 0.946
[13,] 0.996 0.520
[14,] 0.980 0.808
[15,] 0.930 0.894
[16,] 0.998 0.424
[17,] 0.986 0.674
[18,] 0.950 0.868
[19,] 1.000 0.278
[20,] 0.998 0.522
[21,] 0.978 0.774</code></pre>
</div>
</div>
<p>The probability to select one population is obtained from <code>numberOfPopulations</code> through</p>
<p>P(select one population) + 2 * (1 - P(select one population)) = numberOfPopulations:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> simResultsPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfPopulations[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, ]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.matrix</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>       [,1]
 [1,] 0.118
 [2,] 0.230
 [3,] 0.410
 [4,] 0.154
 [5,] 0.182
 [6,] 0.340
 [7,] 0.214
 [8,] 0.140
 [9,] 0.210
[10,] 0.342
[11,] 0.198
[12,] 0.202
[13,] 0.484
[14,] 0.212
[15,] 0.176
[16,] 0.578
[17,] 0.340
[18,] 0.182
[19,] 0.722
[20,] 0.480
[21,] 0.248</code></pre>
</div>
</div>
<p>Note that the <code>as.matrix()</code> command used for the power (<code>rejectAtLeastOne</code>) and <code>numberOfPopulations</code> is only employed for better readability and is not essential.</p>
<p>The power of the design (the probability to reject at least one null hypothesis) is greater than 90% for scenarios 17-21, mainly corresponding to treatment effects 0.25 and 0.3 for <img src="https://latex.codecogs.com/png.latex?S">. Hence, in these cases a total sample size of 300 patients reaches the desired power, and the rough estimate gathered above through the use of the Bonferroni correction provides a good estimate for the necessary sample size. Note that the term power is used here also for the cases where the null hypothesis is true (Scenarios 1-3). This, however, illustrates <em>strong</em> control of FWER (see the first three values of <code>rejectedPopulationsPerStage[2, ,1]</code>). Note that in the records, the first column refers to S, whereas the second refers to F.</p>
<p>The results also show that the power to reject in the full population (except for effect size <img src="https://latex.codecogs.com/png.latex?%5Cgeq%200.2"> and <img src="https://latex.codecogs.com/png.latex?%3C%200.3"> in both subsets, i.e., scenarios 15 and 18) is smaller than 80%, for largest effect sizes the power even decreases a bit. The latter is due to the fact that in this case, the probability to deselect <img src="https://latex.codecogs.com/png.latex?F"> and to select <img src="https://latex.codecogs.com/png.latex?S"> increases. For most scenarios the probability to reduce the confirmatory proof to one hypothesis, <img src="https://latex.codecogs.com/png.latex?H_0%5ES"> or <img src="https://latex.codecogs.com/png.latex?H_0%5EF">, is quite small.</p>
<p>The probability for enrichment, i.e., the selection of <img src="https://latex.codecogs.com/png.latex?S"> at the interim stage, varies between 1% and 70% over the scenarios and can be derived from P(Select <img src="https://latex.codecogs.com/png.latex?F">) = <code>selectedPopulations[2, ,2]</code> as P(Enrichment) = 1 - P(Select <img src="https://latex.codecogs.com/png.latex?F">).</p>
<p>The question arises if this might reduce power (defined as above) due to wrongly selecting a population. The answer is no, as illustrated in the figure below. Here it is shown that for all effect sizes in <img src="https://latex.codecogs.com/png.latex?%5Cbar%20S%20=%20R"> there is no decrease, for effect size 0 there is even a clear increase in power showing the advantage of an adaptive enrichment design as compared to the non-adaptive case. In the figure, the dashed lines refer to the cases with selection and the solid lines to the non-adaptive case.</p>
<div class="cell">
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_enrichment_designs_simulation_rates/index_files/figure-html/unnamed-chunk-16-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>The following code is used to create the plots above:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">simResultsFixed <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentRates</span>(</span>
<span id="cb22-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>),</span>
<span id="cb22-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb22-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stratifiedAnalysis =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb22-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb22-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>,</span>
<span id="cb22-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>,</span>
<span id="cb22-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span></span>
<span id="cb22-10">    )</span>
<span id="cb22-11"></span>
<span id="cb22-12">dataAll <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb22-13">    simResultsFixed <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(),</span>
<span id="cb22-14">    simResultsPE <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>()</span>
<span id="cb22-15">)</span>
<span id="cb22-16">dataAll<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>effectS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piTreatments<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Var2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piControl[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb22-17">dataAll<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>effectNotS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piTreatments<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Var1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effectList<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>piControl[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-19"></span>
<span id="cb22-20">dataStage2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dataAll <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stages <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb22-22"></span>
<span id="cb22-23">plotPowerDiff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(effectR) {</span>
<span id="cb22-24">    dataSub <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dataStage2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-25">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(effectNotS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> effectR)</span>
<span id="cb22-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(</span>
<span id="cb22-27">        dataSub,</span>
<span id="cb22-28">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(</span>
<span id="cb22-29">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> effectS, </span>
<span id="cb22-30">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> rejectAtLeastOne,</span>
<span id="cb22-31">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> typeOfSelection,</span>
<span id="cb22-32">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> typeOfSelection</span>
<span id="cb22-33">        )</span>
<span id="cb22-34">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-35">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show.legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-36">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-37">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-38">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Effect S"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-39">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-40">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Effect R = "</span>, effectR))</span>
<span id="cb22-41">}</span>
<span id="cb22-42">plot1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plotPowerDiff</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectR =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb22-43">plot2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plotPowerDiff</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectR =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb22-44">plot3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plotPowerDiff</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectR =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)</span>
<span id="cb22-45"></span>
<span id="cb22-46">gridExtra<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grid.arrange</span>(plot1, plot2, plot3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
</div>
<p>Note that the definition of <code>subGroups</code> in the list determines how many and which type of subpopulations is considered for the clinical trial situation. In <a href="https://cran.r-project.org/package=rpact">rpact</a>, up to four subpopulations can be considered:</p>
<p>For <img src="https://latex.codecogs.com/png.latex?G%20=%203">, <code>subGroups</code> with (fixed) names “R”,“S1”, “S2”, and “S12” have to be specified, i.e.,</p>
<p><code>subGroups = c("R", "S1", "S2", "S12")</code></p>
<p>and <code>prevalences</code>, <code>piControl</code> and <code>piTreatments</code> consist of four elements per situation.</p>
<p>For <img src="https://latex.codecogs.com/png.latex?G%20=%204">, <code>subGroups</code> with (fixed) names “R”,“S1”, “S2”, “S2”, “S12”, “S13” “S23” and “S123” have to be specified, i.e.,</p>
<p><code>subGroups = c("R","S1", "S2", "S3", "S12", "S13", "S23", "S123")</code></p>
<p>and <code>prevalences</code>, <code>piControl</code> and <code>piTreatments</code> consist of eight elements per situation.</p>
</section>
<section id="a-data-analysis-example" class="level1">
<h1>A Data Analysis Example</h1>
<p>For a binary endpoint, the calculation of the test statistics and related computations for the test procedure require the number of events and the sample sizes. In <a href="https://cran.r-project.org/package=rpact">rpact</a>, these can be simply specified through <em>separate</em> data sets for the distinct subsets, S and R. For example, assume the results for the first and the second stage in the two subsets are as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb23-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb23-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb23-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>),</span>
<span id="cb23-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb23-6">)</span>
<span id="cb23-7"></span>
<span id="cb23-8">R <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb23-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb23-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>),</span>
<span id="cb23-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>),</span>
<span id="cb23-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>)</span>
<span id="cb23-13">)</span>
<span id="cb23-14"></span>
<span id="cb23-15">F <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb23-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb23-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>),</span>
<span id="cb23-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">68</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">72</span>),</span>
<span id="cb23-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">69</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">69</span>)</span>
<span id="cb23-20">)</span></code></pre></div></div>
</div>
<p>The whole data set and the analysis with Simes’ test is then obtained with</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> R) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Enrichment analysis results for a binary endpoint (2 populations)</em></p>
<p>Sequential analysis with 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a two-sample test for rates, Simes intersection test, normal approximation test, stratified analysis. H0: pi(treatment) - pi(control) = 0 against H1: pi(treatment) - pi(control) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>Inf</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Cumulative effect size S1</td>
<td>0.148</td>
<td>0.140</td>
</tr>
<tr class="even">
<td>Cumulative effect size F</td>
<td>0.135</td>
<td>0.111</td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate S1</td>
<td>0.306</td>
<td>0.307</td>
</tr>
<tr class="even">
<td>Cumulative treatment rate F</td>
<td>0.338</td>
<td>0.321</td>
</tr>
<tr class="odd">
<td>Cumulative control rate S1</td>
<td>0.158</td>
<td>0.167</td>
</tr>
<tr class="even">
<td>Cumulative control rate F</td>
<td>0.203</td>
<td>0.210</td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic S1</td>
<td>1.509</td>
<td>1.380</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic F</td>
<td>1.768</td>
<td>1.167</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value S1</td>
<td>0.0656</td>
<td>0.0838</td>
</tr>
<tr class="even">
<td>Stage-wise p-value F</td>
<td>0.0385</td>
<td>0.1217</td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value S1, F</td>
<td>0.0656</td>
<td>0.1217</td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value S1</td>
<td>0.0656</td>
<td>0.0838</td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value F</td>
<td>0.0385</td>
<td>0.1217</td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic S1, F</td>
<td>1.509</td>
<td>1.892</td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic S1</td>
<td>1.509</td>
<td>2.043</td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic F</td>
<td>1.768</td>
<td>2.075</td>
</tr>
<tr class="odd">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="even">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability S1</td>
<td>0.1034</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability F</td>
<td>0.1034</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval S1</td>
<td></td>
<td>[-0.029; 0.306]</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval F</td>
<td></td>
<td>[-0.021; 0.238]</td>
</tr>
<tr class="odd">
<td>Repeated p-value S1</td>
<td></td>
<td>0.0292</td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td></td>
<td>0.0292</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
</ul>
</div>
</div>
<p>From the first stage, it is seen that the effect differences between S and R, and hence between S and F, are quite similar. Following the <img src="https://latex.codecogs.com/png.latex?%5Cepsilon">-selection rule with <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%200.1">, and since 11/36 - 6/38 = 0.148 and 23/68 - 14/69 = 0.135, no enrichment was performed and both subsets were used in the second stage. After both stages are observed, however, none of the hypotheses can be rejected. As an exercise, the reader is encouraged to verify that the use of the Spiessens and Debois test yields an only negligibly smaller overall <img src="https://latex.codecogs.com/png.latex?p">-value ( = 0.0288) that does not reach significance either. However, the Bonferroni test is considerably worse yielding an overall <img src="https://latex.codecogs.com/png.latex?p">-value of 0.0456.</p>
<p>As an alternative, one might consider the case of enrichment, i.e., to decide at interim to proceed with the trial with the subset S only. The sample size for the second stage can be chosen in a data-driven manner. Because of</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> R) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb25-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb25-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>,</span>
<span id="cb25-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb25-7">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fetch</span>(conditionalPower)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$conditionalPower
     [,1]      [,2]
[1,]   NA 0.8144225
[2,]   NA 0.7290993</code></pre>
</div>
</div>
<p>the conditional power when sticking to the originally planned sample size is large enough (&gt; 80%) for the rejection of the hypothesis for subset S and hence, it might be decided to recruit patients from S only. Assume that the following observations were made: <!-- Comment_MD: The following scenario has ~300 patients in the second stage
instead of 150 (as assumed above) --></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb27-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">46</span>),</span>
<span id="cb27-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>),</span>
<span id="cb27-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">151</span>),</span>
<span id="cb27-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">148</span>)</span>
<span id="cb27-6">)</span>
<span id="cb27-7"></span>
<span id="cb27-8">R <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(</span>
<span id="cb27-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb27-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb27-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb27-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb27-13">)</span></code></pre></div></div>
</div>
<p>This is the result showing clear significance of an effect in S although the observed effect is virtually the same as before:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> R) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Enrichment analysis results for a binary endpoint (2 populations)</em></p>
<p>Sequential analysis with 2 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a two-sample test for rates, Simes intersection test, normal approximation test, stratified analysis. H0: pi(treatment) - pi(control) = 0 against H1: pi(treatment) - pi(control) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>Inf</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Cumulative effect size S1</td>
<td>0.148</td>
<td>0.127</td>
</tr>
<tr class="even">
<td>Cumulative effect size F</td>
<td>0.135</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate S1</td>
<td>0.306</td>
<td>0.305</td>
</tr>
<tr class="even">
<td>Cumulative treatment rate F</td>
<td>0.338</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative control rate S1</td>
<td>0.158</td>
<td>0.177</td>
</tr>
<tr class="even">
<td>Cumulative control rate F</td>
<td>0.203</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic S1</td>
<td>1.509</td>
<td>2.459</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic F</td>
<td>1.768</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value S1</td>
<td>0.0656</td>
<td>0.0070</td>
</tr>
<tr class="even">
<td>Stage-wise p-value F</td>
<td>0.0385</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value S1, F</td>
<td>0.0656</td>
<td>0.0070</td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value S1</td>
<td>0.0656</td>
<td>0.0070</td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value F</td>
<td>0.0385</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic S1, F</td>
<td>1.509</td>
<td>2.806</td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic S1</td>
<td>1.509</td>
<td>2.806</td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic F</td>
<td>1.768</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>TRUE</td>
</tr>
<tr class="even">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability S1</td>
<td>0.1034</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability F</td>
<td>0.1034</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval S1</td>
<td></td>
<td>[0.025; 0.239]</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval F</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value S1</td>
<td></td>
<td>0.0025</td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
</ul>
</div>
</div>
</section>
<section id="references" class="level1">
<h1>References</h1>
<p>Barker, A., Sigman, C., Kelloff, G., Hylton, N., Berry, D., Esserman, L. (2009). I–SPY 2: An adaptive breast cancer trial design in the setting of neoadjuvant chemotherapy. <em>Clinical Pharmacology and Therapeutics</em> 86, 97–100. <a href="https://doi.org/10.1038/clpt.2009.68" class="uri">https://doi.org/10.1038/clpt.2009.68</a></p>
<p>Wassmer, G and Brannath, W. <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em> (2016), ISBN 978-3319325606 <a href="https://doi.org/10.1007/978-3-319-32562-0" class="uri">https://doi.org/10.1007/978-3-319-32562-0</a></p>
<p>Wassmer, G., Dragalin, V. (2015). Designing issues in confirmatory adaptive population enrichment trials. <em>Journal of Biopharmaceutical Statistics</em> 25, 651–669. <a href="https://doi.org/10.1080/10543406.2014.920869" class="uri">https://doi.org/10.1080/10543406.2014.920869</a></p>
<hr>
<p><em>System</em> rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), <em>platform</em> x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Rates</category>
  <category>Analysis</category>
  <category>Enrichment</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_enrichment_designs_simulation_rates/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_12.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Planning and Analyzing a Group-Sequential Multi-Arm Multi-Stage Design with Binary Endpoint using rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Stephen Schueuerhuis](https://www.linkedin.com/in/stephen-sch%C3%BC%C3%BCrhuis-150843183 &quot;Visit Stephen Schueuerhuis&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<!-- 
Note that there will be different packages needed compile this document. 
Throughout the whole document, the package installations are outsourced into separate 
code chunks and to not let them be executed each time the documents is compiled, 
they are commented out. That means that if you plan to compile the document without 
have installed the needed packages, the respective code chunks containing the 
installations need to be "activated" by taking away the comment.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>This document provides an exemplary implementation of multi-arm-multi-stage (MAMS) design with a binary endpoint using <a href="https://cran.r-project.org/package=rpact">rpact</a>. Concretely, the vignette consists of considering design implementation with respect to futility bounds on treatment effect scale, sample size calculations and simulations given different treatment selection approaches. Furthermore, analysis using closed testing will be performed on generic binary and survival data.</p>
<p>Note that <a href="https://cran.r-project.org/package=rpact">rpact</a> itself does not support landmark analysis, i.e.&nbsp;comparison of survival probabilities at a fixed point in time, using the Greenwoods standard error (SE) formula. Thus, the first two analyses are based on the empirical event rates only. The R packages <a href="https://cran.r-project.org/package=gestate">gestate</a> and <a href="https://cran.r-project.org/package=survival">survival</a> are then utilized to briefly show how one could merge the packages to perform the actually intended analysis using boundaries obtained by <a href="https://cran.r-project.org/package=rpact">rpact</a> and test statistics obtained by survival probabilities and standard errors estimated using <a href="https://cran.r-project.org/package=gestate">gestate</a> and <a href="https://cran.r-project.org/package=survival">survival</a>.</p>
<p>For methodological and theoretical background, refer to “Group Sequential and Confirmatory Adaptive Designs in Clinical Trials” by Gernot Wassmer and Werner Brannath.</p>
<p>Before starting, load the <a href="https://cran.r-project.org/package=rpact">rpact</a> package and make sure the version of the package is at least 3.1.0:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="implementation-of-design" class="level1">
<h1>Implementation of design</h1>
<p>Consider we are interested in implementing a group sequential design with <img src="https://latex.codecogs.com/png.latex?3"> stages, <img src="https://latex.codecogs.com/png.latex?3"> treatment arms (<img src="https://latex.codecogs.com/png.latex?2"> active, <img src="https://latex.codecogs.com/png.latex?1"> control), <img src="https://latex.codecogs.com/png.latex?2"> treatment arm comparisons (each active arm vs.&nbsp;the control arm), a binary endpoint, with a global one-sided <img src="https://latex.codecogs.com/png.latex?%5Calpha=0.025">, and the power for each treatment arm comparison set to <img src="https://latex.codecogs.com/png.latex?80%5C%25">, hence <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta=0.8">. Additionally, let the critical boundaries be calculated using alpha-spending O’Brien &amp; Fleming approach and for planning purposes, suppose equally distributed information rates. Further, non-binding futility bounds are to be set in the following way:</p>
<p>Considering the <img src="https://latex.codecogs.com/png.latex?2"> active treatment arms, the goal of both arms is to confirm significant reduction in event (e.g., disease, death) rates as compared to the control arm. Thus, a treatment should be considered futile if there is only a small reduction, no reduction or even an increase in the event rates seen in the data. This can be implemented in a study design in which a treatment arm is considered futile after the first stage if the relative reduction does not exceed <img src="https://latex.codecogs.com/png.latex?5">% (i.e., a rate ratio <img src="https://latex.codecogs.com/png.latex?%5Cgeq%200.95">) and after the second stage in case the data indicates a relative reduction of <img src="https://latex.codecogs.com/png.latex?10">% or less (i.e., a rate ratio <img src="https://latex.codecogs.com/png.latex?%5Cgeq%200.9">). As <a href="https://cran.r-project.org/package=rpact">rpact</a> primarily uses futility bounds specified on the <img src="https://latex.codecogs.com/png.latex?z">-scale, one needs to determine the <img src="https://latex.codecogs.com/png.latex?z">-scale values that correspond to the values listed above. To achieve these values, we may use the fact that the reverse operation, i.e., the calculation of futility bounds on the treatment effect scale given futility bounds specified on the <img src="https://latex.codecogs.com/png.latex?z">-scale, is a part of the routine output of sample size calculation in <a href="https://cran.r-project.org/package=rpact">rpact</a> (given certain treatment effect assumptions). We may thus either heuristically try out various options for futility bounds on the <img src="https://latex.codecogs.com/png.latex?z">-scale and attempt to get as close as possible to the desired futility bounds on the treatment effect scale or implement a search algorithm for higher precision. For simplicity, we assume that the stage-wise futility bounds are independent.</p>
<p>For the design example mentioned above, this can be achieved as follows:</p>
<p>First, one needs to initialize the design and use more or less arbitrary futility bounds on the <img src="https://latex.codecogs.com/png.latex?z">-scale as input:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first and second stage futility on z-scale</span></span>
<span id="cb3-2">fut1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.16</span></span>
<span id="cb3-3">fut2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.39</span></span>
<span id="cb3-4"></span>
<span id="cb3-5">d_fut <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb3-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb3-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(fut1, fut2),</span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb3-14">)</span></code></pre></div></div>
</div>
<p>Note that the specified futility bounds on the <img src="https://latex.codecogs.com/png.latex?z">-scale are <strong>positive</strong>, even though they are intended to later correspond to a <strong>reduced</strong> risk ratio.</p>
<p>Now, as mentioned, the sample size calculation output provides information about the futility boundaries on the treatment effect scale. Therefore, after assuming certain treatment effects, one needs to perform sample size calculation and extract the treatment effect futility bounds from the respective output:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">c_assum <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># assumed rate in control</span></span>
<span id="cb4-2">effect_assum <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative reduction that is to be detected with probability of 0.8</span></span>
<span id="cb4-3"></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rates indicate binary endpoint</span></span>
<span id="cb4-5">ssc_fut <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_fut,</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">riskRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb4-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> c_assum <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effect_assum),</span>
<span id="cb4-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> c_assum</span>
<span id="cb4-10">)</span>
<span id="cb4-11"></span>
<span id="cb4-12">ssc_fut<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>futilityBoundsEffectScale</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>          [,1]
[1,] 0.9464954
[2,] 0.9085874</code></pre>
</div>
</div>
<p>The values printed out above are now the futility bounds on the treatment effect scale which correspond with the values <code>fut1</code> and <code>fut2</code> from above. Since <img src="https://latex.codecogs.com/png.latex?0.9465%20%3C%200.95"> and <img src="https://latex.codecogs.com/png.latex?0.9086%20%3E%200.9">, the input value <code>fut1</code>=<img src="https://latex.codecogs.com/png.latex?0.16"> seems to be slightly too large while <code>fut2</code>=<img src="https://latex.codecogs.com/png.latex?0.39"> seems to be slightly too small (since, in our example, a larger <img src="https://latex.codecogs.com/png.latex?z">-value corresponds to a smaller risk ratio). This indicates how to adjust the input values such that one comes closer to the true corresponding values.</p>
<p>Now, using a one-dimensional search algorithm for each stage or by simply trying different values, one achieves the futility bounds on the <img src="https://latex.codecogs.com/png.latex?z">-scale summarized in the following table:</p>
<div class="cell">
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;"></th>
<th style="text-align: center;">First stage</th>
<th style="text-align: center;">Second stage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Orig. treatment effect scale</td>
<td style="text-align: center;">0.950</td>
<td style="text-align: center;">0.900</td>
</tr>
<tr class="even">
<td style="text-align: left;">Approx. z-Value for given t-Value</td>
<td style="text-align: center;">0.149</td>
<td style="text-align: center;">0.414</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Corresponding t-scale Value</td>
<td style="text-align: center;">0.950</td>
<td style="text-align: center;">0.900</td>
</tr>
<tr class="even">
<td style="text-align: left;">Diff. between Approx. and Input</td>
<td style="text-align: center;">0.000</td>
<td style="text-align: center;">0.000</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>In the table above, the <em>Orig. treatment effect scale</em> is the intended futility bound on treatment effect scale, <em>Approx. <img src="https://latex.codecogs.com/png.latex?z">-value</em> denotes the corresponding <img src="https://latex.codecogs.com/png.latex?z">-scale value approximation and <em>Corresponding <img src="https://latex.codecogs.com/png.latex?t">-scale Value</em> the actual treatment-effect-scale value using the calculated approx. <img src="https://latex.codecogs.com/png.latex?z">-values as input.<br>
One can see that the first stage futility bound on <img src="https://latex.codecogs.com/png.latex?z">-scale should approximately be chosen as <img src="https://latex.codecogs.com/png.latex?0.14915"> and the second stage <img src="https://latex.codecogs.com/png.latex?z">-scale futility bound as <img src="https://latex.codecogs.com/png.latex?0.41381">, resulting in the desired futility bounds on the treatment effect scale of approximately <img src="https://latex.codecogs.com/png.latex?0.95"> in the first and <img src="https://latex.codecogs.com/png.latex?0.9"> in the second stage, respectively. Note that, for simplicity, these futility bounds were identified separately for the first and second stage and under the assumption that, at the respectively other stage, no futility stopping is performed. Therefore, when both futility bounds are used at the same time, small numerical deviations from the target values may occur. In the next chapter on sample size calculation, the respective outputs validate that these <img src="https://latex.codecogs.com/png.latex?z">-scale futility bounds are reasonable choices.</p>
<p>Now that (approximate) futility bounds on the <img src="https://latex.codecogs.com/png.latex?z">-scale are known, the design specified above can be entirely initialized:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># GSD with futility bounds according to above calculations</span></span>
<span id="cb6-2">d <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb6-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.149145</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.41381</span>),</span>
<span id="cb6-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb6-11">)</span>
<span id="cb6-12">d <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming type alpha spending design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0833, ASN H1 0.8652, ASN H01 0.843, ASN H0 0.6133.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0213</td>
<td>0.4471</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.062</td>
<td>0.011</td>
<td></td>
</tr>
</tbody>
</table>
<p>Printing a summary of the defined object gives a nice overview of all relevant design parameters. Note that the adjusted <img src="https://latex.codecogs.com/png.latex?%5Calpha"> of the last stage (<img src="https://latex.codecogs.com/png.latex?=0.0231">) is only slightly lower than the predefined global <img src="https://latex.codecogs.com/png.latex?%5Calpha"> (of <img src="https://latex.codecogs.com/png.latex?0.025">), corresponding to the final critical value of <img src="https://latex.codecogs.com/png.latex?1.993"> being only slightly larger than <img src="https://latex.codecogs.com/png.latex?1.96">, which is due to alpha-spending O’Brien Fleming adjustment. In addition, an overview of the input parameters is provided.</p>
</section>
<section id="sample-size-calculation" class="level1">
<h1>Sample size calculation</h1>
<p>When it comes to sample size calculations for designs with binary endpoints, <a href="https://cran.r-project.org/package=rpact">rpact</a> provides the function <code>getSampleSizeRates()</code>. It should be noted upfront that the default sample size calculation in <a href="https://cran.r-project.org/package=rpact">rpact</a> only allows for one- or two-group comparisons.</p>
<p>The sample size calculation code applicable here has already been used to determine the <img src="https://latex.codecogs.com/png.latex?z">-scale futility boundaries whenever futility boundaries are only given on the treatment effect scale. However, this sections’ purpose now is to provide some more detail on sample size calculations in MAMS-designs with binary endpoint.</p>
<p>Suppose that, in a two-group setting, we define <img src="https://latex.codecogs.com/png.latex?H_0:%20%5Cpi_1-%5Cpi_2%20%5Cgeq%200">, with <img src="https://latex.codecogs.com/png.latex?%5Cpi_1"> representing the assumed event rate in the treatment group and <img src="https://latex.codecogs.com/png.latex?%5Cpi_2"> being the assumed event rate in the reference/control group. Again, let the parameter setting be given as above and assume an expected relative reduction of event occurrence of <img src="https://latex.codecogs.com/png.latex?50%5C%25"> given <img src="https://latex.codecogs.com/png.latex?%5Cpi_2%20=%200.1"> (hence <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.1%5Ccdot0.5=0.05">). Since we are interested in comparing risks via their ratio, we set <code>riskRatio = TRUE</code> which particularly results in testing <img src="https://latex.codecogs.com/png.latex?H_0:%20%5Cfrac%7B%5Cpi_1%7D%7B%5Cpi_2%7D%20%5Cgeq%201"> against <img src="https://latex.codecogs.com/png.latex?H_1:%5Cfrac%7B%5Cpi_1%7D%7B%5Cpi_2%7D%20%3C%201">. The corresponding sample sizes of the trial design defined above can be calculated using the commands:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">c_rate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># assumed rate in control</span></span>
<span id="cb7-2">effect <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative reduction that is to be detected with probability of 0.8</span></span>
<span id="cb7-3"></span>
<span id="cb7-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rates indicate binary endpoint</span></span>
<span id="cb7-5">d_sample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">riskRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> c_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effect),</span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> c_rate</span>
<span id="cb7-10">)</span>
<span id="cb7-11">d_sample <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) / pi(2) = 1, H1: pi(1) = 0.05, control rate pi(2) = 0.1.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t)</td>
<td>0.061</td>
<td>0.476</td>
<td>0.643</td>
</tr>
<tr class="odd">
<td>Futility boundary (t)</td>
<td>0.950</td>
<td>0.903</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0213</td>
<td>0.4471</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>313.8</td>
<td>627.5</td>
<td>941.3</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>751.7</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.5594</td>
<td>0.1828</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.0838</td>
<td>0.4366</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0001</td>
<td>0.0059</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0213</td>
<td>0.4258</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.5593</td>
<td>0.1769</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.0625</td>
<td>0.0108</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
<p>The variable <em>Futility boundary (t)</em> represents the futility bounds transferred to treatment effect scale. The futility boundaries calculated above correspond to a rate ratio of <img src="https://latex.codecogs.com/png.latex?0.950"> at the first stage (i.e., a relative reduction of <img src="https://latex.codecogs.com/png.latex?5%5C%25">) and a rate ratio of <img src="https://latex.codecogs.com/png.latex?0.903"> at the second stage (i.e., a relative reduction of approx. <img src="https://latex.codecogs.com/png.latex?10%5C%25">). As mentioned above, the slight differences to the targeted risk ratios are due to the fact that the futility bounds are calculated independently. However, these differences are small and only occur at the third digit. (The keen-eyed reader may have noticed that the first-stage futility boundary is also not perfectly exact. This is because the sample sizes, which influence the transformation from <img src="https://latex.codecogs.com/png.latex?z">- to treatment effect scale, change slightly when the second-stage futility boundary is introduced.)</p>
<p>Another important information provided by the output is that to achieve the desired study characteristics, such as keeping the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-error controlled at <img src="https://latex.codecogs.com/png.latex?0.025"> while obtaining a power of <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta%20=%200.8">, approx. <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B314%7D%7B2%7D=157"> study subjects are needed per arm per stage given equal information rates. For a design with <img src="https://latex.codecogs.com/png.latex?3"> treatment arms, of which <img src="https://latex.codecogs.com/png.latex?2"> are active treatment arms and <img src="https://latex.codecogs.com/png.latex?1"> is a control arm, one may choose to simply extrapolate the (maximum) number of subjects by <img src="https://latex.codecogs.com/png.latex?3%5Ccdot%203%5Ccdot%20157%20=%201413">, i.e., multiplying the sample size per arm and stage by the <img src="https://latex.codecogs.com/png.latex?3"> arms and <img src="https://latex.codecogs.com/png.latex?3"> stages.</p>
<p>It should be noted here that this is just an approximation of the sample size needed to achieve a power of <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta=0.8">, while power here is defined as the probability of successfully detecting the assumed effect. Simulations in following chapters will indicate that this rather rough approximate sample size is actually rather large since the studies appear to be overpowered in simulations, while the term power has a different meaning here: when considering simulations of studies with multiple active treatment arms, power is referred to as the probability to claim success of at least one active treatment arm in the study.</p>
<p>The row <em>Exit probability for futility</em> indicates the rather low probability of early stopping due to futility (Stage 1: <img src="https://latex.codecogs.com/png.latex?0.0625">, Stage 2: <img src="https://latex.codecogs.com/png.latex?0.108">), while this depends on the assumed treatment effects and the defined boundaries. <em>Efficacy boundary (t)</em>, just as <em>Efficacy boundary (z-value scale)</em> shows that a drastic decrease in events needs to be detected in the treatment group in order to reject <img src="https://latex.codecogs.com/png.latex?H_0"> in the first stage (rate ratio of <img src="https://latex.codecogs.com/png.latex?0.061">, i.e.&nbsp;relative reduction of <img src="https://latex.codecogs.com/png.latex?1-0.061=0.939">) which, again reflects the “conservatism” of alpha-spending O’Brien Fleming approach in early stages, however resulting in rather liberal and monotonically decreasing boundaries along the stages.</p>
<div class="cell" data-layout-align="center">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># boundary plots</span></span>
<span id="cb8-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">par</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mar =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(d_sample, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb8-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Boundaries against stage-wise "</span>,</span>
<span id="cb8-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cumul. sample sizes - 1"</span></span>
<span id="cb8-6">), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(d_sample, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb8-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Boundaries against stage-wise "</span>,</span>
<span id="cb8-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cumul. sample sizes - 2"</span></span>
<span id="cb8-10">), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/plot_SSC-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:48.0%"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/plot_SSC-2.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:48.0%"></p>
</figure>
</div>
</div>
</div>
<p>Plotting the cumulative sample size against the applicable boundaries is a way of nicely visualizing these important study characteristics. The upper plot displays the stage-wise (<img src="https://latex.codecogs.com/png.latex?z">-scale) boundaries of the trial design. The red line marks the efficacy bounds which need to be crossed to obtain statistical significance at each stage, the blue line represents the futility bounds. The dashed constant line represents the critical value of a fixed study design with one-sided testing and <img src="https://latex.codecogs.com/png.latex?%5Calpha=0.025">, i.e., with a critical value of <img src="https://latex.codecogs.com/png.latex?%5CPhi%5E%7B-1%7D(1-%5Calpha)%20%5Capprox%201.96"> (<img src="https://latex.codecogs.com/png.latex?%5CPhi%5E%7B-1%7D"> denoting the quantile function of the standard normal cumulative distribution function). The lower plot contains the same information, however the y-axis is now rescaled to represent the treatment effect scale. The color-coding of efficacy (red) and futility (blue) bounds is the same as in the plot above. Note that the plot again indicates that low risk ratio values are desirable.</p>
</section>
<section id="study-simulations" class="level1">
<h1>Study simulations</h1>
<p>Performing simulations prior to conducting a study is often reasonable since they allow for evaluating characteristics, such as power (please refer to definition above), assuming different scenarios or constellations of treatment effects. Thus, simulations allow for a more holistic view on how the planned study could go in case the assumptions are (approximately) true.</p>
<p>Simulation of the study design will be done using the function <code>getSimulationMultiArmRates()</code>, which needs an Inverse Normal Design as input, defined with the same arguments as the design used above:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># design as above, just as inverse normal</span></span>
<span id="cb9-2">d_IN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.149145</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.41381</span>),</span>
<span id="cb9-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb9-11">)</span></code></pre></div></div>
</div>
<p>To perform study simulations for, e.g., the evaluation of power or probability-of-success, effect rates in the <img src="https://latex.codecogs.com/png.latex?2"> active treatment arms must be assumed and specified in a matrix. For binary data, the <code>effectMatrix</code> refers to the event rate assumed in each arm. In addition, we set the (maximum) number of iterations for the simulations in advance.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># set number of iterations to be used in simulation</span></span>
<span id="cb10-2">maxNumberOfIterations <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span></span>
<span id="cb10-3"></span>
<span id="cb10-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># specify the scenarios, nrow: number of scenarios, ncol: number of treatment arms</span></span>
<span id="cb10-5">effectMatrix <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.100</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.100</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.055</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.045</span>),</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb10-7">)</span>
<span id="cb10-8"></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first column: first treatment arm, second column: second treatment arm</span></span>
<span id="cb10-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">show</span>(effectMatrix)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>      [,1]  [,2]
[1,] 0.100 0.100
[2,] 0.050 0.050
[3,] 0.055 0.045</code></pre>
</div>
</div>
<p>Each row of the effect matrix specifies a scenario to be considered in the simulation. Considering a design with <img src="https://latex.codecogs.com/png.latex?2"> active treatment arms, both to be compared against a common control arm, the effect matrix contains the event rates of the first active arm in the first column and the event rates of the second active arm in the second column, respectively. The event rate of the control group is not a part of the effect matrix and is later provided directly to <code>getSimulationMultiArmRates()</code>.</p>
<p>Now that trial design and effect matrix have been derived, the simulations can be performed. In order to appropriately model the specific situation of a trial, a wide range of options is available for the simulation function <code>getSimulationMultiArmRates()</code>. Choosing <code>typeOfShape</code> as <code>"userDefined"</code> determines that the effect matrix specified above should be used for the simulations. For more specific applications, in which the different treatment arms correspond to different dose levels, <code>typeOfShape</code> may be used to specify a dose-response relationship (e.g., <code>typeOfShape = "linear"</code> for a linear dose-response relationship). Depending on the chosen type of shape, additional arguments may need to be specified. For details, refer to the function documentation (<code>?getSimlulationMultiArmRates</code>). <code>directionUpper</code> refers to the direction of the alternative and is set to <code>FALSE</code>, since, in our example, the alternative hypothesis is directed towards lower values, i.e., a reduction of event rates is considered beneficial to the subjects. The intersection test to be performed is <em>Simes</em> (<code>intersectionTest = "Simes"</code>), with other options being, e.g., <code>"Bonferroni"</code> or <code>"Dunnett"</code> (the default setting). <code>typeOfSelection</code> is initially set to <code>"rBest"</code> with <code>rValue = 2</code>, which means that at each stage, the <img src="https://latex.codecogs.com/png.latex?2"> best treatment arms should be carried forward. <code>successCriterion = "all"</code> means that, in order to stop the trial early due to efficacy, both active treatment arms need to perform significantly better than the control arm at an interim analysis. Another option would be to set <code>successCriterion = "atLeastOne"</code> to declare significant testing of one treatment arm to be sufficient for study success at interim. The vector <code>plannedSubjects</code> contains the stage-wise cumulative sample sizes of the (active) arms. Since, in our example, the control arm should be of the same size as the active arms, we set <code>allocationRatioPlanned = 1</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first simulation</span></span>
<span id="cb12-2">simulation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmRates</span>(</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb12-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMatrix =</span> effectMatrix,</span>
<span id="cb12-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb12-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb12-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>,</span>
<span id="cb12-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMeasure =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"testStatistic"</span>,</span>
<span id="cb12-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>,</span>
<span id="cb12-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">314</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">471</span>),</span>
<span id="cb12-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb12-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb12-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">145873</span>,</span>
<span id="cb12-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showStatistics =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb12-19">)</span>
<span id="cb12-20">simulation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<p><strong>Simulation of a binary endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for rates (2 treatments vs.&nbsp;control), H0: pi(i) - pi(control) = 0, power directed towards smaller values, H1: pi_max as specified, control rate pi(control) = 0.1, planned cumulative sample size = c(157, 314, 471), effect shape = user defined, intersection test = Simes, selection = r best, r = 2, effect measure based on test statistic, success criterion: all, simulation runs = 10000, seed = 145873.</p>
<p>User defined effect shape: Situation 1 Situation 2 Situation 3 Arm 1 0.1 0.05 0.055 Arm 2 0.1 0.05 0.045</p>
<table class="caption-top table">
<colgroup>
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [1]</td>
<td></td>
<td></td>
<td>0.0181</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [2]</td>
<td></td>
<td></td>
<td>0.8550</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [3]</td>
<td></td>
<td></td>
<td>0.8695</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Rejected arms per stage [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>0.0001</td>
<td>0.0031</td>
<td>0.0087</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>0</td>
<td>0.0024</td>
<td>0.0079</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Rejected arms per stage [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0.0086</td>
<td>0.3839</td>
<td>0.3954</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.0080</td>
<td>0.3796</td>
<td>0.3996</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Rejected arms per stage [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>0.0043</td>
<td>0.3090</td>
<td>0.3968</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>0.0145</td>
<td>0.4650</td>
<td>0.3686</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [1]</td>
<td>0</td>
<td>0.0007</td>
<td>0.0034</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [2]</td>
<td>0.0029</td>
<td>0.2735</td>
<td>0.4437</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [3]</td>
<td>0.0014</td>
<td>0.2645</td>
<td>0.4228</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [1]</td>
<td></td>
<td></td>
<td>776.2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [2]</td>
<td></td>
<td></td>
<td>1232.8</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [3]</td>
<td></td>
<td></td>
<td>1243.7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [1]</td>
<td>0.5797</td>
<td>0.1927</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [2]</td>
<td>0.0511</td>
<td>0.2803</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [3]</td>
<td>0.0443</td>
<td>0.2709</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.4203</td>
<td>0.2276</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.4203</td>
<td>0.2276</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.9489</td>
<td>0.6686</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.9489</td>
<td>0.6686</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.9557</td>
<td>0.6848</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.9557</td>
<td>0.6848</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [1]</td>
<td>2.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [2]</td>
<td>2.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [3]</td>
<td>2.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional power (achieved) [1]</td>
<td></td>
<td>0.0602</td>
<td>0.1379</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional power (achieved) [2]</td>
<td></td>
<td>0.4254</td>
<td>0.6771</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional power (achieved) [3]</td>
<td></td>
<td>0.4290</td>
<td>0.6911</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility [1]</td>
<td>0.5797</td>
<td>0.1920</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility [2]</td>
<td>0.0482</td>
<td>0.0068</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility [3]</td>
<td>0.0429</td>
<td>0.0064</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
<li><em>[j]</em>: effect matrix row j (situation to consider)</li>
</ul>
<p>In this output, the different input situations, which correspond to the rows of the effect matrix, are indicated through <img src="https://latex.codecogs.com/png.latex?%5B%5C,j%5C,%5D"> with <img src="https://latex.codecogs.com/png.latex?j=1,2,3">.</p>
<p>Under <img src="https://latex.codecogs.com/png.latex?H_0">, with assumed treatment effects equal to the assumed effect in the control group (scenario <em>[1]</em>), the probability of rejecting <img src="https://latex.codecogs.com/png.latex?H_0"> for at least one treatment arm, i.e., committing a type I error, is controlled at the pre-specified <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level (<em>Reject at least one [1]</em> <img src="https://latex.codecogs.com/png.latex?=%200.0181%5Cleq%200.025">). For scenarios <em>[2]</em> and <em>[3]</em>, which represent parameter constellations under the alternative, the rejection probabilities are high (<em>Reject at least one [2]</em> <img src="https://latex.codecogs.com/png.latex?=%200.8550"> and <em>Reject at least one [3]</em> <img src="https://latex.codecogs.com/png.latex?=%200.8695">). In addition, the stage-wise number of subjects are displayed and the probabilities for the arms to be selected at the individual stages are provided for each scenario in the effect matrix. Note that the selection probabilities are the same for the two arms, since <code>rValue = 2</code> means that, unless the trial is terminated at interim, the two best treatment arms (i.e., all arms in this case) are selected moving forward.</p>
<p>Furthermore, the expected sample size under the provided event rates (<em>Expected number of subjects under H1 [j]</em>), the stage-wise probabilities of a futility stop (<em>Exit probability for futility [j]</em>) as well as the stage-wise conditional power (<em>Conditional power (achieved) [j]</em>), defined as the probability of reaching a statistically significant result given the data observed so far, are listed for each scenario. Note that, due to the relatively high probability of a futility stop in scenario <em>[1]</em> (first stage: <img src="https://latex.codecogs.com/png.latex?0.5797">, second stage: <img src="https://latex.codecogs.com/png.latex?0.1920">), the corresponding expected number of subjects is approximately <img src="https://latex.codecogs.com/png.latex?776.2"> and thus considerably smaller than the expected sample sizes in the other scenarios.</p>
<section id="stage-wise-treatment-arm-selection" class="level2">
<h2 class="anchored" data-anchor-id="stage-wise-treatment-arm-selection">Stage-wise treatment arm selection</h2>
<p>Now, suppose that the underlying treatment arm selection scheme is different and not straightforwardly covered by the other available and pre-defined options in <a href="https://cran.r-project.org/package=rpact">rpact</a> (i.e.&nbsp;<code>"best"</code>, <code>"rBest"</code>, <code>"epsilon"</code>, <code>"all"</code>). In such cases, a user-defined treatment arm selection function can be specified to <code>getSimulationMultiArmRates()</code>. To use an individual selection function, the user must specify <code>typeOfSelection = "userDefined"</code> and provide a selection function in the <code>selectArmsFunction</code> argument. As an example, assume that, at each stage, we only wish to select those treatment arms, for which the observed effect does not fall below the futility bound. Continuing the above example, this means that if the relative rate reduction in a treatment arm does not exceed 5% at the first stage or does not exceed 10% at the second stage, the arm should be deselected at the respective stage.</p>
<p>After the first stage, there are thus six possible analysis results:</p>
<ol type="1">
<li>Both active Treatment Arms significant</li>
<li>1 active Treatment Arm significant, 1 active Treatment Arm non-significant</li>
<li>1 active Treatment Arm significant, 1 active Treatment Arm futile</li>
<li>Both active Treatment Arms non-significant</li>
<li>1 active Treatment Arm non-significant, 1 active Treatment Arm futile</li>
<li>Both active Treatment Arms futile</li>
</ol>
<p>Below, we illustrate the treatment arm selection scheme which results from using <code>typeOfSelection = "rBest"</code> with <code>rValue = 2</code> as above, where the numbers in the circles correspond to the six possible analysis results scenarios.</p>
<div class="cell">
<div class="cell-output-display">
<div class="grViz html-widget html-fill-item" id="htmlwidget-c9d2f677b3337ce244c9" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-c9d2f677b3337ce244c9">{"x":{"diagram":"#creation of graphs\ndigraph boxes_and_circles{\n  graph[overlap=true, fontsize=10]\n  node[shape=box,\n       fontname=Helvetica,\n       style=filled,\n       color = green]\n  \"Efficacy Stop\"\n  \n    node[shape=box,\n       fontname=Helvetica,\n       style=filled,\n       color = LightSteelBlue]\n  \"Stage 1\"; \"Continuation with both Arms\"; \"Continuation with non-significant Arm only\"\n  node[shape=circle,\n       fixedsize=TRUE,\n       style=filled,\n       width=0.8,\n       color = orange] //\n  1;2;3;4;5;6\n\n  \"Stage 1\" -> 1\n  \"Stage 1\" -> 2\n  \"Stage 1\" -> 3\n  \"Stage 1\" -> 4\n  \"Stage 1\" -> 5\n  \"Stage 1\" -> 6\n  1 -> \"Efficacy Stop\"\n  2 -> \"Continuation with non-significant Arm only\"\n  3 -> \"Continuation with non-significant Arm only\"\n  4 -> \"Continuation with both Arms\"\n  5 -> \"Continuation with both Arms\"\n  6 -> \"Continuation with both Arms\"\n}","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
<p>Selection scheme with rBest, rValue=2</p>
</div>
</div>
<div style="text-align: left">
<p>This first diagram graphically represent how treatment selection proceeds choosing <em>typeOfSelection=rBest</em> with <em>rValue=2</em> in case of the study design previously defined. Early study success can be obtained whenever both treatment arms can be tested significantly at interim and a continuation of the study with only the non-significant (meaning neither stopped for efficacy nor for futility) active treatment arm is to be done whenever the other active treatment arm is discontinued early due to efficacy. If neither of the arms can be tested significantly at interim, the study continues with both treatment arms as even arms crossing the futility bounds are to be carried forward using <em>rBest, rValue=2</em>.</p>
</div>
<div class="cell">
<div class="cell-output-display">
<div class="grViz html-widget html-fill-item" id="htmlwidget-d5808b70a3279fd92ca9" style="width:100%;height:464px;"></div>
<script type="application/json" data-for="htmlwidget-d5808b70a3279fd92ca9">{"x":{"diagram":"digraph boxes_and_circles{\n\n  graph[overlap=true, fontsize=10]\n  node[shape=box,\n       fontname=Helvetica,\n       style=filled,\n       color = green]\n  \"Efficacy Stop\"\n\n  node[shape=box,\n       fontname=Helvetica,\n       style=filled,\n       color = red]\n  \"Futility Stop\"\n  \n    node[shape=box,\n       fontname=Helvetica,\n       style=filled,\n       color = LightSteelBlue]\n  \"Continuation with non-futile Arms only\"; \"End due to Significance & Futility\"; \"Continuation with non-significant Arm only\"; \"Stage 1\"\n  \n  node[shape=circle,\n       fixedsize=TRUE,\n       style=filled,\n       width=0.8,\n       color = orange] //\n  1;2;3;4;5;6\n\n  \"Stage 1\" -> 1\n  \"Stage 1\" -> 2\n  \"Stage 1\" -> 3\n  \"Stage 1\" -> 4\n  \"Stage 1\" -> 5\n  \"Stage 1\" -> 6\n  1 -> \"Efficacy Stop\"\n  2 -> \"Continuation with non-significant Arm only\"\n  3 -> \"End due to Significance & Futility\"\n  4 -> \"Continuation with non-futile Arms only\"\n  5 -> \"Continuation with non-futile Arms only\"\n  6 -> \"Futility Stop\"\n}","config":{"engine":"dot","options":null}},"evals":[],"jsHooks":[]}</script>
<p>User-defined selection scheme</p>
</div>
</div>
<div style="text-align: left">
<p>The second diagram illustrates the active treatment arm selection that is to be implemented through the user-defined selection function. An efficacy stop occurs if both active treatment arms are tested significantly at interim. If only one of the active treatment arms is tested significantly at interim and the other arm is not significant (but also not futile), the trial is continued with the non-significant arm only. The study also terminates early with success of one arm if one active arm is futile while the other can be deemed superior to control. In case both arms are non-significant or one arm is non-significant while the other is futile, the trial is continued with the non-futile arms (or arm) only. Lastly, a futility stop can also happen at interim.</p>
</div>
<p>Since futility bounds were already defined in the design specification, one may be led to believe that the selection rule is only an add-on to the futility bound. However, this is not true since specifying a selection rule overwrites the futility bound as the continuation criterion for treatment arms. Thus, even if futility bounds are pre-specified, to implement stopping due to futility in the application of <code>getSimulationMultiArmRates()</code> (and <code>getSimulationMultiArmMeans()</code>, <code>getSimulationMultiArmSurvival()</code>), one could use these as input in the customized selection function. In this case, having the previously defined futility bounds of <img src="https://latex.codecogs.com/png.latex?0.149145"> at the first interim and <img src="https://latex.codecogs.com/png.latex?0.413808"> at the second respectively, there is a need to individualize the selection scheme for the different stages. It is important to note here that <code>effectMeasure = "testStatistic"</code> needs to be set as the futility bounds have intentionally been transformed to and calculated on the <img src="https://latex.codecogs.com/png.latex?z">-scale. Now, <a href="https://cran.r-project.org/package=rpact">rpact</a> enables implementation of this selection scheme by allowing <code>stage</code> as an argument in the selection function, in addition to <code>effectVector</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first row: first stage futility bounds, second row: second stage futility bound</span></span>
<span id="cb13-2">futility_bounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(d_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>futilityBounds, d_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>futilityBounds), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># selection function</span></span>
<span id="cb13-5">selection <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(effectVector, stage) {</span>
<span id="cb13-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># if stage==1, compare to first stage fut. bounds,</span></span>
<span id="cb13-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># if stage==2, compare to second stage fut. bounds</span></span>
<span id="cb13-8">    selectedArms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">switch</span>(stage,</span>
<span id="cb13-9">        (effectVector <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> futility_bounds[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, ]),</span>
<span id="cb13-10">        (effectVector <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> futility_bounds[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, ])</span>
<span id="cb13-11">    )</span>
<span id="cb13-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(selectedArms)</span>
<span id="cb13-13">}</span>
<span id="cb13-14"></span>
<span id="cb13-15">simulation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmRates</span>(</span>
<span id="cb13-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb13-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb13-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMatrix =</span> effectMatrix,</span>
<span id="cb13-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb13-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb13-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb13-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb13-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb13-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">selectArmsFunction =</span> selection,</span>
<span id="cb13-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMeasure =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"testStatistic"</span>,</span>
<span id="cb13-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">successCriterion =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>,</span>
<span id="cb13-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">314</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">471</span>),</span>
<span id="cb13-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb13-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> maxNumberOfIterations,</span>
<span id="cb13-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">145873</span>,</span>
<span id="cb13-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showStatistics =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb13-32">)</span>
<span id="cb13-33">simulation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<p><strong>Simulation of a binary endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm comparisons for rates (2 treatments vs.&nbsp;control), H0: pi(i) - pi(control) = 0, power directed towards smaller values, H1: pi_max as specified, control rate pi(control) = 0.1, planned cumulative sample size = c(157, 314, 471), effect shape = user defined, intersection test = Simes, selection = user defined, effect measure based on test statistic, success criterion: all, simulation runs = 10000, seed = 145873.</p>
<p>User defined effect shape: Situation 1 Situation 2 Situation 3 Arm 1 0.1 0.05 0.055 Arm 2 0.1 0.05 0.045</p>
<table class="caption-top table">
<colgroup>
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [1]</td>
<td></td>
<td></td>
<td>0.0181</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [2]</td>
<td></td>
<td></td>
<td>0.8304</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [3]</td>
<td></td>
<td></td>
<td>0.8419</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Rejected arms per stage [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>0.0002</td>
<td>0.0024</td>
<td>0.0072</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>0</td>
<td>0.0030</td>
<td>0.0079</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Rejected arms per stage [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>0.0067</td>
<td>0.3809</td>
<td>0.3298</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>0.0087</td>
<td>0.3828</td>
<td>0.3277</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Rejected arms per stage [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>0.0046</td>
<td>0.3012</td>
<td>0.3062</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>0.0140</td>
<td>0.4617</td>
<td>0.3255</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [1]</td>
<td>0</td>
<td>0.0020</td>
<td>0.0132</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [2]</td>
<td>0.0006</td>
<td>0.3041</td>
<td>0.4774</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [3]</td>
<td>0.0023</td>
<td>0.2982</td>
<td>0.4837</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>157.0</td>
<td>114.5</td>
<td>90.7</td>
<td>157.0</td>
<td>147.0</td>
<td>131.1</td>
<td>157.0</td>
<td>139.6</td>
<td>113.2</td>
<td>157.0</td>
<td>112.9</td>
<td>91.5</td>
<td>157.0</td>
<td>146.9</td>
<td>132.0</td>
<td>157.0</td>
<td>151.8</td>
<td>145.5</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
<td>157.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [1]</td>
<td></td>
<td></td>
<td>660.9</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [2]</td>
<td></td>
<td></td>
<td>1146.4</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [3]</td>
<td></td>
<td></td>
<td>1144.2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [1]</td>
<td>0.5968</td>
<td>0.3004</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [2]</td>
<td>0.0517</td>
<td>0.3584</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [3]</td>
<td>0.0547</td>
<td>0.3455</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.2940</td>
<td>0.0594</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.2900</td>
<td>0.0599</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.8876</td>
<td>0.4926</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.8874</td>
<td>0.4959</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.8405</td>
<td>0.4323</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.9142</td>
<td>0.5557</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [1]</td>
<td>2.000</td>
<td>1.448</td>
<td>1.161</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [2]</td>
<td>2.000</td>
<td>1.872</td>
<td>1.676</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [3]</td>
<td>2.000</td>
<td>1.856</td>
<td>1.647</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional power (achieved) [1]</td>
<td></td>
<td>0.0627</td>
<td>0.3925</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional power (achieved) [2]</td>
<td></td>
<td>0.4348</td>
<td>0.7372</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional power (achieved) [3]</td>
<td></td>
<td>0.4248</td>
<td>0.7506</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility [1]</td>
<td>0.5968</td>
<td>0.2984</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility [2]</td>
<td>0.0511</td>
<td>0.0543</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility [3]</td>
<td>0.0524</td>
<td>0.0473</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
<li><em>[j]</em>: effect matrix row j (situation to consider)</li>
</ul>
<p>Depending on the stage of the trial, the <code>switch()</code> statement in the treatment arm selection function (<code>selection()</code>) chooses the correct futility boundaries from a predefined futility bound matrix and compares the <code>effectVector</code> to them. The return value of the selection function is a logical vector with one entry per active treatment arm stating whether or not the respective arm is to be selected.</p>
<p>Again, assuming <img src="https://latex.codecogs.com/png.latex?H_0"> to be true (scenario <em>[1]</em>), the probability of falsely rejecting it is <img src="https://latex.codecogs.com/png.latex?0.0181">, thus this simulation again indicates type I error rate control at <img src="https://latex.codecogs.com/png.latex?%5Calpha=0.025">. The power assuming a <img src="https://latex.codecogs.com/png.latex?50%5C%25"> reduction in both active arms is <img src="https://latex.codecogs.com/png.latex?0.8304"> (<em>Reject at least one [2]</em>). Since now, stopping of treatment arms is determined by crossing the futility bounds or not, the probability of a futility stop in the first stage increases to <img src="https://latex.codecogs.com/png.latex?0.5968"> in the first and to <img src="https://latex.codecogs.com/png.latex?0.2984"> in the second stage under <img src="https://latex.codecogs.com/png.latex?H_0"> as compared to the first simulation. Having a different treatment selection scheme also result in lower expected number of subjects and, as opposed to the first simulation, the number of arms per scenario lies <img src="https://latex.codecogs.com/png.latex?%3C2"> starting from stage <img src="https://latex.codecogs.com/png.latex?2"> since this treatment selection allows for early discontinuation of study arms whereas in the first simulation, arms are to be carried forward regardless of potential futility.</p>
<p>In both simulations (using the rBest selection scheme and the user-defined selection function), with initially calculated <img src="https://latex.codecogs.com/png.latex?157"> subjects per arm per stage and a relative event rate reduction of <img src="https://latex.codecogs.com/png.latex?50%5C%25"> as alternative, one can see that the study is overpowered (since <em>Reject at least one [j]</em>&gt;0.8 in scenario <em>[2]</em>), which is due to the considered alternative having approximately the same effect in the two active treatment arms. For the second simulation using the selection function, additional simulations searching for the potentially optimal sample size (considered as the smallest sample size needed to achieve <img src="https://latex.codecogs.com/png.latex?80%5C%25"> power) indicate that one could save some subjects and still achieve the desired power. The following plot shows the minimum sample size that one could choose in order to achieve the power requirements of <img src="https://latex.codecogs.com/png.latex?80%5C%25">. The following plot displays simulated power values against sample sizes ranging from <img src="https://latex.codecogs.com/png.latex?140"> to <img src="https://latex.codecogs.com/png.latex?155"> per arm per stage, where the red horizontal line represents the target power of <img src="https://latex.codecogs.com/png.latex?0.8">. The simulations indicate that the optimal sample size is around <img src="https://latex.codecogs.com/png.latex?146"> subjects per arm and stage, however, this number may slightly deviate from an analytically optimal solution due to the nature of the simulation process:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/power_by_n-2-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Furthermore, it should be noted here that despite having explicitly assumed <img src="https://latex.codecogs.com/png.latex?%5Cpi_2=0.1"> under the null hypothesis, testing the hypothesis <img src="https://latex.codecogs.com/png.latex?H_0:%20%5Cfrac%7B%5Cpi_1%7D%7B%5Cpi_2%7D%5Cgeq1"> means that whenever <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%5Cgeq%5Cpi_2"> with <img src="https://latex.codecogs.com/png.latex?%5Cpi_2,%20%5C,%20%5Cpi_1%20%5Cin%20(0,1%5D">, one has a scenario where the null hypothesis is true. Consequently, one should properly check if the type I error rate is controlled not only assuming <img src="https://latex.codecogs.com/png.latex?%5Cpi_2=0.1">, but also considering the other scenarios when <img src="https://latex.codecogs.com/png.latex?%5Cpi_2%20%5Cneq%200.1">. For the second simulation, considering only the cases where rate equality holds, the following plot obtained by simulation indicates that, given the study configurations here, the type I error rate is controlled under various control event rate assumptions:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/alpha_under_Null_2-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="illustrative-analysis-with-generic-data" class="level1">
<h1>Illustrative analysis with generic Data</h1>
<p>In the next chapters, different hypothetical binary endpoint datasets are generated and analyzed using the <code>getAnalysisResults()</code> command. As previously mentioned, <a href="https://cran.r-project.org/package=rpact">rpact</a> itself does not support landmark analysis using the Greenwoods standard error (SE) formula. <!--stated below--> Thus, the first two analyses are based on the empirical event rates only. Afterwards, the packages <a href="https://cran.r-project.org/package=gestate">gestate</a> and <a href="https://cran.r-project.org/package=survival">survival</a> are then used to show how one could merge the packages to perform the intended analysis using boundaries obtained by <a href="https://cran.r-project.org/package=rpact">rpact</a> in combination with test statistics obtained by survival probabilities and standard errors estimated using <a href="https://cran.r-project.org/package=gestate">gestate</a> and <a href="https://cran.r-project.org/package=survival">survival</a>.</p>
<section id="first-theoretical-path" class="level2">
<h2 class="anchored" data-anchor-id="first-theoretical-path">First theoretical path</h2>
<p>In the first-stage analysis, one first has to manually enter a dataset for data observed in the trial:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">genData_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>,</span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">153</span>,</span>
<span id="cb14-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>,</span>
<span id="cb14-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span></span>
<span id="cb14-8">)</span>
<span id="cb14-9"></span>
<span id="cb14-10">genData_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<p><strong>Dataset of multi-arm rates</strong></p>
<p>The dataset contains the sample sizes and events of two treatment groups and one control group.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>1</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="even">
<td>Sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
</tr>
<tr class="odd">
<td>Number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
</tr>
</tbody>
</table>
<p>This dataset is a generic realization of data from the first stage in a design with binary endpoint under the input assumption of having a <img src="https://latex.codecogs.com/png.latex?50%5C%25"> rate reduction in the treatment groups given <img src="https://latex.codecogs.com/png.latex?%5Cpi_2=0.1">. The highest index (<img src="https://latex.codecogs.com/png.latex?3">) corresponds with the events and sample size of the control group. The indices <img src="https://latex.codecogs.com/png.latex?1"> and <img src="https://latex.codecogs.com/png.latex?2"> represent the active treatment groups. The data here is chosen such that one can see lower event rates in the active treatment groups. Note the slight imbalances in sample sizes, which may occur due to dropouts or recruitment issues.</p>
<p>The analysis of the first stage using <em>Simes</em> as intersection test is performed as follows:</p>
<div class="cell" data-note="false">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">results_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> genData_1,</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb15-6">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">results_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Simes intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>-0.076</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>-0.052</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.026</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.051</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.103</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>-2.730</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-1.716</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0032</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0431</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0063</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0032</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0431</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.493</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.730</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>1.716</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2907</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1204</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.212; 0.043]</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.191; 0.079]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1150</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.2429</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Although lower event rates in the active arms were observed in the first stage, neither of the <img src="https://latex.codecogs.com/png.latex?2"> hypotheses can be rejected at this point. This can be seen by e.g., comparing the overall adjusted test statistic for the global intersection test (which tests the null hypothesis that there is no effect in either active treatment arm) to the efficacy boundary. Since <img src="https://latex.codecogs.com/png.latex?2.493%20%3C%203.710">, we cannot reject after the first stage. Neither of the futility boundaries is crossed at stage <img src="https://latex.codecogs.com/png.latex?1">, which means that both treatment arms are to be carried forward to the second stage. For obtaining non-significance in stage <img src="https://latex.codecogs.com/png.latex?1">, one could also compare <!--adjusted stage-wise p-value to local $\alpha$ or--> repeated p-values to full <img src="https://latex.codecogs.com/png.latex?%5Calpha">.</p>
<p>Proceeding to the second stage, a generic dataset might look as follows, with the second vector entries represent the second-stage data:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># assuming there was no futility or efficacy stop study proceeds to randomize subjects</span></span>
<span id="cb17-2">genData_2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb17-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb17-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb17-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>),</span>
<span id="cb17-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">153</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>),</span>
<span id="cb17-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>),</span>
<span id="cb17-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>)</span>
<span id="cb17-9">)</span>
<span id="cb17-10">genData_2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of multi-arm rates</strong></p>
<p>The dataset contains the sample sizes and events of two treatment groups and one control group. The total number of looks is two; stage-wise and cumulative data are included.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>1</th>
<th>2</th>
<th>2</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="even">
<td>Stage-wise sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>155</td>
<td>155</td>
<td>155</td>
</tr>
<tr class="odd">
<td>Cumulative sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>308</td>
<td>312</td>
<td>311</td>
</tr>
<tr class="even">
<td>Stage-wise number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>7</td>
<td>7</td>
<td>15</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>11</td>
<td>15</td>
<td>31</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Here, again, the observed event rates are lower in the treatment groups in comparison to the control group.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">results_2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> genData_2,</span>
<span id="cb18-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb18-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb18-6">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">results_2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Simes intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>-0.076</td>
<td>-0.064</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>-0.052</td>
<td>-0.052</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.026</td>
<td>0.036</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.051</td>
<td>0.048</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.103</td>
<td>0.100</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>-2.730</td>
<td>-1.770</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-1.716</td>
<td>-1.770</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0063</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.493</td>
<td>3.014</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.730</td>
<td>3.182</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>1.716</td>
<td>2.464</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2907</td>
<td>0.7911</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1204</td>
<td>0.5133</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.212; 0.043]</td>
<td>[-0.130; -0.005]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.191; 0.079]</td>
<td>[-0.119; 0.011]</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1150</td>
<td>0.0086</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.2429</td>
<td>0.0274</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Performing the same comparisons as in stage <img src="https://latex.codecogs.com/png.latex?1">, one can see: The global null is to be rejected (<img src="https://latex.codecogs.com/png.latex?3.014%20%3E%202.511">). Subsequently, the hypothesis for the first active treatment is rejected, since <img src="https://latex.codecogs.com/png.latex?3.182%20%3E%202.511"> indicates that the first active arm performs better than control. The same result can be obtained by recognizing that the <em>repeated p-value (1)</em> of <img src="https://latex.codecogs.com/png.latex?0.0086"> falls below <img src="https://latex.codecogs.com/png.latex?0.025">. The consequence is that this arm can be discontinued early due to efficacy. However, since no significant result was observed for the second treatment arm (<img src="https://latex.codecogs.com/png.latex?2.464%20%3C%202.511">) and an early end of the trial due to efficacy is only allowed in case all active treatment arms are significant, the study will continue to the third and final stage with the second treatment arm only. Again, no futility stop occurs. It should be noted here that the <em>adjusted stage-wise p-values</em> cannot directly be used for testing, but the values are based on the second-stage data only. Since an inverse normal combination test is performed with equal weights for the stages (i.e., weights of <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B%5Cfrac%7B1%7D%7B3%7D%7D"> here), the first- and second-stage p-values can be used to calculate the overall adjusted test statistics, namely <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Csqrt%7B%5Cfrac%7B1%7D%7B3%7D%7D%20%5Ccdot%20%5CPhi%5E%7B-1%7D(1-0.0063)+%5Csqrt%7B%5Cfrac%7B1%7D%7B3%7D%7D%20%5Ccdot%20%5CPhi%5E%7B-1%7D(1-0.0384)%7D%7B%5Csqrt%7B%5Cfrac%7B2%7D%7B3%7D%7D%7D%20%5Capprox%203.014">.</p>
<p>The data collected at the final stage may look like the following, where the <code>NA</code> entries in the first active arm indicate that no additional patients were recruited here:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">genData_3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb20-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb20-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb20-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>),</span>
<span id="cb20-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">153</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb20-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span>),</span>
<span id="cb20-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>)</span>
<span id="cb20-8">)</span>
<span id="cb20-9">genData_3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of multi-arm rates</strong></p>
<p>The dataset contains the sample sizes and events of two treatment groups and one control group. The total number of looks is three; stage-wise and cumulative data are included.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>1</th>
<th>2</th>
<th>2</th>
<th>2</th>
<th>3</th>
<th>3</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="even">
<td>Stage-wise sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>155</td>
<td>155</td>
<td>155</td>
<td>NA</td>
<td>156</td>
<td>160</td>
</tr>
<tr class="odd">
<td>Cumulative sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>308</td>
<td>312</td>
<td>311</td>
<td>NA</td>
<td>468</td>
<td>471</td>
</tr>
<tr class="even">
<td>Stage-wise number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>7</td>
<td>7</td>
<td>15</td>
<td>NA</td>
<td>6</td>
<td>16</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>11</td>
<td>15</td>
<td>31</td>
<td>NA</td>
<td>21</td>
<td>47</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The results from the final analysis are:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">results_3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb21-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb21-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> genData_3,</span>
<span id="cb21-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb21-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb21-6">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">results_3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Simes intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>-0.076</td>
<td>-0.064</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>-0.052</td>
<td>-0.052</td>
<td>-0.055</td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.026</td>
<td>0.036</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.051</td>
<td>0.048</td>
<td>0.045</td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.103</td>
<td>0.100</td>
<td>0.100</td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>-2.730</td>
<td>-1.770</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-1.716</td>
<td>-1.770</td>
<td>-2.149</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.0384</td>
<td>0.0158</td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0063</td>
<td>0.0384</td>
<td>0.0158</td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.0384</td>
<td>0.0158</td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.493</td>
<td>3.014</td>
<td>3.702</td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.730</td>
<td>3.182</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>1.716</td>
<td>2.464</td>
<td>3.253</td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td>TRUE</td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td>TRUE</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2907</td>
<td>0.7911</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1204</td>
<td>0.5133</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.212; 0.043]</td>
<td>[-0.130; -0.005]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.191; 0.079]</td>
<td>[-0.119; 0.011]</td>
<td>[-0.099; -0.013]</td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1150</td>
<td>0.0086</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.2429</td>
<td>0.0274</td>
<td>0.0006</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>After the third stage, we can see that the null hypothesis of the second active treatment arm can now also be rejected. This can be seen by considering the overall adjusted test statistics for the intersection and single hypothesis tests, the repeated p-values or by directly referring to <em>Test action: reject (2)</em>. Since now, both the first and second active treatment arm have been observed to be superior to control, the study concludes with success.</p>
<p>The results can be visualized by plotting the repeated confidence intervals, which become narrower with each stage due to the increasing cumulative sample sizes and consistent effect trend observed across stages:</p>
<div class="cell" data-layout-align="center">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">results_3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/res_plot_3-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="second-theoretical-path" class="level2">
<h2 class="anchored" data-anchor-id="second-theoretical-path">Second theoretical path</h2>
<p>For the second analysis example, assume that we observe the same first-stage dataset (and thus, the same analysis results) as above, but the second-stage dataset is now:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">genData_4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb24-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>),</span>
<span id="cb24-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>),</span>
<span id="cb24-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>),</span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">153</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>),</span>
<span id="cb24-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>),</span>
<span id="cb24-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>)</span>
<span id="cb24-8">)</span></code></pre></div></div>
</div>
<p>Note the large number of events in the second active treatment arm in the second stage.</p>
<p>Using this dataset for analysis yields the following results:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">results_4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb25-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb25-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> genData_4,</span>
<span id="cb25-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb25-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb25-6">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">results_4 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Simes intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>-0.076</td>
<td>-0.057</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>-0.052</td>
<td>0.000</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.026</td>
<td>0.042</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.051</td>
<td>0.099</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.103</td>
<td>0.100</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>-2.730</td>
<td>-1.275</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-1.716</td>
<td>1.385</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.1011</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.9170</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0063</td>
<td>0.2023</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.1011</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.9170</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.493</td>
<td>2.352</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.730</td>
<td>2.832</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>1.716</td>
<td>0.234</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2907</td>
<td>0.4500</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1204</td>
<td>0.0009</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.212; 0.043]</td>
<td>[-0.125; 0.003]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.191; 0.079]</td>
<td>[-0.080; 0.075]</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1150</td>
<td>0.0340</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.2429</td>
<td>0.2429</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>As we can see, the global null hypothesis cannot be rejected at the second stage, since <img src="https://latex.codecogs.com/png.latex?2.352%20%3C%202.511">. However, the second active treatment arm is stopped for futility, since, after not rejecting the global null, its corresponding overall adjusted test statistic of <img src="https://latex.codecogs.com/png.latex?0.234"> is smaller than the second-stage futility bound of <img src="https://latex.codecogs.com/png.latex?0.414."> Therefore, this study course leads to a continuation to the third stage with active treatment arm <img src="https://latex.codecogs.com/png.latex?1"> only.</p>
<p>As the final-stage dataset, we may then observe:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">genData_5 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb27-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb27-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb27-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>),</span>
<span id="cb27-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">153</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">165</span>),</span>
<span id="cb27-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb27-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">156</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">155</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>)</span>
<span id="cb27-8">)</span>
<span id="cb27-9">genData_5 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of multi-arm rates</strong></p>
<p>The dataset contains the sample sizes and events of two treatment groups and one control group. The total number of looks is three; stage-wise and cumulative data are included.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>1</th>
<th>2</th>
<th>2</th>
<th>2</th>
<th>3</th>
<th>3</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="even">
<td>Stage-wise sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>155</td>
<td>155</td>
<td>155</td>
<td>165</td>
<td>NA</td>
<td>160</td>
</tr>
<tr class="odd">
<td>Cumulative sample size</td>
<td>153</td>
<td>157</td>
<td>156</td>
<td>308</td>
<td>312</td>
<td>311</td>
<td>473</td>
<td>NA</td>
<td>471</td>
</tr>
<tr class="even">
<td>Stage-wise number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>9</td>
<td>23</td>
<td>15</td>
<td>7</td>
<td>NA</td>
<td>16</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>4</td>
<td>8</td>
<td>16</td>
<td>13</td>
<td>31</td>
<td>31</td>
<td>20</td>
<td>NA</td>
<td>47</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Note that recruitment for treatment arm <img src="https://latex.codecogs.com/png.latex?2"> has been terminated after stage <img src="https://latex.codecogs.com/png.latex?2"> and <code>NA</code> is entered for the respective vectors.</p>
<p>The final stage analysis leads to the results:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">results_5 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb28-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb28-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> genData_5,</span>
<span id="cb28-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb28-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span></span>
<span id="cb28-6">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">results_5 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm test for rates, Simes intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &lt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>-0.076</td>
<td>-0.057</td>
<td>-0.058</td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>-0.052</td>
<td>0.000</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (1)</td>
<td>0.026</td>
<td>0.042</td>
<td>0.042</td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (2)</td>
<td>0.051</td>
<td>0.099</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.103</td>
<td>0.100</td>
<td>0.100</td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>-2.730</td>
<td>-1.275</td>
<td>-2.024</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-1.716</td>
<td>1.385</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.1011</td>
<td>0.0215</td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.9170</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0063</td>
<td>0.2023</td>
<td>0.0215</td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0032</td>
<td>0.1011</td>
<td>0.0215</td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0431</td>
<td>0.9170</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.493</td>
<td>2.352</td>
<td>3.089</td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.730</td>
<td>2.832</td>
<td>3.481</td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>1.716</td>
<td>0.234</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>FALSE</td>
<td>TRUE</td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2907</td>
<td>0.4500</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.1204</td>
<td>0.0009</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.212; 0.043]</td>
<td>[-0.125; 0.003]</td>
<td>[-0.102; -0.017]</td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.191; 0.079]</td>
<td>[-0.080; 0.075]</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1150</td>
<td>0.0340</td>
<td>0.0010</td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.2429</td>
<td>0.2429</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Since per definition, success of one treatment arm suffices (because there is only one treatment arm left) to declare study success, that is the conclusion one comes to due to significance of treatment arm <img src="https://latex.codecogs.com/png.latex?1">. Stopping treatment arm <img src="https://latex.codecogs.com/png.latex?2"> earlier therefore did not influence the positive result.</p>
</section>
</section>
<section id="landmark-analysis-with-greenwoods-formula" class="level1">
<h1>Landmark analysis with Greenwood’s formula</h1>
<p>A landmark analysis is an analysis where, given a predefined and fixed point in time, survival probabilities at that specific time point are to be compared between different groups, such as active treatment and control group.</p>
<p>As previously mentioned, <a href="https://cran.r-project.org/package=rpact">rpact</a> itself does not support the procedure of comparing survival probabilities (more precisely, their estimates) at a specific point in time with the standard error being calculated by Greenwoods formula, but is based on simple rate comparisons only. However, the R package <a href="https://cran.r-project.org/package=gestate">gestate</a> supports various survival analysis methods, including landmark analysis. Firstly, one needs to load the package:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gestate)</span></code></pre></div></div>
</div>
<p>Then, since the functionality of <a href="https://cran.r-project.org/package=gestate">gestate</a> is based on curve subjects and the analysis approach is based on survival data, the distribution of the data of the treatment and control groups need to be specified. Assume that the data in the control group follows an exponential distribution Exp(<img src="https://latex.codecogs.com/png.latex?%5Clambda_c">) with <img src="https://latex.codecogs.com/png.latex?%5Clambda_c=0.1"> and the treatment groups follow Exp(<img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bt1%7D">)- and Exp(<img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bt2%7D">)-distributions with <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bt1%7D=%5Clambda_%7Bt2%7D=0.1%5Ccdot0.5=0.05"> respectively (hazard ratio of <img src="https://latex.codecogs.com/png.latex?0.5">, heuristically representing the assumed treatment effect of a <img src="https://latex.codecogs.com/png.latex?50%5C%25"> rate-reduction), while other options would be to assume Weibull or piecewise Exponential distribution. This is initialized using:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">effect <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb31-2"></span>
<span id="cb31-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># initializing assumed distributions of different treatment arms as well as control</span></span>
<span id="cb31-4">dist_c <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Exponential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb31-5">dist_t1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Exponential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effect))</span>
<span id="cb31-6">dist_t2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Exponential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> effect))</span></code></pre></div></div>
</div>
<p>Then, another curve that needs to be initialized is the recruitment curve. <a href="https://cran.r-project.org/package=gestate">gestate</a> covers the potential assumptions of, e.g., having instantaneous, linear or piecewise linear recruitment. In many applications, assuming linear recruitment (i.e., a constant recruitment rate) is generally suitable and will be used for illustration here. We will assume the same sample sizes as calculated in chapter <img src="https://latex.codecogs.com/png.latex?2"> and, since measuring study duration in months is common, one may assume a total recruitment length of <img src="https://latex.codecogs.com/png.latex?18"> months = <img src="https://latex.codecogs.com/png.latex?1.5"> years. The data will later on be used to estimate survival probabilities and standard errors, subsequently to be used as input for the <a href="https://cran.r-project.org/package=rpact">rpact</a> continuous endpoint module. Since the mean, standard deviation and sample sizes in the dataset input all need to be stage-wise because of the use of inverse normal combination test, data simulation will also be done separately per stage per arm, resulting in a maximum of 9 simulated datasets in this application. Furthermore, since the information levels are equally spread along the three stages, each stage-wise dataset will be based on a recruitment of <img src="https://latex.codecogs.com/png.latex?157"> subjects and a recruitment duration of <img src="https://latex.codecogs.com/png.latex?6"> months. Assuming an individual observation time of <img src="https://latex.codecogs.com/png.latex?1"> month, the total duration of each stage is <img src="https://latex.codecogs.com/png.latex?7"> months:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equally sized arms and stages</span></span>
<span id="cb32-2">n <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">157</span></span>
<span id="cb32-3"></span>
<span id="cb32-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># maximum duration of each stage</span></span>
<span id="cb32-5">maxtime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span></span>
<span id="cb32-6"></span>
<span id="cb32-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># initialize recruitment for control group</span></span>
<span id="cb32-8">recruitment_c <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">LinearR</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Nactive =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Ncontrol =</span> n, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rlength =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb32-9"></span>
<span id="cb32-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># initialize recruitment for treatment groups, here: equal</span></span>
<span id="cb32-11">recruitment_t1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">LinearR</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Nactive =</span> n, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Ncontrol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rlength =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb32-12">recruitment_t2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">LinearR</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Nactive =</span> n, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Ncontrol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rlength =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
</div>
<p>As already mentioned in chapter <img src="https://latex.codecogs.com/png.latex?1"> (initialization of design), the interim analyses are to be performed at <img src="https://latex.codecogs.com/png.latex?I_1%20=%20%5Cfrac%7B1%7D%7B3%7D"> and <img src="https://latex.codecogs.com/png.latex?I_2%20=%20%5Cfrac%7B2%7D%7B3%7D"> with <img src="https://latex.codecogs.com/png.latex?I"> denoting the information fraction and the index denoting the stage. Since information is directly correlated with sample size here, one can conclude that interim analyses should be performed after <img src="https://latex.codecogs.com/png.latex?6"> months and after <img src="https://latex.codecogs.com/png.latex?12"> months of recruitment. Censoring could be specified via the variables <code>active_dcurve</code>, <code>control_dcurve</code>, however, in trials in which no or only little censoring might be a reasonable assumption, the default values for these variables can be used (<em>=Blank()</em>). The only remaining type of censoring is censoring due to end of observation, i.e., subjects having had no event before study ends are considered censored.</p>
<p>Having made assumptions on data distribution, recruitment and censoring, simulating patient level survival data works as follows. It should be noted here that the following simulations and data manipulations are demonstrated for the first stage data, however, the process is similar for the second and third stage.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># simulating data for all arms and stages independently (needed for dataset input)</span></span>
<span id="cb33-2"></span>
<span id="cb33-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first stage, all arms, last index represents the stage</span></span>
<span id="cb33-4">example_data_long_t1_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">simulate_trials</span>(</span>
<span id="cb33-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_ecurve =</span> dist_t1,</span>
<span id="cb33-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">control_ecurve =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Blank</span>(),</span>
<span id="cb33-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rcurve =</span> recruitment_t1,</span>
<span id="cb33-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assess =</span> maxtime,</span>
<span id="cb33-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">iterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb33-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb33-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">detailed_output =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb33-12">)</span>
<span id="cb33-13"></span>
<span id="cb33-14">example_data_long_t2_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">simulate_trials</span>(</span>
<span id="cb33-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_ecurve =</span> dist_t2,</span>
<span id="cb33-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">control_ecurve =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Blank</span>(),</span>
<span id="cb33-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rcurve =</span> recruitment_t2,</span>
<span id="cb33-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assess =</span> maxtime,</span>
<span id="cb33-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">iterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb33-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb33-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">detailed_output =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb33-22">)</span>
<span id="cb33-23"></span>
<span id="cb33-24">example_data_long_c_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">simulate_trials</span>(</span>
<span id="cb33-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_ecurve =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Blank</span>(),</span>
<span id="cb33-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">control_ecurve =</span> dist_c,</span>
<span id="cb33-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rcurve =</span> recruitment_c,</span>
<span id="cb33-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assess =</span> maxtime,</span>
<span id="cb33-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">iterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb33-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb33-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">detailed_output =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb33-32">)</span>
<span id="cb33-33"></span>
<span id="cb33-34"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(example_data_long_t1_1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span></code></pre></div></div>
<table class="caption-top table">
<colgroup>
<col style="width: 12%">
<col style="width: 12%">
<col style="width: 5%">
<col style="width: 6%">
<col style="width: 13%">
<col style="width: 8%">
<col style="width: 13%">
<col style="width: 9%">
<col style="width: 8%">
<col style="width: 12%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: right;">Time</th>
<th style="text-align: right;">Censored</th>
<th style="text-align: right;">Trt</th>
<th style="text-align: right;">Iter</th>
<th style="text-align: right;">ETime</th>
<th style="text-align: right;">CTime</th>
<th style="text-align: right;">Rec_Time</th>
<th style="text-align: right;">Assess</th>
<th style="text-align: right;">Max_F</th>
<th style="text-align: right;">RCTime</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">4.136118</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">15.103637</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">2.8638823</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">4.136118</td>
</tr>
<tr class="even">
<td style="text-align: right;">2.375578</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">23.632856</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">4.6244223</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">2.375578</td>
</tr>
<tr class="odd">
<td style="text-align: right;">2.914134</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2.914134</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">0.1667227</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">6.833277</td>
</tr>
<tr class="even">
<td style="text-align: right;">2.795905</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2.795905</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">3.1638647</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">3.836135</td>
</tr>
<tr class="odd">
<td style="text-align: right;">1.718086</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">8.721372</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">5.2819144</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">1.718086</td>
</tr>
<tr class="even">
<td style="text-align: right;">4.761620</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">57.899371</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">2.2383802</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">4.761620</td>
</tr>
<tr class="odd">
<td style="text-align: right;">6.712245</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">24.591241</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">0.2877548</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">6.712245</td>
</tr>
<tr class="even">
<td style="text-align: right;">6.168230</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">10.793657</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">0.8317695</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">6.168230</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5.071047</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">19.131350</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">1.9289527</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">5.071047</td>
</tr>
<tr class="even">
<td style="text-align: right;">2.940920</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">2.940920</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">0.9289897</td>
<td style="text-align: right;">7</td>
<td style="text-align: right;">Inf</td>
<td style="text-align: right;">6.071010</td>
</tr>
</tbody>
</table>
<p>The table above provides information on patient level, such as time (to event), treatment group, time of event (if observed), assessment timing and recruitment time. To achieve that every subject only has an individual observation time of <img src="https://latex.codecogs.com/png.latex?1"> month, one can manually set the censoring indicator to <img src="https://latex.codecogs.com/png.latex?1"> whenever no event has happened or the simulation indicates that an event has happened only after the fixed observation time.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check: if time to event (first column) is &gt;=1, subject is censored</span></span>
<span id="cb34-2">example_data_long_t1_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t1_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb34-3">example_data_long_t2_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t2_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb34-4">example_data_long_c_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_c_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div></div>
</div>
<p>After doing this, since the administrative censoring due to end of observation has been manually manipulated, the time of censoring in the last column can manually be corrected according to the changes:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># if censoring indicator==1, the censoring time is set to event time</span></span>
<span id="cb35-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># according to the previous changes</span></span>
<span id="cb35-3"></span>
<span id="cb35-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage 1</span></span>
<span id="cb35-5">example_data_long_t1_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t1_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span></span>
<span id="cb35-6">    example_data_long_t1_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t1_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb35-7"></span>
<span id="cb35-8">example_data_long_t2_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t2_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span></span>
<span id="cb35-9">    example_data_long_t2_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_t2_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb35-10"></span>
<span id="cb35-11">example_data_long_c_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_c_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span></span>
<span id="cb35-12">    example_data_long_c_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(example_data_long_c_1[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span></code></pre></div></div>
</div>
<p>Though working on subject level data (if available) is commonly recommended, one could be interested in tables containing time, number of subjects at risk, survival probabilities and respective standard errors, henceforth referred to as life tables. After setting the assessment time to the defined <img src="https://latex.codecogs.com/png.latex?7"> months, for creating the life tables, the commands <code>Surv()</code> and <code>survfit()</code> from the R package <a href="https://cran.r-project.org/package=survival">survival</a> are used:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># needs to be run in case package has not yet been installed</span></span>
<span id="cb36-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(survival)</span>
<span id="cb36-3"></span>
<span id="cb36-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># setting desired assessment time</span></span>
<span id="cb36-5">example_data_short_t1_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set_assess_time</span>(</span>
<span id="cb36-6">  example_data_long_t1_1, </span>
<span id="cb36-7">  maxtime</span>
<span id="cb36-8">  )</span>
<span id="cb36-9">example_data_short_t2_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set_assess_time</span>(</span>
<span id="cb36-10">  example_data_long_t2_1, </span>
<span id="cb36-11">  maxtime</span>
<span id="cb36-12">  )</span>
<span id="cb36-13">example_data_short_c_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> gestate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set_assess_time</span>(</span>
<span id="cb36-14">  example_data_long_c_1, </span>
<span id="cb36-15">  maxtime</span>
<span id="cb36-16">  )</span>
<span id="cb36-17"></span>
<span id="cb36-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Creating live tables for each group depending on the stage</span></span>
<span id="cb36-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at first landmark time point</span></span>
<span id="cb36-20">lt_t1_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">survfit</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Surv</span>(</span>
<span id="cb36-21">    example_data_short_t1_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time"</span>],</span>
<span id="cb36-22">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> example_data_short_t1_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Censored"</span>]</span>
<span id="cb36-23">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"greenwood"</span>))</span>
<span id="cb36-24">lt_t2_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">survfit</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Surv</span>(</span>
<span id="cb36-25">    example_data_short_t2_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time"</span>],</span>
<span id="cb36-26">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> example_data_short_t2_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Censored"</span>]</span>
<span id="cb36-27">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"greenwood"</span>))</span>
<span id="cb36-28">lt_c_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">survfit</span>(survival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Surv</span>(</span>
<span id="cb36-29">    example_data_short_c_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time"</span>],</span>
<span id="cb36-30">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> example_data_short_c_1[, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Censored"</span>]</span>
<span id="cb36-31">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"greenwood"</span>))</span>
<span id="cb36-32"></span>
<span id="cb36-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cbind</span>(</span>
<span id="cb36-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n.risk"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n.risk,</span>
<span id="cb36-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n.event"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n.event, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"surv.prob."</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv,</span>
<span id="cb36-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Greenwoods SE"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err</span>
<span id="cb36-37">), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span></code></pre></div></div>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: right;">Time</th>
<th style="text-align: right;">n.risk</th>
<th style="text-align: right;">n.event</th>
<th style="text-align: right;">surv.prob.</th>
<th style="text-align: right;">Greenwoods SE</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">0.4050083</td>
<td style="text-align: right;">157</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9936306</td>
<td style="text-align: right;">0.0063491</td>
</tr>
<tr class="even">
<td style="text-align: right;">0.7430455</td>
<td style="text-align: right;">156</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9872611</td>
<td style="text-align: right;">0.0089502</td>
</tr>
<tr class="odd">
<td style="text-align: right;">0.7453705</td>
<td style="text-align: right;">155</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9808917</td>
<td style="text-align: right;">0.0109263</td>
</tr>
<tr class="even">
<td style="text-align: right;">1.0411090</td>
<td style="text-align: right;">152</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9744385</td>
<td style="text-align: right;">0.0126170</td>
</tr>
<tr class="odd">
<td style="text-align: right;">1.1852241</td>
<td style="text-align: right;">143</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9676242</td>
<td style="text-align: right;">0.0142506</td>
</tr>
<tr class="even">
<td style="text-align: right;">1.1887832</td>
<td style="text-align: right;">142</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9608100</td>
<td style="text-align: right;">0.0156951</td>
</tr>
<tr class="odd">
<td style="text-align: right;">1.3882469</td>
<td style="text-align: right;">136</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9537452</td>
<td style="text-align: right;">0.0170959</td>
</tr>
<tr class="even">
<td style="text-align: right;">1.7934816</td>
<td style="text-align: right;">127</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9462354</td>
<td style="text-align: right;">0.0185375</td>
</tr>
<tr class="odd">
<td style="text-align: right;">1.8221775</td>
<td style="text-align: right;">125</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9386655</td>
<td style="text-align: right;">0.0198748</td>
</tr>
<tr class="even">
<td style="text-align: right;">1.9769123</td>
<td style="text-align: right;">119</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.9307776</td>
<td style="text-align: right;">0.0212154</td>
</tr>
</tbody>
</table>
<p>The above table contains time, number of subjects at risk, number of events, survival probability estimation and standard error estimation, thus allowing for the creation of a Kaplan-Meier-Plot to visualize the development of survival probability in time. Note that choosing <code>error = "greenwood"</code> leads to the desired SE estimation. One could also discretize the time into intervals to obtain life tables with consistent time steps, if desired. Exemplary Kaplan-Meier-Plots for the different treatment groups at the different stages are displayed below:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/index_files/figure-html/KM_plot-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>While the survival probabilities of the treatment arms develop rather similarly for the independently simulated stages, the figures demonstrate that the survival probabilities of the control group almost always fall below the survival probabilities of the treatment groups (apart from a few early exceptions), indicating that the groups may (i.e.&nbsp;potentially statistically significantly) differ.</p>
<p>As previously mentioned, the continuous module of <a href="https://cran.r-project.org/package=rpact">rpact</a> is now used to perform the landmark analysis of the <a href="https://cran.r-project.org/package=gestate">gestate</a>-simulated data. Note that this approximation is valid whenever it is reasonable to assume that the survival probabilities are normally distributed. If this assumption holds, we can initialize continuous stage-wise datasets using the life tables above as follows: for the means, we use the estimated survival probabilities, for the standard deviations, we transform the Greenwood standard error estimates by multiplying them with the square root of the sample size and for the sample sizes, we use the same values as were specified for the <a href="https://cran.r-project.org/package=gestate">gestate</a> recruitment curves (i.e., <img src="https://latex.codecogs.com/png.latex?157"> patients per arm per stage). For simplification, no dropouts are assumed. The first stage (continuous) dataset is therefore:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Landmark at which the analysis is to be performed</span></span>
<span id="cb37-2">lm <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span></span>
<span id="cb37-3"></span>
<span id="cb37-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first stage dataset</span></span>
<span id="cb37-5">dataset_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb37-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># accessing the survival probability values at the timepoint closest to the desired one</span></span>
<span id="cb37-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]),</span>
<span id="cb37-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]),</span>
<span id="cb37-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]),</span>
<span id="cb37-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb37-11">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)),</span>
<span id="cb37-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb37-13">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)),</span>
<span id="cb37-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb37-15">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)),</span>
<span id="cb37-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n),</span>
<span id="cb37-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n),</span>
<span id="cb37-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n)</span>
<span id="cb37-19">)</span>
<span id="cb37-20">dataset_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of multi-arm means</strong></p>
<p>The dataset contains the sample sizes, means, and standard deviations of two treatment groups and one control group.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>1</th>
<th>1</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Group</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr class="even">
<td>Sample size</td>
<td>157</td>
<td>157</td>
<td>157</td>
</tr>
<tr class="odd">
<td>Mean</td>
<td>0.734</td>
<td>0.761</td>
<td>0.543</td>
</tr>
<tr class="even">
<td>Standard deviation</td>
<td>0.657</td>
<td>0.661</td>
<td>0.811</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The explicit estimates can be seen using the <code>summary()</code>-command. The highest index (<img src="https://latex.codecogs.com/png.latex?=3">) represents the control group.</p>
<p>Note that the time variable in the life table data has not been structured into intervals of equal length and therefore, it is possible that the stage-wise life tables do not have entries at the exact timing of the intended landmark analyses. For this reason, the survival probabilities and standard errors are extracted from the entries for which the time variable is closest to the intended landmark time point.</p>
<p>Analysis of the data according to the inverse normal design derived earlier in this vignette can then be done by:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1">result_1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb38-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataset_1, </span>
<span id="cb38-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb38-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb38-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb38-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">varianceOption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairwisePooled"</span></span>
<span id="cb38-7">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">result_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a continuous endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm t-test, Simes intersection test, normal approximation test, pairwise pooled variances option. H0: mu(i) - mu(control) = 0 against H1: mu(i) - mu(control) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>0.191</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>0.217</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation</td>
<td>0.714</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>2.287</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>2.601</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0111</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0046</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0093</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0111</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0046</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.354</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.287</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>2.601</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2359</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.2530</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.133; 0.514]</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.107; 0.542]</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1425</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.1331</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Since the overall adjusted test statistic for the intersection hypotheses (<img src="https://latex.codecogs.com/png.latex?=2.354">) does not exceed the first stage critical value of <img src="https://latex.codecogs.com/png.latex?3.710">, the intersection hypothesis of having no effect in either one of the treatment groups cannot be rejected, and, e.g., the repeated p-values lead to the same conclusion. Furthermore, since all of the applicable test statistics do not fall below the futility bound of <img src="https://latex.codecogs.com/png.latex?0.149">, the study proceeds to the second stage with both active arms and the dataset is created in the same way as above:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1">dataset_2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb40-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-3">        lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))],</span>
<span id="cb40-4">        lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]</span>
<span id="cb40-5">    ),</span>
<span id="cb40-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-7">        lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))],</span>
<span id="cb40-8">        lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]</span>
<span id="cb40-9">    ),</span>
<span id="cb40-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-11">        lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))],</span>
<span id="cb40-12">        lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>surv[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]</span>
<span id="cb40-13">    ),</span>
<span id="cb40-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-15">        lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb40-16">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n),</span>
<span id="cb40-17">        lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[</span>
<span id="cb40-18">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t1_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))</span>
<span id="cb40-19">        ] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)</span>
<span id="cb40-20">    ),</span>
<span id="cb40-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-22">        lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb40-23">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n),</span>
<span id="cb40-24">        lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span></span>
<span id="cb40-25">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_t2_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)</span>
<span id="cb40-26">    ),</span>
<span id="cb40-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb40-28">        lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]</span>
<span id="cb40-29">        <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n),</span>
<span id="cb40-30">        lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>std.err[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(lt_c_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>time <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lm)))]</span>
<span id="cb40-31">        <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(n)</span>
<span id="cb40-32">    ),</span>
<span id="cb40-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n, n),</span>
<span id="cb40-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n, n),</span>
<span id="cb40-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n, n)</span>
<span id="cb40-36">)</span>
<span id="cb40-37"></span>
<span id="cb40-38">result_2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb40-39">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataset_2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> d_IN,</span>
<span id="cb40-40">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb40-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">varianceOption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairwisePooled"</span></span>
<span id="cb40-42">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">result_2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a continuous endpoint (2 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were calculated using a multi-arm t-test, Simes intersection test, normal approximation test, pairwise pooled variances option. H0: mu(i) - mu(control) = 0 against H1: mu(i) - mu(control) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0.149</td>
<td>0.414</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>0.191</td>
<td>0.226</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>0.217</td>
<td>0.329</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation</td>
<td>0.714</td>
<td>0.931</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>2.287</td>
<td>1.769</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>2.601</td>
<td>3.512</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.0111</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.0046</td>
<td>0.0002</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0093</td>
<td>0.0004</td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1)</td>
<td>0.0111</td>
<td>0.0384</td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (2)</td>
<td>0.0046</td>
<td>0.0002</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2)</td>
<td>2.354</td>
<td>4.015</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1)</td>
<td>2.287</td>
<td>2.868</td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (2)</td>
<td>2.601</td>
<td>4.323</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (1)</td>
<td>0.2359</td>
<td>0.7272</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (2)</td>
<td>0.2530</td>
<td>0.9870</td>
<td></td>
</tr>
<tr class="odd">
<td>95% repeated confidence interval (1)</td>
<td>[-0.133; 0.514]</td>
<td>[-0.005; 0.441]</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval (2)</td>
<td>[-0.107; 0.542]</td>
<td>[0.096; 0.527]</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (1)</td>
<td>0.1425</td>
<td>0.0119</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (2)</td>
<td>0.1331</td>
<td>0.0007</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<p>Again, referring to the overall adjusted test statistics, since <img src="https://latex.codecogs.com/png.latex?4.015%20%3E%202.511">, the global intersection hypothesis can be rejected in the second stage. Subsequently, the hypothesis of no effect in the first treatment group can be rejected because <img src="https://latex.codecogs.com/png.latex?2.868%20%3E%202.511"> and the hypothesis of no effect in the second treatment group can be rejected due to <img src="https://latex.codecogs.com/png.latex?4.323"> exceeding the applicable critical value. Another testing approach would be to compare repeated p-values listed at the end of the output (<img src="https://latex.codecogs.com/png.latex?0.0119,%20%5C,%200.0007">) to the full significance level <img src="https://latex.codecogs.com/png.latex?%5Calpha=0.025">.</p>
<p>As mentioned in the context of the simulations in chapter 5, study success can only be concluded when both treatment arms have been tested significantly against control. As this appears to be the case here, the study would have successfully finished at the second stage.</p>
</section>
<section id="closing-remarks" class="level1">
<h1>Closing remarks</h1>
<p>This vignette demonstrated how to implement a MAMS study design in case the futility bounds are only known on the treatment effect scale. In addition, how to perform MAMS simulations with special regards to treatment arm selection as well as how to analyze generic data using the binary module or perform landmark analysis with the support of <a href="https://cran.r-project.org/package=gestate">gestate</a> was demonstrated. Especially considering the final chapter about the landmark analysis, further investigations on how the results and characteristics such as <img src="https://latex.codecogs.com/png.latex?%5Calpha">-level control and/or the power behave could be done in subsequent research.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Rates</category>
  <category>Multi-arm</category>
  <category>Analysis</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_mams_design_and_analysis/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_14.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Planning a Trial with Binary Endpoints with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/</link>
  <description><![CDATA[ 




<section id="designing-a-trial-with-binary-endpoints" class="level1">
<h1>Designing a trial with binary endpoints</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>Suppose a trial should be conducted in 3 stages where at the first stage 50%, at the second stage 75%, and at the final stage 100% of the information should be observed. O’Brien &amp; Fleming boundaries are to be used with one-sided <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> and non-binding futility bounds 0 and 0.5 for the first and the second stage, respectively, on the <img src="https://latex.codecogs.com/png.latex?z">-value scale.</p>
<p>The endpoints are binary (failure rates) and should be compared in a parallel group design, i.e., the null hypothesis to be tested is <img src="https://latex.codecogs.com/png.latex?H_0:%5Cpi_1%20-%20%5Cpi_2%20=%200%5C,,"> which is tested against the alternative <img src="https://latex.codecogs.com/png.latex?H_1:%20%5Cpi_1%20-%20%5Cpi_2%20%3C%200%5C,."></p>
<section id="sample-size-calculation" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-calculation">Sample size calculation</h2>
<p>The necessary sample size to achieve 90% power if the failure rates are assumed to be <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.40"> for the treatment group and <img src="https://latex.codecogs.com/png.latex?%5Cpi_2%20=%200.60"> for the control group can be obtained as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">dGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb3-4">)</span>
<span id="cb3-5">r <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span></code></pre></div></div>
</div>
<p>The <code>summary()</code> command creates a nice table for the study design parameters:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 90%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) = 0.4, control rate pi(2) = 0.6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0105</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0097</td>
<td>0.0215</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.863</td>
<td>2.337</td>
<td>2.024</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t)</td>
<td>-0.248</td>
<td>-0.165</td>
<td>-0.124</td>
</tr>
<tr class="odd">
<td>Futility boundary (t)</td>
<td>0.000</td>
<td>-0.035</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2958</td>
<td>0.6998</td>
<td>0.9000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>133.1</td>
<td>199.7</td>
<td>266.3</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>198.3</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.5021</td>
<td>0.2275</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.3058</td>
<td>0.4095</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0021</td>
<td>0.0083</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2958</td>
<td>0.4040</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.5000</td>
<td>0.2191</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.0100</td>
<td>0.0056</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>Note that the calculation of the efficacy (and futility) boundaries on the treatment effect scale is performed under the assumption that <img src="https://latex.codecogs.com/png.latex?%5Cpi_2%20=%200.60"> is the observed failure rate in the control group and states the <em>treatment difference to be observed</em> in order to reach significance (or stop the trial due to futility).</p>
</section>
<section id="optimum-allocation-ratio" class="level2">
<h2 class="anchored" data-anchor-id="optimum-allocation-ratio">Optimum allocation ratio</h2>
<p>The optimum allocation ratio yields the smallest overall sample size and depends on the choice of <img src="https://latex.codecogs.com/png.latex?%5Cpi_1"> and <img src="https://latex.codecogs.com/png.latex?%5Cpi_2">. It can be obtained by specifying <code>allocationRatioPlanned = 0</code>. In our case, due to <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%201%20-%20%5Cpi_2">, the optimum allocation ratio is 1. However, since it is calculated numerically, the value slightly deviates from 1:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">r <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb5-2">r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>allocationRatioPlanned</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.9999976</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>allocationRatioPlanned, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1</code></pre>
</div>
</div>
</section>
<section id="boundary-plots" class="level2">
<h2 class="anchored" data-anchor-id="boundary-plots">Boundary plots</h2>
<p>The decision boundaries can be illustrated on different scales.</p>
<p>On the <img src="https://latex.codecogs.com/png.latex?z">-value scale:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-6-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>On the effect size scale:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>On the <img src="https://latex.codecogs.com/png.latex?p">-value scale:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-assessment" class="level2">
<h2 class="anchored" data-anchor-id="power-assessment">Power assessment</h2>
<p>Suppose that a total of <img src="https://latex.codecogs.com/png.latex?N%20=%20280"> subjects were planned for the study. The power if the failure rate in the active treatment group is <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.40"> or <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.50"> can be achieved as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">power <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(dGS,</span>
<span id="cb12-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>,</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb12-4">)</span>
<span id="cb12-5">power<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.914045 0.377853</code></pre>
</div>
</div>
<p>Note that <code>directionUpper = FALSE</code> is used because the study is powered for alternatives <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20-%20%5Cpi_2"> being smaller than 0.</p>
<p>The power for <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.50"> (37.8%) is greatly reduced as compared to the case <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.40"> (where it exceeds 90%).</p>
</section>
<section id="graphical-illustration" class="level2">
<h2 class="anchored" data-anchor-id="graphical-illustration">Graphical illustration</h2>
<p>We also can graphically illustrate the power, the expected sample size, and the early stopping and futility stopping probabilities for a range of alternative values. This can be done by specifying the lower and the upper bound for <img src="https://latex.codecogs.com/png.latex?%5Cpi_1"> in <code>getPowerRates()</code> and using the generic <code>plot()</code> command with <code>type = 6</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">power <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(dGS,</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>,</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb14-4">)</span>
<span id="cb14-5">power <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Note that the futility boundaries are treated as <strong>binding</strong> when calculating the probability of early stopping, even though they were specified to be non-binding.</p>
</section>
</section>
<section id="sample-size-reassessment-ssr-for-testing-rates" class="level1">
<h1>Sample size reassessment (SSR) for testing rates</h1>
<p>Suppose that, using an adaptive design, the sample size from the above example can be increased <em>in the last interim</em> up to a 4-fold of the originally planned sample size for the last stage. A target conditional power of 90% <em>based on the observed effect sizes (failure rates)</em> should be used to increase the sample size. We want to use the inverse normal method to allow for the sample size increase and compare the test characteristics with the group sequential design from the above example.</p>
<section id="assess-power" class="level2">
<h2 class="anchored" data-anchor-id="assess-power">Assess power</h2>
<p>To assess the test characteristics of this adaptive design, we first define the inverse normal design and then perform two simulations, one without and one with SSR:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">dIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb15-4">)</span>
<span id="cb15-5"></span>
<span id="cb15-6">sim1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(dIN,</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">210</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>),</span>
<span id="cb15-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb15-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb15-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>),</span>
<span id="cb15-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb15-12">)</span>
<span id="cb15-13"></span>
<span id="cb15-14">sim2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(dIN,</span>
<span id="cb15-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">210</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>),</span>
<span id="cb15-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb15-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb15-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>),</span>
<span id="cb15-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb15-20">)</span></code></pre></div></div>
</div>
<p>Note that the sample sizes will be calculated under the assumption that the <em>conditional power for the subsequent stage</em> is 90%. If the resulting sample size is larger, the upper bound (4*70 = 280) is used.</p>
<p>Note also that <code>sim1</code> can also be <em>calculated</em> using <code>getPowerRates()</code> or can also <em>be simulated more easily</em> without specifying <code>conditionalPower</code>, <code>minNumberOfSubjectsPerStage</code>, and <code>maxNumberOfSubjectsPerStage</code> (which obviously is redundant for <code>sim1</code>) but this way ensures that the calculated objects <code>sim1</code> and <code>sim2</code> <em>contain exactly the same parameters</em> and therefore can be combined more easily (see below). The first elements of the vectors <code>minNumberOfSubjectsPerStage</code> and <code>maxNumberOfSubjectsPerStage</code> are not taken into account (since adaptations of the first-stage sample size are not permitted).</p>
<p>We can look at the power and the expected sample size of the two procedures and assess the power gain of using the adaptive design which comes along with an increased expected sample size:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">sim1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>pi1 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Treatment rate</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sim1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Power of sim1</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 0.921 0.890 0.853 0.810 0.752 0.721 0.675 0.582 0.526 0.469 0.405</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sim2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Power of sim2</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 0.976 0.971 0.940 0.912 0.882 0.869 0.800 0.718 0.695 0.601 0.475</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sim1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Average sample size of sim1</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 202.1 209.3 216.4 219.5 222.0 230.9 231.1 238.3 234.2 237.9 236.5</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(sim2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>expectedNumberOfSubjects, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Average sample size of sim2</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 240.7 251.6 270.6 278.8 286.6 305.8 323.8 330.9 336.4 336.8 349.3</code></pre>
</div>
</div>
</section>
<section id="illustrate-power-difference" class="level2">
<h2 class="anchored" data-anchor-id="illustrate-power-difference">Illustrate power difference</h2>
<p>We now want to graphically illustrate the gain in power when using the adaptive sample size recalculation. We use <a href="https://cran.r-project.org/package%20=%20ggplot2">ggplot2</a> (see <a href="https://ggplot2.tidyverse.org">ggplot2.tidyverse.org</a>) for doing this. First, a dataset <code>df</code> combining <code>sim1</code>and <code>sim2</code> is defined with the additional variable SSR. Defining <code>mytheme</code> and using the following <a href="https://cran.r-project.org/package%20=%20ggplot2">ggplot2</a> commands, the difference in power and ASN of the two strategies is illustrated. The illustration shows that for effect differences below -0.15, an overall power which exceeds around 85% can be achieved with the proposed sample size recalculation strategy.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb26-2"></span>
<span id="cb26-3">dataSim1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(sim1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">niceColumnNamesEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb26-4">dataSim2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(sim2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">niceColumnNamesEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb26-5"></span>
<span id="cb26-6">dataSim1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>SSR <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no SSR"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(dataSim1))</span>
<span id="cb26-7">dataSim2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>SSR <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SSR"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(dataSim2))</span>
<span id="cb26-8">df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(dataSim1, dataSim2)</span>
<span id="cb26-9"></span>
<span id="cb26-10">myTheme <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb26-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.title.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb26-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.title.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb26-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot.title =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb26-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot.subtitle =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb26-15">)</span>
<span id="cb26-16"></span>
<span id="cb26-17">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(</span>
<span id="cb26-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> df,</span>
<span id="cb26-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> effect, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> overallReject, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> SSR, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> SSR)</span>
<span id="cb26-20">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(</span>
<span id="cb26-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> effect, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> expectedNumberOfSubjects <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>,</span>
<span id="cb26-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> SSR, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> SSR</span>
<span id="cb26-25">    ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>,</span>
<span id="cb26-27">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sec.axis =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sec_axis</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> . <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ASN"</span>),</span>
<span id="cb26-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">limits =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-29">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-30">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"effect"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-31">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power and ASN"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power solid, ASN dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-36">    myTheme</span>
<span id="cb26-37"></span>
<span id="cb26-38">p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-14-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>For saving the graph, use</p>
<p><code>ggplot2::ggsave(filename = "c:/yourdirectory/comparison.png",</code> <code>plot = ggplot2::last_plot(), device = NULL, path = NULL,</code> <code>scale = 1.2, width = 20, height = 12, units = "cm", dpi = 600,</code> <code>limitsize = TRUE)</code></p>
<p>For additional examples of using <a href="https://cran.r-project.org/package%20=%20ggplot2">ggplot2</a> in rpact see also the vignette <a href="https://www.rpact.com/vignettes/rpact_ggplot_examples">Supplementing and enhancing rpact’s graphical capabilities with ggplot2</a>.</p>
</section>
<section id="histogram-of-sample-sizes" class="level2">
<h2 class="anchored" data-anchor-id="histogram-of-sample-sizes">Histogram of sample sizes</h2>
<p>Finally, we create a histogram for the attained sample size of the study <em>when using the adaptive sample size recalculation</em>.</p>
<p>With the <code>getData()</code> command, the simulation results are obtained and <code>str(simdata)</code> provides information of the structure of this data:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">simData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sim2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>()</span>
<span id="cb27-2">simData <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>'data.frame':   24579 obs. of  19 variables:
 $ iterationNumber          : num  1 2 2 2 3 3 4 4 4 5 ...
 $ stageNumber              : num  1 1 2 3 1 2 1 2 3 1 ...
 $ pi1                      : num  0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 ...
 $ pi2                      : num  0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ...
 $ numberOfSubjects         : num  140 140 70 147 140 70 140 70 91 140 ...
 $ numberOfCumulatedSubjects: num  140 140 210 357 140 210 140 210 301 140 ...
 $ rejectPerStage           : num  1 0 0 1 0 1 0 0 1 1 ...
 $ futilityPerStage         : num  0 0 0 0 0 0 0 0 0 0 ...
 $ testStatistic            : num  3.05 2.03 2.07 4.07 2.03 ...
 $ testStatisticsPerStage   : num  3.054 2.028 0.718 4.547 2.029 ...
 $ overallRate1             : num  0.329 0.414 0.438 0.369 0.429 ...
 $ overallRate2             : num  0.586 0.586 0.581 0.607 0.6 ...
 $ stagewiseRates1          : num  0.329 0.414 0.486 0.27 0.429 ...
 $ stagewiseRates2          : num  0.586 0.586 0.571 0.644 0.6 ...
 $ sampleSizesPerStage1     : num  70 70 35 74 70 35 70 35 46 70 ...
 $ sampleSizesPerStage2     : num  70 70 35 73 70 35 70 35 45 70 ...
 $ trialStop                : logi  TRUE FALSE FALSE TRUE FALSE TRUE ...
 $ conditionalPowerAchieved : num  NA NA 0.602 0.9 NA ...
 $ pValue                   : num  0.00112984 0.02126124 0.23628281 0.00000272 0.02121903 ...</code></pre>
</div>
</div>
<p>Depending on <img src="https://latex.codecogs.com/png.latex?%5Cpi_1"> (in this example, for <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20=%200.5">), you can create the histogram of the simulated total sample size as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">simDataPart <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> simData[simData<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>pi1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, ]</span>
<span id="cb29-2"></span>
<span id="cb29-3">overallSampleSizes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span></span>
<span id="cb29-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sapply</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(i) {</span>
<span id="cb29-5">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(simDataPart[simDataPart<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>iterationNumber <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> i, ]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfSubjects)</span>
<span id="cb29-6">    })</span>
<span id="cb29-7"></span>
<span id="cb29-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hist</span>(overallSampleSizes, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Histogram"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Achieved sample size"</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/index_files/figure-html/unnamed-chunk-18-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Percentages on how often the maximum and other sample sizes are reached over the stages can be obtained as follows:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">subjectsRange <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cut</span>(simDataPart<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfSubjects, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">69</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">139</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">140</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">210</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">279</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">280</span>),</span>
<span id="cb30-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb30-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(69,70]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(70,139]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(139,140]"</span>,</span>
<span id="cb30-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(140,210]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(210,279]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(279,280]"</span></span>
<span id="cb30-5">    )</span>
<span id="cb30-6">)</span>
<span id="cb30-7"></span>
<span id="cb30-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">prop.table</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(simDataPart<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageNumber, subjectsRange), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">margin =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div></div>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: right;">(69,70]</th>
<th style="text-align: right;">(70,139]</th>
<th style="text-align: right;">(139,140]</th>
<th style="text-align: right;">(140,210]</th>
<th style="text-align: right;">(210,279]</th>
<th style="text-align: right;">(279,280]</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">100.0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
</tr>
<tr class="even">
<td style="text-align: right;">100</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
<td style="text-align: right;">0.0</td>
</tr>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">9.1</td>
<td style="text-align: right;">0.3</td>
<td style="text-align: right;">7.9</td>
<td style="text-align: right;">7.1</td>
<td style="text-align: right;">75.5</td>
</tr>
</tbody>
</table>
<p>For this simulation, the originally planned sample size (70) was never selected for the third stage and in most cases, the maximum of sample size (280) was used.</p>
</section>
</section>
<section id="references" class="level1">
<h1>References</h1>
<ol type="1">
<li><p>Gernot Wassmer and Werner Brannath, <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, Springer 2016, ISBN 978-3319325606</p></li>
<li><p>R-Studio, <em>Data Visualization with ggplot2 - Cheat Sheet</em>, version 2.1, 2016, https://www.rstudio.com/wp-content/uploads/2016/11/ggplot2-cheatsheet-2.1.pdf</p></li>
</ol>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Rates</category>
  <category>Sample size</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_binary_planning_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_05.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Simulation of a Trial with a Binary Endpoint and Unblinded Sample Size Re-Calculation with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> provides the functions <code>getSimulationMeans()</code> (continuous endpoints), <code>getSimulationRates()</code> (binary endpoints) and <code>getSimulationSurvival()</code> (time-to-event endpoints) for simulation of group sequential trials with adaptive SSR.</p>
<p>For trials with adaptive SSR, the design can be created with the functions <code>getDesignInverseNormal()</code> or <code>getDesignFisher()</code>. The sample size is re-calculated based on the target conditional power (argument <code>conditionalPower</code>). Conditional power is by default evaluated at the observed estimates for the parameters. If the evaluation of conditional power at other parameter values is desired, they can be provided as arguments <code>thetaH1</code> (for <code>getSimulationMeans()</code> and <code>getSimulationSurvival()</code>), or <code>pi1H1</code> and <code>pi2H1</code> (for <code>getSimulationRates()</code>). For continuous endpoints, by default, conditional power is evaluated at the standard deviation <code>stDev</code> under which the trial is simulated. In rpact 3.0, a variable <code>stDevH1</code> can be entered to specify the standard deviation that is used for the sample size recalculation.</p>
<p>For the functions <code>getSimulationMeans()</code> and <code>getSimulationRates()</code> (but not in <code>getSimulationSurvival()</code>), the SSR function can be optionally modified using the argument <code>calcSubjectsFunction()</code> (see the respective help pages and the code below for details and examples).</p>
<p>In this vignette, we present an example of the use of these functions for a trial with a binary endpoint. For this, we will use the constraint promizing zone approach as described in <a href="https://doi.org/10.1002/bimj.201700308">Hsiao et al. (2019)</a>.</p>
<p>For this vignette, additionally to <a href="https://cran.r-project.org/package=rpact">rpact</a> itself and <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a>, we use the packages <a href="https://CRAN.R-project.org/package=ggpubr">ggpubr</a> and <a href="https://CRAN.R-project.org/package=dplyr">dplyr</a>.</p>
</section>
<section id="assumptions-and-design-options" class="level1">
<h1>Assumptions and design options</h1>
<ul>
<li>1:1 randomized superiority trial with overall response rate (ORR) as the primary endpoint (binary)</li>
<li>ORR in the control arm is known to be ~20%</li>
<li>The novel treatment may increase ORR by 10%-13%<br>
</li>
<li>2.5% one-sided significance level</li>
</ul>
<p>We first calculate the sample sizes (per treatment group) for the corresponding fixed designs with 90% power:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fixed design powered for delta of 13%</span></span>
<span id="cb1-2">ssMin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, </span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb1-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb1-7">(Nmin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(ssMin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfSubjects1))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>     [,1]
[1,]  241</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fixed design powered for delta of 10%</span></span>
<span id="cb3-2">ssMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>, </span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb3-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb3-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb3-7">(Nmax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(ssMax<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfSubjects1))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>     [,1]
[1,]  392</code></pre>
</div>
</div>
<p>Assume that the sponsor is unwilling to make an up-front commitment for a trial with Nmax = 392 subjects per treatment group but that they are willing to provide an up-front commitment for a trial with Nmin = 241 subjects per treatment group. If the results at an interim analysis with an unblinded SSR look “promising”, the sponsor would then be willing to commit funding for up to 392 subjects per treatment group in total.</p>
<p>To help the sponsor, we investigate two designs with an interim analysis for SSR after 120 subjects per treatment group:</p>
<ol type="1">
<li>SSR based on conditional power: adjust sample size to achieve a conditional power of 90% assuming that the true response rates are 20% and 30% (if this is feasible within the given sample size range)</li>
<li>A constrained promising zone design (<a href="https://doi.org/10.1002/bimj.201700308">Hsiao et al., 2019</a>) with <img src="https://latex.codecogs.com/png.latex?cp_%7Bmin%7D%20=%2080%5C%25"> and <img src="https://latex.codecogs.com/png.latex?cp_%7Bmax%7D%20=%2090%5C%25">.</li>
</ol>
<p>To combine the two stages for both designs, we use an inverse normal combination test with optimal weights for the minimal final group size (practically, this is a design with equal weights) and no provision for early stopping for neither efficacy nor futility at interim:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># group size at interim</span></span>
<span id="cb5-2">n1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">floor</span>(Nmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># inverse normal design with possible rejection of H0 only at the final analysis</span></span>
<span id="cb6-2">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span>,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb6-6">)</span>
<span id="cb6-7">designIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 2 looks (inverse normal combination test design)</em></p>
<p>No early efficacy stop design, one-sided overall significance level 2.5%, undefined endpoint.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.707</td>
<td>0.707</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>Inf</td>
<td>1.960</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="design-with-ssr-ssr-based-on-conditional-power" class="level1">
<h1>Design with SSR (SSR) based on conditional power</h1>
<p>It is straightforward to simulate the test characteristics from this design using the function <code>getSimulationRates()</code>. <code>plannedSubjects</code> refers to the cumulated sample sizes over the two stages <strong>in both treatment groups</strong>. If <code>conditionalPower</code> is specified, <code>minNumberOfSubjectsPerStage</code> and <code>maxNumberOfSubjectsPerStage</code> must be specified. They refer to the minimum and maximum overall sample sizes <strong>per stage</strong> (the first element is the first stage sample size), respectively. If <code>pi1H1</code> and/or <code>pi2H1</code> are not specified, the observed (simulated) rates at interim are used for the SSR.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Design with sample size re-estimated to get conditional power of 0.9 at</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pi1H1 = 0.3, pi2H1 = 0.2 [minimum effect size]</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (evaluate at most interesting values for pi1)</span></span>
<span id="cb7-4">simCpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(designIN,</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>), </span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb7-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cumulative overall sample size</span></span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, Nmin),</span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb7-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise minimal overall sample size</span></span>
<span id="cb7-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb7-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise maximal overall sample size</span></span>
<span id="cb7-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb7-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb7-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb7-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb7-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>,</span>
<span id="cb7-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showStatistics =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb7-19">)</span>
<span id="cb7-20">simCpower</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Simulation of rates (inverse normal combination test design)</em></p>
<p><em>Design parameters</em></p>
<ul>
<li><em>Information rates</em>: 0.500, 1.000</li>
<li><em>Critical values</em>: Inf, 1.960</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.0000, 0.0250</li>
<li><em>Local one-sided significance levels</em>: 0.0000, 0.0250</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><em>User defined parameters</em></p>
<ul>
<li><em>Planned cumulative subjects</em>: 240, 482</li>
<li><em>Assumed treatment rate</em>: 0.200, 0.300, 0.330</li>
<li><em>Assumed control rate</em>: 0.200</li>
<li><em>Seed</em>: 12345</li>
<li><em>Maximum number of iterations</em>: 1000</li>
<li><em>Minimum number of subjects per stage</em>: 240, 242</li>
<li><em>Maximum number of subjects per stage</em>: 240, 544</li>
<li><em>Conditional power</em>: 0.9</li>
<li><em>pi(1) under H1</em>: 0.300</li>
</ul>
<p><em>Default parameters</em></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Direction upper</em>: TRUE</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Risk ratio</em>: FALSE</li>
<li><em>pi(2) under H1</em>: 0.200</li>
</ul>
<p><em>Derived parameters</em></p>
<ul>
<li><em>Effect</em>: 0.00, 0.10, 0.13</li>
</ul>
<p><em>Results</em></p>
<ul>
<li><em>Expected number of subjects</em>: 771.7, 631.5, 577.2</li>
<li><em>Sample sizes [1]</em>: 240, 240, 240</li>
<li><em>Sample sizes [2]</em>: 531.7, 391.5, 337.2</li>
<li><em>Reject per stage [1]</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Reject per stage [2]</em>: 0.0220, 0.8590, 0.9730</li>
<li><em>Overall reject</em>: 0.0220, 0.8590, 0.9730</li>
<li><em>Overall futility stop</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Futility stop per stage</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Early stop</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Conditional power (achieved) [1]</em>: NA, NA, NA</li>
<li><em>Conditional power (achieved) [2]</em>: 0.4821, 0.8579, 0.9092</li>
<li><em>Iterations [1]</em>: 1000, 1000, 1000</li>
<li><em>Iterations [2]</em>: 1000, 1000, 1000</li>
</ul>
<p><em>Legend</em></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
</section>
<section id="constrained-promising-zone-cpz-design" class="level1">
<h1>Constrained promising zone (CPZ) design</h1>
<p>As described in <a href="https://doi.org/10.1002/bimj.201700308">Hsiao et al.&nbsp;(2019)</a>, this method chooses the sample size according to the following rules:</p>
<ol type="1">
<li><p>Choose the second stage sample size <img src="https://latex.codecogs.com/png.latex?N%5E*"> between <img src="https://latex.codecogs.com/png.latex?Nmin"> and <img src="https://latex.codecogs.com/png.latex?Nmax"> such that the conditional power is <img src="https://latex.codecogs.com/png.latex?cp_%7Bmax%7D"> for the minimal effect size we want to detect (i.e., ORR of 20% vs.&nbsp;30%). We choose <img src="https://latex.codecogs.com/png.latex?cp_%7Bmax%7D%20=%200.90"> here as in the original publication.</p></li>
<li><p>If such a sample size <img src="https://latex.codecogs.com/png.latex?N%5E*"> does not exist, then proceed as follows:</p>
<ul>
<li>If the conditional power cannot be boosted to at least <img src="https://latex.codecogs.com/png.latex?cp_%7Bmin%7D"> by increasing the sample size to <img src="https://latex.codecogs.com/png.latex?Nmax">, i.e., if the interim result is not considered «promising», then do not increase the sample and set <img src="https://latex.codecogs.com/png.latex?N%5E*%20=%20Nmin">. We choose <img src="https://latex.codecogs.com/png.latex?cp_%7Bmin%7D%20=%200.80"> here as in the original publication.</li>
<li>Otherwise: set <img src="https://latex.codecogs.com/png.latex?N%5E*%20=%20Nmax"></li>
</ul></li>
</ol>
<p>To simulate the CPZ design in <a href="https://cran.r-project.org/package=rpact">rpact</a>, we can use the function <code>getSimulationRates()</code> again. However, the situation is more complicated because we need to re-define the sample size recalculation rule using the argument <code>calcSubjectsFunction</code> (see the help page <code>?getSimulationRates</code> for more information regarding <code>calcSubjectsFunction()</code>):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CPZ design (evaluate at the most interesting values for pi1)</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># home-made SSR function</span></span>
<span id="cb8-3">myCPZSampleSizeCalculationFunction <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(..., stage,</span>
<span id="cb8-4">        plannedSubjects,</span>
<span id="cb8-5">        conditionalPower,</span>
<span id="cb8-6">        minNumberOfSubjectsPerStage,</span>
<span id="cb8-7">        maxNumberOfSubjectsPerStage,</span>
<span id="cb8-8">        conditionalCriticalValue,</span>
<span id="cb8-9">        overallRate) {</span>
<span id="cb8-10">    rateUnderH0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-11"></span>
<span id="cb8-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># function adapted from example in ?getSimulationRates</span></span>
<span id="cb8-13">    calculateStageSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(cp) {</span>
<span id="cb8-14">        <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, conditionalCriticalValue <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb8-15">            <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> rateUnderH0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rateUnderH0)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb8-16">            stats<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(cp) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb8-17">                (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span></span>
<span id="cb8-18">            (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, (overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> overallRate[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-19">    }</span>
<span id="cb8-20"></span>
<span id="cb8-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate sample size required to reach maximum desired conditional power</span></span>
<span id="cb8-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cp_max (provided as argument conditionalPower)</span></span>
<span id="cb8-23">    stageSubjectsCPmax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">calculateStageSubjects</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cp =</span> conditionalPower)</span>
<span id="cb8-24"></span>
<span id="cb8-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate sample size required to reach minimum desired conditional power</span></span>
<span id="cb8-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cp_min (**manually set for this example to 0.8**)</span></span>
<span id="cb8-27">    stageSubjectsCPmin <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">calculateStageSubjects</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cp =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb8-28"></span>
<span id="cb8-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define stageSubjects</span></span>
<span id="cb8-30">    stageSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb8-31">        minNumberOfSubjectsPerStage[stage],</span>
<span id="cb8-32">        stageSubjectsCPmax</span>
<span id="cb8-33">    ), maxNumberOfSubjectsPerStage[stage]))</span>
<span id="cb8-34"></span>
<span id="cb8-35">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Set stageSubjects to minimal sample size in case minimum conditional power</span></span>
<span id="cb8-36">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cannot be reached with available sample size</span></span>
<span id="cb8-37">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (stageSubjectsCPmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> maxNumberOfSubjectsPerStage[stage]) {</span>
<span id="cb8-38">        stageSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> minNumberOfSubjectsPerStage[stage]</span>
<span id="cb8-39">    }</span>
<span id="cb8-40"></span>
<span id="cb8-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># return sample size</span></span>
<span id="cb8-42">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(stageSubjects)</span>
<span id="cb8-43">}</span>
<span id="cb8-44"></span>
<span id="cb8-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Now simulate the CPZ design</span></span>
<span id="cb8-46">simCPZ <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(designIN,</span>
<span id="cb8-47">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>), </span>
<span id="cb8-48">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb8-49">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, Nmin), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cumulative overall sample size</span></span>
<span id="cb8-50">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb8-51">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise minimal overall sample size</span></span>
<span id="cb8-52">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb8-53">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise maximal overall sample size</span></span>
<span id="cb8-54">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb8-55">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb8-56">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb8-57">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">calcSubjectsFunction =</span> myCPZSampleSizeCalculationFunction,</span>
<span id="cb8-58">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb8-59">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>, </span>
<span id="cb8-60">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showStatistics =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb8-61">)</span>
<span id="cb8-62"></span>
<span id="cb8-63">simCPZ</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Simulation of rates (inverse normal combination test design)</em></p>
<p><em>Design parameters</em></p>
<ul>
<li><em>Information rates</em>: 0.500, 1.000</li>
<li><em>Critical values</em>: Inf, 1.960</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.0000, 0.0250</li>
<li><em>Local one-sided significance levels</em>: 0.0000, 0.0250</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><em>User defined parameters</em></p>
<ul>
<li><em>Planned cumulative subjects</em>: 240, 482</li>
<li><em>Assumed treatment rate</em>: 0.200, 0.300, 0.330</li>
<li><em>Assumed control rate</em>: 0.200</li>
<li><em>Seed</em>: 12345</li>
<li><em>Maximum number of iterations</em>: 1000</li>
<li><em>Minimum number of subjects per stage</em>: 240, 242</li>
<li><em>Maximum number of subjects per stage</em>: 240, 544</li>
<li><em>Conditional power</em>: 0.9</li>
<li><em>pi(1) under H1</em>: 0.300</li>
<li><em>Calculate subjects function</em>: user defined</li>
</ul>
<p><em>Default parameters</em></p>
<ul>
<li><em>Normal approximation</em>: TRUE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Direction upper</em>: TRUE</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Risk ratio</em>: FALSE</li>
<li><em>pi(2) under H1</em>: 0.200</li>
</ul>
<p><em>Derived parameters</em></p>
<ul>
<li><em>Effect</em>: 0.00, 0.10, 0.13</li>
</ul>
<p><em>Results</em></p>
<ul>
<li><em>Expected number of subjects</em>: 525.7, 574.5, 550.1</li>
<li><em>Sample sizes [1]</em>: 240, 240, 240</li>
<li><em>Sample sizes [2]</em>: 285.7, 334.5, 310.1</li>
<li><em>Reject per stage [1]</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Reject per stage [2]</em>: 0.0190, 0.8070, 0.9460</li>
<li><em>Overall reject</em>: 0.0190, 0.8070, 0.9460</li>
<li><em>Overall futility stop</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Futility stop per stage</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Early stop</em>: 0.0000, 0.0000, 0.0000</li>
<li><em>Conditional power (achieved) [1]</em>: NA, NA, NA</li>
<li><em>Conditional power (achieved) [2]</em>: 0.2827, 0.7883, 0.8898</li>
<li><em>Iterations [1]</em>: 1000, 1000, 1000</li>
<li><em>Iterations [2]</em>: 1000, 1000, 1000</li>
</ul>
<p><em>Legend</em></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
</section>
<section id="graphical-comparison-of-the-two-designs" class="level1">
<h1>Graphical comparison of the two designs</h1>
<p>We first use the aggregated data from the two simulations to compare the dependence of the re-calculated sample size and the corresponding conditional power on the interim Z-score between the two designs. For this, we use the function <code>getData()</code>, the <code>summarize()</code> command of the <a href="https://cran.r-project.org/package=dplyr">dplyr</a> package and plot it with <a href="https://cran.r-project.org/package=ggplot2">ggplot2</a>. Note that for this illustration we summarize over all values of <code>pi1</code>. This makes sense because we used a fixed <code>pi1H1</code> and <code>pi2H1</code> for both sample size simulation methods.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># aggregate data across simulation runs for both simulations and extract Z-score,</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># conditionalPower, and totalSampleSize1 (per group)</span></span>
<span id="cb9-3">aggSimCpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simCpower)</span>
<span id="cb9-4">sumCpower <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> aggSimCpower <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(iterationNumber) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb9-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SS re-calculation for cp = 90%"</span>,</span>
<span id="cb9-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Z1 =</span> testStatistic[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> conditionalPowerAchieved[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb9-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">totalSampleSize1 =</span> (numberOfSubjects[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> numberOfSubjects[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb9-10">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Z1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb9-13"></span>
<span id="cb9-14">aggSimCPZ <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simCPZ)</span>
<span id="cb9-15">sumCPZ <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> aggSimCPZ <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(iterationNumber) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb9-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ)"</span>,</span>
<span id="cb9-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Z1 =</span> testStatistic[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> conditionalPowerAchieved[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb9-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">totalSampleSize1 =</span> (numberOfSubjects[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> numberOfSubjects[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb9-21">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(Z1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb9-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Z1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb9-24"></span>
<span id="cb9-25">sumBoth <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(sumCpower, sumCPZ)</span>
<span id="cb9-26"></span>
<span id="cb9-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot it</span></span>
<span id="cb9-28">plot1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, conditionalPower,</span>
<span id="cb9-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design,</span>
<span id="cb9-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> design</span>
<span id="cb9-31">), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sumBoth) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z-score at interim analysis"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(</span>
<span id="cb9-35">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb9-36">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Conditional power at re-calculated sample size"</span></span>
<span id="cb9-37">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-38">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>))</span>
<span id="cb9-39"></span>
<span id="cb9-40">plot2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Z1, totalSampleSize1,</span>
<span id="cb9-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design,</span>
<span id="cb9-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> design</span>
<span id="cb9-43">), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> sumBoth) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-44">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-45">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z-score at interim analysis"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-46">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re-calculated final sample size (per group)"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-47">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>))</span>
<span id="cb9-48"></span>
<span id="cb9-49"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggarrange</span>(plot1, plot2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">common.legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bottom"</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
<p>To compare the two designs across a wider range of parameters, we re-simulate the designs for a finer grid of assumed ORR in the intervention group and then visualize the results.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simulate designs again over a range of parameters and plot them</span></span>
<span id="cb10-2">pi1Seq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb10-3"></span>
<span id="cb10-4">simCpowerLong <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(designIN,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1Seq, </span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Nmin),</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb10-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Nmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Nmax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb10-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb10-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb10-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb10-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb10-15">)</span>
<span id="cb10-16"></span>
<span id="cb10-17">simCpowerLong <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">simCPZLong <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(designIN,</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1Seq, </span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb11-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cumulative overall sample size</span></span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, Nmin),</span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb11-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise minimal overall sample size</span></span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmin <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb11-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stage-wise maximal overall sample size</span></span>
<span id="cb11-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(n1, (Nmax <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1)),</span>
<span id="cb11-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb11-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2H1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb11-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">calcSubjectsFunction =</span> myCPZSampleSizeCalculationFunction,</span>
<span id="cb11-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb11-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb11-16">)</span>
<span id="cb11-17"></span>
<span id="cb11-18">simCPZLong <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/index_files/figure-html/unnamed-chunk-10-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pool datasets from simulations (and fixed designs)</span></span>
<span id="cb12-2">simCpowerData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.list</span>(simCpowerLong),</span>
<span id="cb12-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb12-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SS re-calculation for cp = 90%"</span>,</span>
<span id="cb12-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> pi2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effect =</span> effect, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> overallReject,</span>
<span id="cb12-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfSubjects1 =</span> expectedNumberOfSubjects <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-7">    ),</span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> F</span>
<span id="cb12-9">)</span>
<span id="cb12-10"></span>
<span id="cb12-11">simCPZData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.list</span>(simCPZLong),</span>
<span id="cb12-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb12-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ)"</span>,</span>
<span id="cb12-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> pi2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effect =</span> effect, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> overallReject,</span>
<span id="cb12-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfSubjects1 =</span> expectedNumberOfSubjects <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-16">    ),</span>
<span id="cb12-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> F</span>
<span id="cb12-18">)</span>
<span id="cb12-19"></span>
<span id="cb12-20">simFixed241 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(</span>
<span id="cb12-21">    simCPZData,</span>
<span id="cb12-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb12-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed (n = 241)"</span>,</span>
<span id="cb12-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> pi2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effect =</span> effect,</span>
<span id="cb12-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb12-26">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">241</span>,</span>
<span id="cb12-27">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-28">        )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject,</span>
<span id="cb12-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfSubjects1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">241</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> F</span>
<span id="cb12-30">    )</span>
<span id="cb12-31">)</span>
<span id="cb12-32"></span>
<span id="cb12-33">simFixed392 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">with</span>(</span>
<span id="cb12-34">    simCPZData,</span>
<span id="cb12-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb12-36">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed (n = 392)"</span>,</span>
<span id="cb12-37">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> pi2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effect =</span> effect,</span>
<span id="cb12-38">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb12-39">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">392</span>,</span>
<span id="cb12-40">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-41">        )<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject,</span>
<span id="cb12-42">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">expectedNumberOfSubjects1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">392</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stringsAsFactors =</span> F</span>
<span id="cb12-43">    )</span>
<span id="cb12-44">)</span>
<span id="cb12-45"></span>
<span id="cb12-46">simdata <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(simCpowerData, simCPZData, simFixed241, simFixed392)</span>
<span id="cb12-47">simdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(simdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>design,</span>
<span id="cb12-48">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">levels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb12-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed (n = 241)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fixed (n = 392)"</span>,</span>
<span id="cb12-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SS re-calculation for cp = 90%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Constrained promising zone (CPZ)"</span></span>
<span id="cb12-51">    )</span>
<span id="cb12-52">)</span>
<span id="cb12-53"></span>
<span id="cb12-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot difference in ORR vs power</span></span>
<span id="cb12-55"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(effect, power, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> simdata) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-56">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-57">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Difference in ORR"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-58">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-59">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.13</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#2c7bb6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#abd9e9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="768"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot difference in ORR vs expected sample size</span></span>
<span id="cb13-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(effect, expectedNumberOfSubjects1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> design), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> simdata) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Difference in ORR"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected sample size (per group)"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_color_manual</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#2c7bb6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#abd9e9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#fdae61"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d7191c"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/index_files/figure-html/unnamed-chunk-11-2.png" class="img-fluid figure-img" width="768"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="conclusions-for-the-example" class="level1">
<h1>Conclusions for the example</h1>
<ul>
<li>Targeting a fixed conditional power leads to the largest sample size increase if there is no treatment effect which is undesirable.</li>
<li>In contrast, the CPZ design increases sample size only if the interim Z-score is “promising”. The corresponding increase in the expected sample size is small if there is no treatment effect or if the treatment effect is large.</li>
<li>The CPZ design is a reasonable compromise between the two extreme fixed designs and has a power of approximately 80% for the smallest effect size of interest (<img src="https://latex.codecogs.com/png.latex?%5Cdelta%20=%2010%5C%25">).</li>
<li>Caveat: This is just a toy example and the design could be refined further (e.g., by exploring other SSR rules, changing the timing of the interim, or adding the possibility for a futility stop) and should also be compared to group sequential trial designs.</li>
</ul>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Rates</category>
  <category>Sample size</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_sample_size_reassessment_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_20.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>An Example to Illustrate Boundary Re-Calculations during the Trial with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_boundary_update_example/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>Group sequential designs based on <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending functions protect the Type I error exactly even if the pre-planned interim schedule is not exactly adhered to. However, this requires re-calculation of the group sequential boundaries at each interim analysis based on actually observed information fractions. Unless deviations from the planned information fractions are substantial, the re-calculated boundaries are quite similar to the pre-planned boundaries and the re-calculation will affect the actual test decision only on rare occasions.</p>
<p>Importantly, it is not allowed that the timing of future interim analyses is “motivated” by results from earlier interim analyses as this could inflate the Type I error rate. Deviations from the planned information fractions should thus only occur due to operational reasons (as it is difficult to hit the pre-planned number of events exactly in a real trial) or due to external evidence.</p>
<p>The general principles for these boundary re-calculation are as follows (see also, Wassmer &amp; Brannath, 2016, p78f):</p>
<ul>
<li>Updates at interim analyses prior to the final analysis:
<ul>
<li>Information fractions are updated according to the actually observed information fraction at the interim analysis relative to the <strong>planned</strong> maximum information.</li>
<li>The planned <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function is then applied to these updated information fractions.</li>
</ul></li>
<li>Updates at the final analysis in case the observed information at the final analysis is larger (“over-running”) or smaller (“under-running”) than the planned maximum information:
<ul>
<li>Information fractions are updated according to the actually observed information fraction at all interim analyses relative to the <strong>observed</strong> maximum information. <img src="https://latex.codecogs.com/png.latex?%5CRightarrow"> Information fraction at final analysis is re-set to 1 but information fractions for earlier interim analyses are also changed.</li>
<li>The originally planned <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function cannot be applied to these updated information fractions because this would modify the critical boundaries of earlier interim analyses which is clearly not allowed. Instead, one uses the <img src="https://latex.codecogs.com/png.latex?%5Calpha"> that has actually been spent at earlier interim analyses and spends all remaining <img src="https://latex.codecogs.com/png.latex?%5Calpha"> at the final analysis.</li>
</ul></li>
</ul>
<p>This general principle can be implemented via a user-defined <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function and is illustrated for an example trial with a survival endpoint below. We provide two solutions to the problem: the first is a way how existing tools in <a href="https://cran.r-project.org/package=rpact">rpact</a> can directly be used to solve the problem, the second is an automatic recalculation of the boundaries using a new parameter set (<code>maxInformation</code> and <code>informationEpsilon</code>) which is available in the <code>getAnalysisResults()</code> function since <a href="https://cran.r-project.org/package=rpact">rpact</a> version 3.1. This solution is described in Section&nbsp;7 at the end of this document.</p>
<p><strong>First, load the rpact package </strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.1 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="original-trial-design" class="level1">
<h1>Original trial design</h1>
<p>The original trial design for this example is based on a standard O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function with planned efficacy interim analyses after 50% and 75% of information as specified below.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Initial design</span></span>
<span id="cb3-2">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb3-8">)</span>
<span id="cb3-9"></span>
<span id="cb3-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Initial sample size calculation</span></span>
<span id="cb3-11">sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb3-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb3-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb3-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb3-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb3-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb3-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb3-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>,</span>
<span id="cb3-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb3-21">)</span>
<span id="cb3-22"></span>
<span id="cb3-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summarize design</span></span>
<span id="cb3-24">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0015</td>
<td>0.0096</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0015</td>
<td>0.0092</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.963</td>
<td>2.359</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.653</td>
<td>0.758</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.1680</td>
<td>0.5400</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>193.4</td>
<td>290.1</td>
<td>386.8</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>318.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>39.08</td>
<td>52.71</td>
<td>69.11</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>57.96</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0015</td>
<td>0.0081</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.1680</td>
<td>0.3720</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="boundary-and-power-update-at-the-first-interim-analysis" class="level1">
<h1>Boundary and power update at the first interim analysis</h1>
<p>Assume that the first interim was conducted after 205 rather than the planned 194 events.</p>
<p>The updated design is calculated as per the code below. Note that for the calculation of boundary values on the treatment effect scale, we use the function <code>getPowerSurvival()</code> with the updated design rather than the function <code>getSampleSizeSurvival()</code> as we are only updating the boundary, not the sample size or the maximum number of events.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Update design using observed information fraction at first interim.</span></span>
<span id="cb4-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Information fraction of later interim analyses is not changed.</span></span>
<span id="cb4-3">designUpdate1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb4-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb4-9">)</span>
<span id="cb4-10"></span>
<span id="cb4-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Recalculate the power to get boundary values on the effect scale</span></span>
<span id="cb4-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (Use original maxNumberOfEvents and sample size)</span></span>
<span id="cb4-13">powerUpdate1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb4-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designUpdate1,</span>
<span id="cb4-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb4-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb4-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb4-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb4-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb4-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb4-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>,</span>
<span id="cb4-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, </span>
<span id="cb4-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, </span>
<span id="cb4-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb4-25">)</span></code></pre></div></div>
</div>
<p>The updated information rates and corresponding boundaries as per the output above are summarized as follows:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, maximum number of events = 387, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>53%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0096</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.366</td>
<td>2.015</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.670</td>
<td>0.758</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2097</td>
<td>0.5391</td>
<td>0.8001</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>205.0</td>
<td>290.2</td>
<td>387.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>317.0</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>40.60</td>
<td>52.73</td>
<td>69.14</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>57.75</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0021</td>
<td>0.0076</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2097</td>
<td>0.3294</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="boundary-and-power-update-at-the-second-interim-analysis" class="level1">
<h1>Boundary and power update at the second interim analysis</h1>
<p>Assume that the efficacy boundary was not crossed at the first interim analysis and the trial continued to the second interim analysis which was conducted after 285 rather than the planned 291 events. The updated design is calculated in the same way as for the first interim analysis as per the code below. The idea is to use the cumulative <img src="https://latex.codecogs.com/png.latex?%5Calpha"> spent from the first stage and an updated cumulative <img src="https://latex.codecogs.com/png.latex?%5Calpha"> that is spent for the second stage. For the second stage, this can be obtained with the original O’Brien &amp; Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Update design using observed information fraction at first and second interim.</span></span>
<span id="cb5-2">designUpdate2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">285</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb5-8">)</span>
<span id="cb5-9"></span>
<span id="cb5-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Recalculate power to get boundary values on effect scale</span></span>
<span id="cb5-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (Use original maxNumberOfEvents and sample size)</span></span>
<span id="cb5-12">powerUpdate2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb5-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designUpdate2,</span>
<span id="cb5-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb5-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb5-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb5-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb5-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb5-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb5-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>,</span>
<span id="cb5-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, </span>
<span id="cb5-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, </span>
<span id="cb5-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb5-24">)</span>
<span id="cb5-25">powerUpdate2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, maximum number of events = 387, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>53%</td>
<td>73.6%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0222</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.011</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.670</td>
<td>0.753</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2097</td>
<td>0.5198</td>
<td>0.8004</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>205.0</td>
<td>285.0</td>
<td>387.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>317.2</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>40.60</td>
<td>51.93</td>
<td>69.14</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>57.82</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0021</td>
<td>0.0069</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2097</td>
<td>0.3101</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="sec-update" class="level1">
<h1>Boundary and power update at the final analysis</h1>
<p>Assume that the efficacy boundary was also not crossed at the second interim analysis and the trial continued to the final analysis which was conducted after 393 rather than the planned 387 events. The updated design is calculated as per the code below. The idea here is to use the cumulative <img src="https://latex.codecogs.com/png.latex?%5Calpha"> spent from the first <em>and</em> the second stage and calculate the final <img src="https://latex.codecogs.com/png.latex?%5Calpha"> that is spent for the last stage. An updated correlation has to be used and the original O’Brien &amp; Fleming <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function cannot be used anymore. Instead, the <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function needs to be user defined as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Update boundary with information fractions as per actually observed event numbers</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># !! use user-defined alpha-spending and spend alpha according to actual alpha spent</span></span>
<span id="cb6-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    according to the second interim analysis</span></span>
<span id="cb6-4">designUpdate3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">285</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">393</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">393</span>,</span>
<span id="cb6-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asUser"</span>,</span>
<span id="cb6-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">userAlphaSpending =</span> designUpdate2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alphaSpent</span>
<span id="cb6-11">)</span>
<span id="cb6-12"></span>
<span id="cb6-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Recalculate power to get boundary values on effect scale</span></span>
<span id="cb6-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (Use planned sample size and **observed** maxNumberOfEvents)</span></span>
<span id="cb6-15">powerUpdate3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb6-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designUpdate3,</span>
<span id="cb6-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb6-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb6-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb6-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb6-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb6-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb6-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>,</span>
<span id="cb6-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, </span>
<span id="cb6-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">393</span>, </span>
<span id="cb6-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb6-27">)</span>
<span id="cb6-28">powerUpdate3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, maximum number of events = 393, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>52.2%</td>
<td>72.5%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.670</td>
<td>0.753</td>
<td>0.816</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2097</td>
<td>0.5198</td>
<td>0.8060</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>205.0</td>
<td>285.0</td>
<td>393.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>320.1</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>40.60</td>
<td>51.93</td>
<td>70.28</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>58.37</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0021</td>
<td>0.0069</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2097</td>
<td>0.3101</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="overview-of-all-updates" class="level1">
<h1>Overview of all updates</h1>
<p>For easier comparison, all discussed boundary updates and power calculations are summarized more conveniently below. Note that each update only affects boundaries for the current or later analyses, i.e., earlier boundaries are never retrospectively modified.</p>
<section id="original-design" class="level2">
<h2 class="anchored" data-anchor-id="original-design">Original design</h2>
<div class="cell">
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0015</td>
<td>0.0096</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0015</td>
<td>0.0092</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.963</td>
<td>2.359</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.653</td>
<td>0.758</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.1680</td>
<td>0.5400</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>193.4</td>
<td>290.1</td>
<td>386.8</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>318.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>39.08</td>
<td>52.71</td>
<td>69.11</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>57.96</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0015</td>
<td>0.0081</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.1680</td>
<td>0.3720</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="updated-boundaries-and-power-at-the-first-second-and-final-analysis" class="level2">
<h2 class="anchored" data-anchor-id="updated-boundaries-and-power-at-the-first-second-and-final-analysis">Updated boundaries and power at the first, second, and final analysis</h2>
<div class="cell">
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.75, control lambda(2) = 0.012, maximum number of subjects = 1000, maximum number of events = 393, accrual time = 33.333, accrual intensity = 30, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>52.2%</td>
<td>72.5%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.670</td>
<td>0.753</td>
<td>0.816</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2097</td>
<td>0.5198</td>
<td>0.8060</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1000.0</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1000.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>205.0</td>
<td>285.0</td>
<td>393.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>320.1</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>40.60</td>
<td>51.93</td>
<td>70.28</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>58.37</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0021</td>
<td>0.0069</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2097</td>
<td>0.3101</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
</section>
<section id="sec-automatic" class="level1">
<h1>Automatic boundary recalculation at analysis stage</h1>
<p>We now show how a concrete data analysis with an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function design can be performed by specifying the parameter <code>maxInformation</code> in the <code>getAnalysisResults()</code> function. As above, we start with an initial design, which in this situation is arbitrary and can be considered as a dummy design. Note that neither the number of stages nor the information rates need to be fixed.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Dummy design</span></span>
<span id="cb7-2">dummy <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb7-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb7-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb7-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>)</span></code></pre></div></div>
</div>
<p>The survival design was planned with a maximum of 387 events, the first interim took place after the observation of 205 events, the second after 285 events. Specifying the parameter <code>maxInformation</code> makes it now extremly easy to perform the analysis for the first and the second stage. Assume that we have observed log-rank statistics 1.87 and 2.19 at the first and the second interim, respectively. This observation together with the event numbers is defined in the <code>getDataset()</code> function through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">dataSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">285</span>),</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.87</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.19</span>)</span>
<span id="cb8-4">)</span></code></pre></div></div>
</div>
<p>Note that it is important to define <strong>cumulative</strong>Events and <strong>cumulative</strong>LogRanks because otherwise the stage-wise events and logrank statistics should be entered (in the given case, these will be calculated).</p>
<p>We now can enter the planned maximum number of events in the <code>getAnalysisResults()</code> function as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">testResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> dummy,</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataSurvival,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxInformation =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span></span>
<span id="cb9-5">)</span></code></pre></div></div>
</div>
<p>This provides the summary:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>53%</td>
<td>73.6%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0222</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.011</td>
</tr>
<tr class="odd">
<td>Cumulative effect size</td>
<td>1.299</td>
<td>1.296</td>
<td></td>
</tr>
<tr class="even">
<td>Overall test statistic</td>
<td>1.870</td>
<td>2.190</td>
<td></td>
</tr>
<tr class="odd">
<td>Overall p-value</td>
<td>0.0307</td>
<td>0.0143</td>
<td></td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.1927</td>
<td>0.3987</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval</td>
<td>[0.870; 1.938]</td>
<td>[0.976; 1.721]</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>0.1159</td>
<td>0.0380</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We see that the boundaries are correctly calculated according to the observed information rates. If there is over-running, i.e., the final analysis was conducted after 393 rather than the planned 387 events, first define the observed dataset</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">dataSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">285</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">393</span>),</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.87</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.19</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.33</span>)</span>
<span id="cb10-4">)</span></code></pre></div></div>
</div>
<p>and then use the <code>getAnalysisResults()</code> function as before:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">testResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> dummy,</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataSurvival,</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxInformation =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span></span>
<span id="cb11-5">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Over-running: observed information 393 at stage 3 is larger than the maximum planned information 387; information rates will be recalculated</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Use alpha values that have actually been spent at earlier stages and spend all remaining alpha at the final analysis, i.e., userAlphaSpending = (0.002073, 0.009005, 0.025) </code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: Repeated p-values not available for automatic recalculation of
boundaries at final stage</code></pre>
</div>
</div>
<p>The messages describe the way of how the critical value for the last stage using the recalculated information rates (leaving the critical values for the first two stages unchanged) was calculated. This way was described in Section&nbsp;5. The last warning indicates that for this case, since there is no “natural” family of decision boundaries, repeated p-values for the final stage of the trial are not calculated.</p>
<p>The summary shows that indeed the recalculated boundary for the last stage and the already used boundaries for the first two stages are used for decision making:</p>
<div class="cell">
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>52.2%</td>
<td>72.5%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Cumulative effect size</td>
<td>1.299</td>
<td>1.296</td>
<td>1.265</td>
</tr>
<tr class="even">
<td>Overall test statistic</td>
<td>1.870</td>
<td>2.190</td>
<td>2.330</td>
</tr>
<tr class="odd">
<td>Overall p-value</td>
<td>0.0307</td>
<td>0.0143</td>
<td>0.0099</td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.1910</td>
<td>0.3883</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval</td>
<td>[0.870; 1.938]</td>
<td>[0.976; 1.721]</td>
<td>[1.032; 1.550]</td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>0.1159</td>
<td>0.0380</td>
<td></td>
</tr>
<tr class="even">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0148</td>
</tr>
<tr class="odd">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>[1.023; 1.534]</td>
</tr>
<tr class="even">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>1.255</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We can also consider the case of under-running. Under-running could occur, for example, if it was decided <strong>before conducting the analysis</strong> that the final analysis may also be performed with, say, up to 3 fewer observed events than the considered maximum number of events. In other words, this means that the final stage is reached if 384 or more of the 387 pre-planned events were observed. Inserting the parameter <code>informationEpsilon</code> in the <code>getAnalysisResults()</code> function can be used for this. There are two ways for defining this parameter. You can do it</p>
<ol type="1">
<li>in an absolute sense: the parameter <code>informationEpsilon</code> specifies the number of events to be allowed to deviate from the maximum number of events. This is achieved by specifying a positive integer number for <code>informationEpsilon</code>.</li>
<li>in a relative sense: if a number x &lt; 1 for <code>informationEpsilon</code> is specified, the stage is considered as the final stage if x*100% of <code>maxInformation</code> is observed.</li>
</ol>
<p>Both ways yield a correct calculation of the critical value to be used for the final stage. Suppose, for example, 385 events were observed and <code>informationEpsilon</code> was set equal to 3. Then, since <code>387 - 385 &lt;= 3</code>, this is an under-running case and the critical value at the final stage is provided in the summary:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">dataSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">205</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">285</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">385</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulativeLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.87</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.19</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.21</span>)</span>
<span id="cb15-4">)</span>
<span id="cb15-5">testResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> dummy,</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataSurvival,</span>
<span id="cb15-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxInformation =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>,</span>
<span id="cb15-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationEpsilon =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb15-10">)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>53.2%</td>
<td>74%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0090</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0084</td>
<td>0.0222</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.867</td>
<td>2.393</td>
<td>2.010</td>
</tr>
<tr class="odd">
<td>Cumulative effect size</td>
<td>1.299</td>
<td>1.296</td>
<td>1.253</td>
</tr>
<tr class="even">
<td>Overall test statistic</td>
<td>1.870</td>
<td>2.190</td>
<td>2.210</td>
</tr>
<tr class="odd">
<td>Overall p-value</td>
<td>0.0307</td>
<td>0.0143</td>
<td>0.0136</td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject</td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.1932</td>
<td>0.4023</td>
<td></td>
</tr>
<tr class="even">
<td>95% repeated confidence interval</td>
<td>[0.870; 1.938]</td>
<td>[0.976; 1.721]</td>
<td>[1.021; 1.538]</td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>0.1159</td>
<td>0.0380</td>
<td></td>
</tr>
<tr class="even">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0175</td>
</tr>
<tr class="odd">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>[1.016; 1.524]</td>
</tr>
<tr class="even">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>1.246</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>We see that again the recalculated boundary for the last stage and the already used boundaries for the first two stages are used for decision making.</p>
<p>In summary, <code>maxInformation</code> in the <code>getAnalysisResults()</code> function can be used to perform an <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function approach in practice. Also, if at the analysis stage over-running or (pre-defined) under-running takes place, the use of the parameters <code>maxInformation</code> and <code>informationEpsilon</code> in the function provides an easy way to perform a correct analysis with the specified design.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_boundary_update_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_07.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Comparing Sample Size and Power Calculation Results for a Group Sequential Trial with a Survival Endpoint: rpact vs. gsDesign</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_vs_gsdesign_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="the-design" class="level1">
<h1>The design</h1>
<ul>
<li>1:1 randomized</li>
<li>Two-sided log-rank test; 80% power at 5% significance level (or one-sided at 2.5%)</li>
<li>Target HR for primary endpoint (PFS) is 0.75</li>
<li>PFS in the control arm follows a piece-wise exponential distribution, with the hazard rate h(t) estimated using historical controls as follows:
<ul>
<li>h(t) = 0.025 for t between 0 and 6 months;</li>
<li>h(t) = 0.04 for t between 6 and 9 months;</li>
<li>h(t) = 0.015 for t between 9 and 15 months;</li>
<li>h(t) = 0.01 for t between 15 and 21 months;</li>
<li>h(t) = 0.007 for t beyond 21 months.</li>
</ul></li>
<li>An annual dropout probability of 20%</li>
<li>Interim analyses at 33% and 70% of total information</li>
<li>Alpha-spending version of O’Brien-Fleming boundary for efficacy</li>
<li>No futility interim</li>
<li>1405 subjects recruited in total</li>
<li>Staggered recruitment:
<ul>
<li>15 pt/month during first 12 months;</li>
<li>subsequently, increase of # of sites and ramp up of recruitment by +6 pt/month each month until a maximum of 45 pt/month</li>
</ul></li>
</ul>
</section>
<section id="calculation-with-gsdesign" class="level1">
<h1>Calculation with gsDesign</h1>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load the package `gsDesign`</span></span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gsDesign)</span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warn =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># avoid warnings generated by gsDesign</span></span>
<span id="cb1-4">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gsSurv</span>(</span>
<span id="cb1-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">k =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">test.type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb1-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">timing =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sfu =</span> sfLDOF, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># boundary</span></span>
<span id="cb1-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hr =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb1-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambdaC =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># piecewise lambdas</span></span>
<span id="cb1-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># piecewise survival times</span></span>
<span id="cb1-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eta =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dropout</span></span>
<span id="cb1-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gamma =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># recruitment, pt no</span></span>
<span id="cb1-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1405</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># recruitment duration</span></span>
<span id="cb1-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minfup =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span></span>
<span id="cb1-14">)</span>
<span id="cb1-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Group sequential design (method=LachinFoulkes; k=3 analyses; One-sided (efficacy only))
HR=0.750 vs HR0=1.000 | alpha=0.025 (sided=1) | power=80.0%
N=1405.0 subjects | D=385.9 events | T=50.8 study duration | accrual=40.6 Accrual duration | minfup=10.2 minimum follow-up | ratio=1 randomization ratio (experimental/control)

Spending functions:
  Efficacy bounds derived using a Lan-DeMets O'Brien-Fleming approximation spending function (no parameters).

Analysis summary:
Method: LachinFoulkes 
    Analysis               Value Efficacy
   IA 1: 33%                   Z   3.7307
      N: 786         p (1-sided)   0.0001
 Events: 128        ~HR at bound   0.5162
   Month: 27    P(Cross) if HR=1   0.0001
             P(Cross) if HR=0.75   0.0175
   IA 2: 70%                   Z   2.4396
     N: 1320         p (1-sided)   0.0074
 Events: 271        ~HR at bound   0.7431
   Month: 39    P(Cross) if HR=1   0.0074
             P(Cross) if HR=0.75   0.4691
       Final                   Z   2.0001
     N: 1406         p (1-sided)   0.0227
 Events: 386        ~HR at bound   0.8158
   Month: 51    P(Cross) if HR=1   0.0250
             P(Cross) if HR=0.75   0.8000

Key inputs (names preserved):
                               desc    item                              value
                    Accrual rate(s)   gamma             15, 21, 27 ... (len=6)
           Accrual rate duration(s)       R               12, 1, 1 ... (len=6)
             Control hazard rate(s) lambdaC     0.025, 0.04, 0.015 ... (len=5)
            Control dropout rate(s)     eta 0.0186, 0.0186, 0.0186 ... (len=5)
       Experimental dropout rate(s)    etaE 0.0186, 0.0186, 0.0186 ... (len=5)
 Event and dropout rate duration(s)       S                6, 3, 6 ... (len=4)
                          input
         15, 21, 27 ... (len=6)
           12, 1, 1 ... (len=6)
 0.025, 0.04, 0.015 ... (len=5)
                         0.0186
                           etaE
            6, 3, 6 ... (len=4)</code></pre>
</div>
</div>
</section>
<section id="calculation-with-rpact" class="level1">
<h1>Calculation with rpact</h1>
<section id="design" class="level2">
<h2 class="anchored" data-anchor-id="design">Design</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load the package `rpact`</span></span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb3-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb4-7">)</span>
<span id="cb4-8">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming type alpha spending design, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.015, ASN H1 0.8656, ASN H01 0.9826, ASN H0 1.0127.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0074</td>
<td>0.0227</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.731</td>
<td>2.440</td>
<td>2.000</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0175</td>
<td>0.4691</td>
<td>0.8000</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="sample-size-timing-of-interim-analyses" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-timing-of-interim-analyses">Sample size / timing of interim analyses</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb5-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb5-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb5-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb5-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb5-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb5-7">)</span>
<span id="cb5-8"></span>
<span id="cb5-9">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb5-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0  - &lt;12"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb5-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12 - &lt;13"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>,</span>
<span id="cb5-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13 - &lt;14"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>,</span>
<span id="cb5-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>,</span>
<span id="cb5-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;16"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>,</span>
<span id="cb5-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 16"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span></span>
<span id="cb5-16">)</span>
<span id="cb5-17"></span>
<span id="cb5-18">y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb5-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design, </span>
<span id="cb5-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>,</span>
<span id="cb5-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb5-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb5-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb5-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb5-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb5-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime,</span>
<span id="cb5-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb5-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb5-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n.I[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>],</span>
<span id="cb5-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1405</span></span>
<span id="cb5-32">)</span>
<span id="cb5-33">y <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.75, piecewise survival distribution, piecewise survival time = c(0, 6, 9, 15, 21), control lambda(2) = c(0.025, 0.04, 0.015, 0.01, 0.007), maximum number of subjects = 1405, maximum number of events = 386, accrual time = c(12, 13, 14, 15, 16, 40.556), accrual intensity = c(15, 21, 27, 33, 39, 45), dropout rate(1) = 0.2, dropout rate(2) = 0.2, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33%</td>
<td>70%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0074</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0074</td>
<td>0.0227</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.731</td>
<td>2.440</td>
<td>2.000</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.516</td>
<td>0.743</td>
<td>0.816</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0175</td>
<td>0.4702</td>
<td>0.8009</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>785.4</td>
<td>1318.1</td>
<td>1405.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>1354.8</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>127.3</td>
<td>270.1</td>
<td>385.9</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>328.9</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>26.79</td>
<td>38.62</td>
<td>50.80</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>44.87</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>&lt;0.0001</td>
<td>0.0073</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0175</td>
<td>0.4526</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
</section>
<section id="comparison-analysis-time-of-rpact-vs.-gsdesign" class="level1">
<h1>Comparison: Analysis time of rpact vs.&nbsp;gsDesign</h1>
<p>Absolute differences:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">timeDiff <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%.5f"</span>, (x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>T <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime)))</span>
<span id="cb6-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(timeDiff) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage 1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage 2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage 3"</span>)</span>
<span id="cb6-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">colnames</span>(timeDiff) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Difference analysis time"</span></span>
<span id="cb6-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(timeDiff)</span></code></pre></div></div>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;"></th>
<th style="text-align: left;">Difference analysis time</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Stage 1</td>
<td style="text-align: left;">-0.00000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Stage 2</td>
<td style="text-align: left;">0.00004</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Stage 3</td>
<td style="text-align: left;">-0.00011</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="remark" class="level1">
<h1>Remark</h1>
<p>Obviously, there is a difference in the calculation of the necessary number of events which are, in <a href="https://cran.r-project.org/package=rpact">rpact</a>, calculated as</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qnorm</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb7-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb7-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb7-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb7-5">    ))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>inflationFactor</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 385.0479</code></pre>
</div>
</div>
<p>which is slightly different to the maximum number of events in <a href="https://cran.r-project.org/package=gsDesign">gsDesign</a> which is</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>n.I[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 385.881</code></pre>
</div>
</div>
<p>Therefore, running</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design, </span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>,</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime,</span>
<span id="cb11-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb11-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb11-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1405</span></span>
<span id="cb11-13">)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 26.76183
[2,] 38.57834
[3,] 50.63114</code></pre>
</div>
</div>
<p>is not exactly equal to <code>getPowerSurvival()</code> from above. This, however, has definitely no consequences in practice but explains the slight differences in <a href="https://cran.r-project.org/package=rpact">rpact</a> and <a href="https://cran.r-project.org/package=gsDesign">gsDesign</a>.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_vs_gsdesign_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_26.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Designing Group Sequential Trials with Two Groups and a Survival Endpoint with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_survival_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>The examples in this document are not intended to replace the official <a href="https://cran.r-project.org/package=rpact">rpact</a> documentation and help pages but rather to supplement them. They also only cover a selection of all <a href="https://cran.r-project.org/package=rpact">rpact</a> features.</p>
<p>General convention: In <a href="https://cran.r-project.org/package=rpact">rpact</a>, arguments containing the <strong>index “2”</strong> always refer to the <strong>control group</strong>, <strong>“1”</strong> refer to the <strong>intervention group</strong>, and <strong>treatment effects compare treatment versus control</strong>.</p>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="overview-of-relevant-rpact-functions" class="level1">
<h1>Overview of relevant rpact functions</h1>
<p>The sample size calculation for a group sequential trial with a survival endpoints is performed in <strong>two steps</strong>:</p>
<ol type="1">
<li><p><strong>Define the (abstract) group sequential design</strong> using the function <code>getDesignGroupSequential()</code>. For details regarding this step, see the R markdown file <a href="https://rpact.com/vignettes/rpact_boundary_examples">Defining group sequential boundaries with rpact</a>. This step can be omitted if the trial has no interim analyses.</p></li>
<li><p><strong>Calculate sample size</strong> for the survival endpoint by feeding the abstract design into the function <code>getSampleSizeSurvival()</code>. This step is described in detail below.</p></li>
</ol>
<p>Other relevant <a href="https://cran.r-project.org/package=rpact">rpact</a> functions for survival are:</p>
<ul>
<li><code>getPowerSurvival()</code>: This function is the analogue to <code>getSampleSizeSurvival()</code> for the calculation of power rather than the sample size.</li>
<li><code>getEventProbabilities()</code>: Calculates the probability of an event depending on the time and type of accrual, follow-up time, and survival distribution. This is useful for aligning interim analyses for different time-to-event endpoints.</li>
<li><code>getSimulationSurvival()</code>: This function simulates group sequential trials. For example, it allows to assess the power of trials with delayed treatment effects or to assess the data-dependent variability of the timing of interim analyses even if the protocol assumptions are perfectly fulfilled. It also allows to simulate hypothetical datasets for trials stopped early.</li>
</ul>
<p>This document describes all functions mentioned above except for trial simulation (<code>getSimulationSurvival()</code>) which is described in the document <a href="https://vignettes.rpact.com/html/rpact_survival_examples.html">Simulation-based design of group sequential trials with a survival endpoint with rpact</a>.</p>
<p>However, before describing the functions themselves, the document describes how survival functions, drop-out, and accrual can be specified in <a href="https://cran.r-project.org/package=rpact">rpact</a> which is required for all of these functions.</p>
</section>
<section id="specifying-survival-distributions-in-rpact" class="level1">
<h1>Specifying survival distributions in rpact</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> allows to specify survival distributions with exponential, piecewise exponential, and Weibull distributions. Exponential and piecewise exponential distributions are described below.</p>
<p>Weibull distributions are specified in the same way as exponential distributions except that an additional scale parameter <code>kappa</code> needs to be provided which is 1 for the exponential distribution. Note that the parameters <code>shape</code> and <code>scale</code> in the standard R functions for the Weibull distribution in the stats-library (such as <code>dweibull</code>) are equivalent to <code>kappa</code> and 1/<code>lambda</code>, respectively, in <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
<section id="exponential-survival-distributions" class="level2">
<h2 class="anchored" data-anchor-id="exponential-survival-distributions">Exponential survival distributions</h2>
<section id="event-probability-at-a-specific-time-point-known" class="level3">
<h3 class="anchored" data-anchor-id="event-probability-at-a-specific-time-point-known">Event probability at a specific time point known</h3>
<ul>
<li>The time point is given by argument <code>eventTime</code>.</li>
<li>The probability of an event (i.e., 1 minus survival function) in the control group is given by argument <code>pi2</code>.</li>
<li>The probability of an event in the intervention arm can either be provided explicitly through argument <code>pi1</code> or, alternatively, implicitly by specifying the target hazard ratio <code>hazardRatio</code>.</li>
</ul>
<p><strong>Example:</strong> If the intervention is expected to improve survival at 24 months from 70% to 80%, this would be expressed through arguments <code>eventTime = 24, pi2 = 0.3, pi1 = 0.2</code>.</p>
</section>
<section id="exponential-parameter-lambda-known" class="level3">
<h3 class="anchored" data-anchor-id="exponential-parameter-lambda-known">Exponential parameter <img src="https://latex.codecogs.com/png.latex?%5Clambda"> known</h3>
<ul>
<li>The constant hazard function in the control arm can be provided as argument <code>lambda2</code>.</li>
<li>The hazard in the intervention arm can either be provided explicitly through the argument <code>lambda1</code> or, alternatively, implicitly by specifying the target hazard ratio <code>hazardRatio</code>.</li>
</ul>
</section>
<section id="median-survival-known" class="level3">
<h3 class="anchored" data-anchor-id="median-survival-known">Median survival known</h3>
<p>Medians cannot be specified directly. However, one can exploit that the hazard rate <img src="https://latex.codecogs.com/png.latex?%5Clambda"> of the exponential distribution is equal to <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20%5Clog(2)/%5Ctext%7Bmedian%7D">.</p>
<p><strong>Example:</strong> If the intervention is expected to improve the median survival from 60 to 75 months, this would be expressed through the arguments <code>lambda2 = log(2)/60, lambda1 = log(2)/75</code>. Alternatively, it could be specified via <code>lambda2 = log(2)/60, hazardRatio = 0.8</code> (as the hazard ratio is 60/75 = 0.8).</p>
</section>
</section>
<section id="weibull" class="level2">
<h2 class="anchored" data-anchor-id="weibull">Weibull</h2>
<p>Weibull distributions are specified in the same way as exponential distributions except that an additional scale parameter <code>kappa</code> needs to be provided which is 1 for the exponential distribution.</p>
</section>
<section id="piecewise-exponential-survival" class="level2">
<h2 class="anchored" data-anchor-id="piecewise-exponential-survival">Piecewise exponential survival</h2>
<section id="piecewise-constant-hazard-rate-lambda-in-each-interval-known" class="level3">
<h3 class="anchored" data-anchor-id="piecewise-constant-hazard-rate-lambda-in-each-interval-known">Piecewise constant hazard rate <img src="https://latex.codecogs.com/png.latex?%5Clambda"> in each interval known</h3>
<p><strong>Example:</strong> If the hazard function in the control arm is assumed to be 0.03 (events/time-unit of follow-up) for the first 6 months, 0.06 for months 6-12, and 0.02 from month 12 onwards, this can be specified using the argument <code>piecewiseSurvivalTime</code> as follows:</p>
<pre><code>piecewiseSurvivalTime = list(
    "0 - &lt;6" = 0.03,
    "6 - &lt;12" = 0.06,
    "&gt;= 12" = 0.02)</code></pre>
<p>Alternatively, the same distribution can be specified by giving the start times of each interval as argument <code>piecewiseSurvivalTime</code> and the actual hazard rate in that interval as argument <code>lambda2</code>. I.e., the relevant arguments for this example would be:</p>
<pre><code>piecewiseSurvivalTime = c(0,6,12), lambda2 = c(0.03,0.06,0.02)</code></pre>
<p>For the intervention arm, one could either explicitly specify the hazard rate in the same time intervals through the argument <code>lambda1</code> or, more conveniently, specify the survival function in the intervention arm indirectly via the target hazard ratio (argument <code>hazardRatio</code>).</p>
<p>Note: The sample size calculation functions discussed in this document <strong>assume that the proportional hazards assumption holds</strong>, i.e., that <code>lambda1</code> and <code>lambda2</code> are proportional if both are provided. Otherwise, the function call to <code>getSampleSizeSurvival()</code> gives an error. For situations with non-proportional hazards, please see the separate document which discusses the simulation tool using the function <code>getSimulationSurvival()</code>.</p>
</section>
<section id="survival-function-at-different-time-points-known" class="level3">
<h3 class="anchored" data-anchor-id="survival-function-at-different-time-points-known">Survival function at different time points known</h3>
<p>Piecewise exponential distributions are useful to <strong>approximate survival functions</strong>. In principle, it is possible to approximate any distribution function well with a piecewise exponential distribution if suitably narrow intervals are chosen.</p>
<p>Assume that the survival function is <img src="https://latex.codecogs.com/png.latex?S(t_1)"> at time <img src="https://latex.codecogs.com/png.latex?t_1"> and <img src="https://latex.codecogs.com/png.latex?S(t_2)"> at time <img src="https://latex.codecogs.com/png.latex?t_2"> with <img src="https://latex.codecogs.com/png.latex?t_2%3Et_1"> and that the hazard rate in the interval <img src="https://latex.codecogs.com/png.latex?%5Bt_1,t_2%5D"> is constant. Then, the hazard rate in the interval can be derived as <img src="https://latex.codecogs.com/png.latex?(%5Clog(S(t_1))-%5Clog(S(t_2)))/(t_2-t_1)">.</p>
<p><strong>Example:</strong> Assume that it is known that the survival function is 1, 0.9, 0.7, and 0.5 at months 0, 12, 24, 48 in the control arm. Then, an interpolating piecewise exponential distribution can be derived as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">t <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># time points at which survival function is known</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (must include 0)</span></span>
<span id="cb5-3">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Survival function at timepoints t</span></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># derive hazard in each intervals per the formula above</span></span>
<span id="cb5-5">lambda <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">diff</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(S)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">diff</span>(t)</span>
<span id="cb5-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define parameters for piecewise exponential distribution in the control arm</span></span>
<span id="cb5-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interpolating the targeted survival values</span></span>
<span id="cb5-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (code for lambda1 below assumes that the hazard afer month 48 is</span></span>
<span id="cb5-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#  identical to the hazard in interval [24,48])</span></span>
<span id="cb5-10">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> t</span>
<span id="cb5-11">lambda2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(lambda, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span>(lambda, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb5-12">lambda2 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># print hazard rates</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.008780043 0.020942869 0.014019677 0.014019677</code></pre>
</div>
</div>
</section>
<section id="appendix-random-numbers-cumulative-distribution-and-quantiles-for-the-piecewise-exponential-distribution" class="level3 unnumbered">
<h3 class="unnumbered anchored" data-anchor-id="appendix-random-numbers-cumulative-distribution-and-quantiles-for-the-piecewise-exponential-distribution">Appendix: Random numbers, cumulative distribution, and quantiles for the piecewise exponential distribution</h3>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> also provides general functionality for the piecewise exponential distribution, see <code>?getPiecewiseExponentialDistribution</code> for details. Below is some example code which shows that the derivation of the piecewise exponential distribution in the previous example is correct.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plot the piecewise exponential survival distribution from the example above</span></span>
<span id="cb7-2">tp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">72</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb7-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(tp,</span>
<span id="cb7-4">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPiecewiseExponentialDistribution</span>(</span>
<span id="cb7-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> tp,</span>
<span id="cb7-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb7-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseLambda =</span> lambda2</span>
<span id="cb7-8">    ),</span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, </span>
<span id="cb7-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time (months)"</span>, </span>
<span id="cb7-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Survival function S(t)"</span>,</span>
<span id="cb7-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb7-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb7-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb7-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Piecewise exponential distribution for the example"</span></span>
<span id="cb7-16">)</span>
<span id="cb7-17"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axis</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">at =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">72</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>))</span>
<span id="cb7-18"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axis</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">at =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>))</span>
<span id="cb7-19"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">v =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">72</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">h =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gray</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate median survival for the example (which should give 48 months here)</span></span>
<span id="cb8-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPiecewiseExponentialQuantile</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseLambda =</span> lambda2</span>
<span id="cb8-5">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 48</code></pre>
</div>
</div>
</section>
</section>
</section>
<section id="specifying-dropout-in-rpact" class="level1">
<h1>Specifying dropout in rpact</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> models dropout with an independent exponentially distributed variable. Dropout is specified by giving the probability of dropout at a specific time point. For example, an annual (12-monthly) dropout probability of 5% in both treatment arms can be specified through the following arguments:</p>
<pre><code>dropoutRate1 = 0.05, dropoutRate2 = 0.05, dropoutTime = 12</code></pre>
</section>
<section id="specifying-accrual-in-rpact" class="level1">
<h1>Specifying accrual in rpact</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> allows to specify arbitrarily complex recruitment scenarios. Some examples are provided below.</p>
<section id="sec-accrualDurationKnown" class="level2">
<h2 class="anchored" data-anchor-id="sec-accrualDurationKnown">Absolute accrual intensity and accrual duration known</h2>
<p><strong>Example 1:</strong> A <strong>constant accrual intensity</strong> of 24 subjects/months over 30 months (i.e., a maximum sample size of 24*30 = 720 subjects) can be specified through the arguments below:</p>
<pre><code>accrualTime = c(0, 30), accrualIntensity = 24</code></pre>
<p><strong>Example 2:</strong> A <strong>flexible accrual intensity</strong> of 20 subjects/months in the first 6 months, 25 subjects/months for months 6-12, and 30 subjects per month for months 12-24 can be specified through either of the two equivalent options below:</p>
<p>Option 1: List-based definition:</p>
<pre><code>accrualTime = list(
    "0 - &lt;6" = 20,
    "6 - &lt;12" = 25,
    "12- &lt;24" = 30)</code></pre>
<p>Option 2: Vector-based definition (note that the length of the <code>accrualTime</code> vector is 1 larger than the length of the <code>accrualIntensity</code> as the end time of the accrual period is also included):</p>
<pre><code>accrualTime = c(0, 6, 12, 24), accrualIntensity = c(20, 25, 30)</code></pre>
</section>
<section id="absolute-accrual-intensity-known-accrual-duration-unknown" class="level2">
<h2 class="anchored" data-anchor-id="absolute-accrual-intensity-known-accrual-duration-unknown">Absolute accrual intensity known, accrual duration unknown</h2>
<p><strong>Example 1:</strong> A <strong>constant accrual intensity</strong> of 24 subjects/months with unspecified end of recruitment is specified through the arguments below:</p>
<pre><code>accrualTime = 0, accrualIntensity = 24 
# Note: accrualTime is the start of accrual which must be explicitly set to 0</code></pre>
<p><strong>Example 2:</strong> A <strong>flexible accrual intensity</strong> of 20 subjects/months in the first 6 months, 25 subjects/months from month 6-12, and 30 subjects thereafter can be specified through either of the two equivalent options below:</p>
<p>Option 1: List-based definition:</p>
<pre><code>accrualTime = list(
    "0 - &lt;6" = 20,
    "6 - &lt;12" = 25,
    "&gt;= 12" = 30)</code></pre>
<p>Option 2: Vector-based definition (note that the length of the <code>accrualTime</code> vector is equal to the length of the accrualIntensity vector as only the start time of the last accrual intensity is provided):</p>
<pre><code>accrualTime = c(0, 6, 12), accrualIntensity = c(20, 25, 30)</code></pre>
</section>
</section>
<section id="sample-size-calculation-for-superiority-trials-without-interim-analyses" class="level1">
<h1>Sample size calculation for superiority trials without interim analyses</h1>
<p>Given the specification of the survival distributions, drop-out and accrual as described above, sample size calculations can be readily performed in <a href="https://cran.r-project.org/package=rpact">rpact</a> using the function <code>getSampleSizeSurvival()</code>. Importantly, in survival trials, the <strong>number of events (and not the sample size) determines the power</strong> of the trial. Hence, the <strong>choice of the sample size</strong> to reach this target number of events <strong>is based on study-specific trade-offs</strong> between the costs per recruited patient, study duration, and desired minimal follow-up duration.</p>
<p>In practice, <strong>a range of sample sizes needs to be explored manually or via suitable graphs to find an optimal trade off</strong>. Given a plausible absolute accrual intensity (usually provided by operations), a simple approach in <a href="https://cran.r-project.org/package=rpact">rpact</a> is to use one or both of the two options below:</p>
<ol type="1">
<li>Perform the calculation by trying multiple maximum sample sizes (argument <code>maxNumberOfSubjects</code>).</li>
<li>It often makes sense to require a minimal follow-up time (argument <code>followUpTime</code>) for all patients in the trial at the time of the analysis. In this case, <a href="https://cran.r-project.org/package=rpact">rpact</a> automatically determines the maximum sample size.</li>
</ol>
<section id="sec-sampleSizeGroupSeq" class="level2">
<h2 class="anchored" data-anchor-id="sec-sampleSizeGroupSeq">Example - exponential survival, flexible accrual intensity, no interim analyses</h2>
<ul>
<li>Exponential PFS (progression-free survival) with a median PFS of 60 months in control (<code>lambda2 = log(2)/60</code>) and a target hazard ratio of 0.74 (<code>hazardRatio = 0.74</code>).</li>
<li>Log-rank test at the two-sided 5%-significance level (<code>sided = 2, alpha = 0.05</code>), power 80% (<code>beta = 0.2</code>).</li>
<li>Annual drop-out of 2.5% in both arms (<code>dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12</code>).</li>
<li>Recruitment is 42 patients/month from month 6 onwards after linear ramp up. (<code>accrualTime = c(0,1,2,3,4,5,6), accrualIntensity = c(6,12,18,24,30,36,42)</code>)</li>
<li>Randomization ratio 1:1 (<code>allocationRatioPlanned = 1</code>). This is the default and is thus not explicitly set in the function call below.</li>
<li>Two sample size choices will be initially explored:
<ul>
<li>A fixed total sample size of 1200 (<code>maxNumberOfSubjects = 1200</code>).</li>
<li>Alternatively, the total sample size will be implicitly determined by specifying that every subject must have a minimal follow-up duration of at 12 months at the time of the analysis (<code>followUpTime = 12</code>).</li>
</ul></li>
</ul>
<p>Based on this, the required number of events and timing of interim analyses for the <strong>fixed total sample size</strong> of 1200 can be determined as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">sampleSize1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb17-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb17-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb17-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb17-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb17-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb17-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb17-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb17-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb17-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb17-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb17-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span></span>
<span id="cb17-13">)</span>
<span id="cb17-14">sampleSize1</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Two-sided power</em>: FALSE</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: two-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>lambda(2)</em>: 0.0116</li>
<li><em>Hazard ratio</em>: 0.740</li>
<li><em>Accrual intensity</em>: 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0</li>
<li><em>Drop-out rate (1)</em>: 0.025</li>
<li><em>Drop-out rate (2)</em>: 0.025</li>
<li><em>Maximum number of subjects</em>: 1200</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Piecewise survival times</em>: 0.00</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.00855</li>
<li><em>median(1)</em>: 81.1</li>
<li><em>median(2)</em>: 60.0</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual time</em>: 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57</li>
<li><em>Follow up time</em>: 21.54</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Number of events</em>: 346.3</li>
<li><em>Analysis time</em>: 53.11</li>
<li><em>Study duration</em>: 53.11</li>
<li><em>Lower critical values (treatment effect scale)</em>: 0.810</li>
<li><em>Upper critical values (treatment effect scale)</em>: 1.234</li>
<li><em>Number of events fixed</em>: 346.3</li>
<li><em>Number of subjects fixed</em>: 1200</li>
<li><em>Number of subjects fixed (1)</em>: 600</li>
<li><em>Number of subjects fixed (2)</em>: 600</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>Thus, the required number of events is 347 and the MDD corresponds to observed HR of 0.81 or 1.23, respectively. The 1200 subjects will be recruited over 31.57 months and the total study duration is 53.11 months. The user could now vary <code>maxNumberSubject</code> to further optimize the trade-off between sample size and study duration.</p>
<p>Alternatively, <strong>specifying a minimum follow-up duration</strong> of 12 months leads to the following result:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">sampleSize2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb18-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb18-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb18-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb18-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb18-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb18-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb18-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb18-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb18-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb18-13">)</span>
<span id="cb18-14">sampleSize2</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Two-sided power</em>: FALSE</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: two-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>lambda(2)</em>: 0.0116</li>
<li><em>Hazard ratio</em>: 0.740</li>
<li><em>Accrual intensity</em>: 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0</li>
<li><em>Follow up time</em>: 12.00</li>
<li><em>Drop-out rate (1)</em>: 0.025</li>
<li><em>Drop-out rate (2)</em>: 0.025</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Piecewise survival times</em>: 0.00</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.00855</li>
<li><em>median(1)</em>: 81.1</li>
<li><em>median(2)</em>: 60.0</li>
<li><em>Direction upper</em>: FALSE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Accrual time</em>: 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 37.13</li>
<li><em>Number of events</em>: 346.3</li>
<li><em>Maximum number of subjects</em>: 1433.7</li>
<li><em>Analysis time</em>: 49.13</li>
<li><em>Study duration</em>: 49.13</li>
<li><em>Lower critical values (treatment effect scale)</em>: 0.810</li>
<li><em>Upper critical values (treatment effect scale)</em>: 1.234</li>
<li><em>Number of events fixed</em>: 346.3</li>
<li><em>Number of subjects fixed</em>: 1433.7</li>
<li><em>Number of subjects fixed (1)</em>: 716.8</li>
<li><em>Number of subjects fixed (2)</em>: 716.8</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>This specification leads to a higher sample size of 1434 subjects which will be recruited over 37.13 months and the total study duration is 49.13 months.</p>
<p>With the generic <code>summary()</code> function the two calculations are summarized as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">sampleSize1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.74, control lambda(2) = 0.012, number of subjects = 1200, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>0.810</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>1.234</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Number of events</td>
<td>346.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>53.11</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td>53.11</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">sampleSize2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.74, control lambda(2) = 0.012, accrual time = c(1, 2, 3, 4, 5, 6, 37.135), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), follow-up time = 12, dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>0.810</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>1.234</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1433.7</td>
</tr>
<tr class="even">
<td>Number of events</td>
<td>346.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>49.13</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td>49.13</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>To further explore the possible trade-offs, one could visualize recruitment and study durations for a range of sample sizes as illustrated in the code below:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># set up data frame which contains sample sizes and corresponding durations</span></span>
<span id="cb21-2">sampleSizeDuration <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb21-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb21-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>,</span>
<span id="cb21-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">studyDuration =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span></span>
<span id="cb21-6">)</span>
<span id="cb21-7"></span>
<span id="cb21-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># calculate recruitment and study duration for each sample size</span></span>
<span id="cb21-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sampleSizeDuration)) {</span>
<span id="cb21-10">    sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb21-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb21-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb21-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb21-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb21-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb21-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb21-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb21-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb21-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb21-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb21-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberSubjects[i]</span>
<span id="cb21-22">    )</span>
<span id="cb21-23">    sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualTime[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sampleSizeResult<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>totalAccrualTime</span>
<span id="cb21-24">    sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>studyDuration[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sampleSizeResult<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxStudyDuration</span>
<span id="cb21-25">}</span>
<span id="cb21-26"></span>
<span id="cb21-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plot result</span></span>
<span id="cb21-28"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberSubjects,</span>
<span id="cb21-29">    sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>studyDuration,</span>
<span id="cb21-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>,</span>
<span id="cb21-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total sample size"</span>,</span>
<span id="cb21-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Duration (months)"</span>,</span>
<span id="cb21-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Recruitment and study duration vs sample size"</span>,</span>
<span id="cb21-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>studyDuration)),</span>
<span id="cb21-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb21-36">)</span>
<span id="cb21-37"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lines</span>(sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberSubjects,</span>
<span id="cb21-38">    sampleSizeDuration<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualTime,</span>
<span id="cb21-39">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb21-40">)</span>
<span id="cb21-41"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">legend</span>(</span>
<span id="cb21-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb21-43">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb21-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Study duration under H1"</span>,</span>
<span id="cb21-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Recruitment duration"</span></span>
<span id="cb21-46">    ),</span>
<span id="cb21-47">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb21-48">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="sample-size-calculation-for-non-inferiority-trials-without-interim-analyses" class="level1">
<h1>Sample size calculation for non-inferiority trials without interim analyses</h1>
<p>Sample size calculation proceeds in the same fashion as for superiority trials except that the role of the null and the alternative hypothesis are reversed. I.e., in this case, the non-inferiority margin <img src="https://latex.codecogs.com/png.latex?%5CDelta"> corresponds to the treatment effect under the null hypothesis (<code>thetaH0</code>). Testing for non-inferiority trials is always one-sided.</p>
<p>In the example code below, we assume that the non-inferiority margin corresponds to a 20% increase of the hazard function and that “in reality”, i.e., under the alternative hypothesis, the survival functions in the two groups are equal. In this case, the “null hypothesis” is <code>thetaH0 = 1.2</code> versus the “alternative” <code>hazardRatio = 1</code>. For illustration, all other assumptions were chosen as per the sample size calculations for superiority trials above.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">sampleSizeNonInf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb22-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb22-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb22-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb22-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb22-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, </span>
<span id="cb22-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb22-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb22-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb22-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb22-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb22-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb22-14">)</span>
<span id="cb22-15"></span>
<span id="cb22-16">sampleSizeNonInf</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Theta H0</em>: 1.2</li>
<li><em>lambda(2)</em>: 0.0116</li>
<li><em>Hazard ratio</em>: 1.000</li>
<li><em>Accrual intensity</em>: 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0</li>
<li><em>Follow up time</em>: 12.00</li>
<li><em>Drop-out rate (1)</em>: 0.025</li>
<li><em>Drop-out rate (2)</em>: 0.025</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Piecewise survival times</em>: 0.00</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0116</li>
<li><em>median(1)</em>: 60.0</li>
<li><em>median(2)</em>: 60.0</li>
<li><em>Direction upper</em>: FALSE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Accrual time</em>: 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 65.12</li>
<li><em>Number of events</em>: 944.5</li>
<li><em>Maximum number of subjects</em>: 2609.2</li>
<li><em>Analysis time</em>: 77.12</li>
<li><em>Study duration</em>: 77.12</li>
<li><em>Critical values (treatment effect scale)</em>: 1.056</li>
<li><em>Number of events fixed</em>: 944.5</li>
<li><em>Number of subjects fixed</em>: 2609.2</li>
<li><em>Number of subjects fixed (1)</em>: 1304.6</li>
<li><em>Number of subjects fixed (2)</em>: 1304.6</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<p>In this example, the required number of events is 945. The specification above leads to a sample size of 2610 subjects recruited over 65.12 months and an expected total study duration of 77.12 months.</p>
</section>
<section id="sample-size-calculation-for-trials-with-interim-analyses" class="level1">
<h1>Sample size calculation for trials with interim analyses</h1>
<p>Calculations can be performed as for trials without interim analyses except that the group sequential design needs to be specified using <code>getDesignGroupSequential()</code> before calling <code>getSampleSizeSurvival()</code>. For details regarding the specification of the group sequential design, see the R Markdown file <a href="https://rpact.com/vignettes/rpact_boundary_examples">Defining group sequential boundaries with rpact</a>.</p>
<p>In general, <a href="https://cran.r-project.org/package=rpact">rpact</a> supports both one-sided and two-sided group sequential designs. However, if futility boundaries are specified, only one-sided tests are permitted. <strong>For simplicity, it is often preferred to use one-sided tests for group sequential designs</strong> (typically with <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">).</p>
<p>One additional consideration for phase III trials with <strong>efficacy interim analyses</strong> is that they <strong>should only be performed at time-points when the data is sufficiently mature</strong> to allow for a potential filing. For example, it is often sensible to perform efficacy interim analyses only after all subjects have been recruited. This aspect can be further explored by looking at simulated data for (hypothetical) trials that would have stopped at the interim analysis. This can easily be implemented using the <strong>simulation tool</strong> in <a href="https://cran.r-project.org/package=rpact">rpact</a> and we refer to the R Markdown document <a href="https://vignettes.rpact.com/html/rpact_survival_simulation_examples.html">Simulation-based design of group sequential trials with a survival endpoint with rpact</a> for further details.</p>
<section id="example---piece-wise-exponential-survival-constant-accrual-intensity-group-sequential-design" class="level2">
<h2 class="anchored" data-anchor-id="example---piece-wise-exponential-survival-constant-accrual-intensity-group-sequential-design">Example - piece-wise exponential survival, constant accrual intensity, group sequential design</h2>
<ul>
<li>1:1 randomized.</li>
<li>80% power at the one-sided 2.5% significance level.</li>
<li>Efficacy interim analyses at 50% and 75% of total information using an O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, no futility interim analyses.</li>
<li>Target HR for primary endpoint (PFS) is 0.75.</li>
<li>PFS in the control arm follows a piece-wise exponential distribution, with the hazard rate h(t) estimated using historical controls as follows:
<ul>
<li>h(t) = 0.025 for t between 0 and 6 months,</li>
<li>h(t) = 0.04 for t between 6 and 9 months,</li>
<li>h(t) = 0.015 for t between 9 and 15 months,</li>
<li>h(t) = 0.01 for t between 15 and 21 months,</li>
<li>h(t) = 0.007 for t beyond 21 months.</li>
</ul></li>
<li>An annual dropout probability of 5%.</li>
<li>Recruitment of 42 patients/month up to a maximum of 1000 subjects.</li>
</ul>
<section id="sample-size-calculation" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-calculation">Sample size calculation</h3>
<p>The <strong>group sequential design</strong> (including Type I and II error) can be specified as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb23-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb23-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb23-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb23-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb23-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb23-7">)</span></code></pre></div></div>
</div>
<p>The <strong>piecewise exponential survival</strong> is defined as described above:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb24-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb24-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb24-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb24-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb24-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb24-7">)</span></code></pre></div></div>
</div>
<p>Now, the <strong>sample size</strong> calculation can be performed:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb25-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb25-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb25-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb25-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb25-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb25-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb25-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb25-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, </span>
<span id="cb25-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb25-11">)</span></code></pre></div></div>
</div>
<p>The sample size result can be summarized by displaying the <strong>default <a href="https://cran.r-project.org/package=rpact">rpact</a> output</strong>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">sampleSizeResult</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.500, 0.750, 1.000</li>
<li><em>Critical values</em>: 2.963, 2.359, 2.014</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.001525, 0.009649, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.001525, 0.009162, 0.022000</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Piecewise survival lambda (2)</em>: 0.025, 0.040, 0.015, 0.010, 0.007</li>
<li><em>Hazard ratio</em>: 0.750</li>
<li><em>Accrual intensity</em>: 42.0</li>
<li><em>Piecewise survival times</em>: 0.00, 6.00, 9.00, 15.00, 21.00</li>
<li><em>Drop-out rate (1)</em>: 0.050</li>
<li><em>Drop-out rate (2)</em>: 0.050</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Piecewise survival lambda (1)</em>: 0.01875, 0.03000, 0.01125, 0.00750, 0.00525</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual time</em>: 23.81</li>
<li><em>Follow up time</em>: 36.19</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Cumulative number of events [1]</em>: 193.4</li>
<li><em>Cumulative number of events [2]</em>: 290.1</li>
<li><em>Cumulative number of events [3]</em>: 386.8</li>
<li><em>Expected number of events under H0</em>: 385.7</li>
<li><em>Expected number of events under H0/H1</em>: 371.7</li>
<li><em>Expected number of events under H1</em>: 318.3</li>
<li><em>Maximum number of events</em>: 386.8</li>
<li><em>Maximum number of subjects (1)</em>: 500</li>
<li><em>Maximum number of subjects (2)</em>: 500</li>
<li><em>Number of subjects [1]</em>: 973.2</li>
<li><em>Number of subjects [2]</em>: 1000</li>
<li><em>Number of subjects [3]</em>: 1000</li>
<li><em>Expected number of subjects under H1</em>: 995.5</li>
<li><em>Reject per stage [1]</em>: 0.1680</li>
<li><em>Reject per stage [2]</em>: 0.3720</li>
<li><em>Reject per stage [3]</em>: 0.2600</li>
<li><em>Early stop</em>: 0.5400</li>
<li><em>Analysis time [1]</em>: 23.17</li>
<li><em>Analysis time [2]</em>: 33.28</li>
<li><em>Analysis time [3]</em>: 60.00</li>
<li><em>Expected study duration</em>: 43.87</li>
<li><em>Maximal study duration</em>: 60.00</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.653</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.758</li>
<li><em>Critical values (treatment effect scale) [3]</em>: 0.815</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>In addition, the <strong>generic</strong> <code>summary()</code> <strong>function</strong> summarizes the results per stage in a different format and also adds results which are stored in the underlying group sequential <code>design</code> such as exit probabilities:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summarize design</span></span>
<span id="cb27-2">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.75, piecewise survival distribution, piecewise survival time = c(0, 6, 9, 15, 21), control lambda(2) = c(0.025, 0.04, 0.015, 0.01, 0.007), maximum number of subjects = 1000, accrual time = 23.81, accrual intensity = 42, dropout rate(1) = 0.05, dropout rate(2) = 0.05, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0015</td>
<td>0.0096</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0015</td>
<td>0.0092</td>
<td>0.0220</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.963</td>
<td>2.359</td>
<td>2.014</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.653</td>
<td>0.758</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.1680</td>
<td>0.5400</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>973.2</td>
<td>1000.0</td>
<td>1000.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>995.5</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>193.4</td>
<td>290.1</td>
<td>386.8</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td></td>
<td>318.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>23.17</td>
<td>33.28</td>
<td>60.00</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td></td>
<td>43.87</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0015</td>
<td>0.0081</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.1680</td>
<td>0.3720</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="sample-size-plots" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-plots">Sample size plots</h3>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> provides a large number of plots, see the R Markdown document <a href="https://vignettes.rpact.com/html/rpact_plot_examples.html">How to create admirable plots with rpact</a> for examples of all plots. Below, we just show two selected plots.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Boundary on treatment effect scale</span></span>
<span id="cb28-2">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showSource =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Source data of the plot (type 2):</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-16-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Survival function and piecewise constant hazard</span></span>
<span id="cb30-2">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-16-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
</section>
<section id="power-calculation" class="level1">
<h1>Power calculation</h1>
<p>The function <code>getPowerSurvival()</code> is the analogue of <code>getSampleSizeSurvival()</code> for power calculations and has a very similar syntax. We illustrate its usage for the above example below.</p>
<section id="example---piece-wise-exponential-survival-constant-accrual-intensity-group-sequential-design-continued" class="level2">
<h2 class="anchored" data-anchor-id="example---piece-wise-exponential-survival-constant-accrual-intensity-group-sequential-design-continued">Example - piece-wise exponential survival, constant accrual intensity, group sequential design (continued)</h2>
<p>What is the power of the trial from the example above if the true hazard ratio is 0.7 rather than the targeted hazard ratio of 0.75 above?</p>
<p>The corresponding power calculation is given below. The function call uses the same arguments as the call to function <code>getSampleSizeSurvival()</code> above except that the maximum sample size of 1000 and the maximum number of events of 387 from above are provided as arguments and the hazard ratio is changed to 0.7. In addition, the direction of the test (<code>directionUpper</code>) needs to be specified.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb31-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb31-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb31-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>,</span>
<span id="cb31-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb31-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb31-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb31-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb31-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>,</span>
<span id="cb31-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, </span>
<span id="cb31-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, </span>
<span id="cb31-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb31-13">)</span>
<span id="cb31-14">powerResult</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.500, 0.750, 1.000</li>
<li><em>Critical values</em>: 2.963, 2.359, 2.014</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.001525, 0.009649, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.001525, 0.009162, 0.022000</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Piecewise survival lambda (2)</em>: 0.025, 0.040, 0.015, 0.010, 0.007</li>
<li><em>Hazard ratio</em>: 0.700</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual intensity</em>: 42.0</li>
<li><em>Piecewise survival times</em>: 0.00, 6.00, 9.00, 15.00, 21.00</li>
<li><em>Drop-out rate (1)</em>: 0.050</li>
<li><em>Drop-out rate (2)</em>: 0.050</li>
<li><em>Maximum number of events</em>: 387</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Piecewise survival lambda (1)</em>: 0.0175, 0.0280, 0.0105, 0.0070, 0.0049</li>
<li><em>Accrual time</em>: 23.81</li>
</ul>
<p><strong>Power and output</strong></p>
<ul>
<li><em>Cumulative number of events [1]</em>: 193.5</li>
<li><em>Cumulative number of events [2]</em>: 290.2</li>
<li><em>Cumulative number of events [3]</em>: 387</li>
<li><em>Expected number of events</em>: 283.6</li>
<li><em>Number of subjects [1]</em>: 990.4</li>
<li><em>Number of subjects [2]</em>: 1000</li>
<li><em>Number of subjects [3]</em>: 1000</li>
<li><em>Expected number of subjects</em>: 997</li>
<li><em>Reject per stage [1]</em>: 0.3150</li>
<li><em>Reject per stage [2]</em>: 0.4392</li>
<li><em>Reject per stage [3]</em>: 0.1813</li>
<li><em>Overall reject</em>: 0.9355</li>
<li><em>Early stop</em>: 0.7542</li>
<li><em>Analysis time [1]</em>: 23.58</li>
<li><em>Analysis time [2]</em>: 34.72</li>
<li><em>Analysis time [3]</em>: 63.37</li>
<li><em>Expected study duration</em>: 38.26</li>
<li><em>Maximal study duration</em>: 63.37</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.653</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.758</li>
<li><em>Critical values (treatment effect scale) [3]</em>: 0.815</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<p>This yields an overall power of 0.935. Note also that the timing of the interim analyses is slightly deferred now (as the events now occur more slowly in the intervention arm) but the expected study duration is decreased from 43.87 to 38.26 months because chances to stop the trial early have increased.</p>
<p>The impact of the true hazard ratio on power and study duration can also be calculated by entering the <code>hazardRatio</code> argument as a vector. Below, the hazard ratio is varied from 0.6 to 1 (in increments of 0.02) and the results are displayed graphically.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">powerResult2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb32-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb32-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>),</span>
<span id="cb32-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb32-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb32-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb32-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb32-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>,</span>
<span id="cb32-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, </span>
<span id="cb32-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">387</span>, </span>
<span id="cb32-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb32-13">)</span>
<span id="cb32-14"></span>
<span id="cb32-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot true hazard ratio vs overall power, probability of an early rejection,</span></span>
<span id="cb32-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and expected number of events</span></span>
<span id="cb32-17">powerResult2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># legend in left bottom</span></span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-18-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot hazard ratio vs analysis time</span></span>
<span id="cb33-2">powerResult2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># right top</span></span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-18-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>For examples of all available plots in <a href="https://cran.r-project.org/package=rpact">rpact</a>, see the R vignette <a href="https://vignettes.rpact.com/html/rpact_plot_examples.html">How to create admirable plots with rpact</a>.</p>
</section>
</section>
<section id="prediction-of-number-of-events-over-time" class="level1">
<h1>Prediction of number of events over time</h1>
<p>The function <code>getEventProbabilities()</code> calculates the probability that a randomly chosen subject has an observed event up to a specified <code>time</code> after the start of the study. By multiplying this probability with the maximal sample size, we obtain the <strong>expected number of events</strong> up to that time point.</p>
<p>The arguments for the function <code>getEventProbabilities()</code> are similar to those for the function <code>getSampleSizeSurvival()</code> discussed above. One difference is that the maximal sample size must always be provided in function <code>getEventProbabilities()</code>. This can either be done explicitly by setting argument <code>maxNumberOfSubjects</code> or implicitly by specifying the accrual duration as described in Section&nbsp;5.1.</p>
<p>For illustration, we revisit the example from Section Section&nbsp;6.1. In that example, the sample size was 1000 and the expected timing of the final analysis after observing 387 events was after 60.00 months. The code below re-calculates the expected number of events until that time point.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sample size per arm and overall for the example</span></span>
<span id="cb34-2">maxNumberOfSubjects1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span></span>
<span id="cb34-3">maxNumberOfSubjects2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span></span>
<span id="cb34-4">maxNumberOfSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> maxNumberOfSubjects1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> maxNumberOfSubjects2</span>
<span id="cb34-5"></span>
<span id="cb34-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Probability that a randomly chosen subject has an observed event</span></span>
<span id="cb34-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># until 60 months after study start</span></span>
<span id="cb34-8">probEvent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getEventProbabilities</span>(</span>
<span id="cb34-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb34-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb34-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb34-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb34-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb34-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb34-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb34-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>,</span>
<span id="cb34-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> maxNumberOfSubjects</span>
<span id="cb34-18">)</span>
<span id="cb34-19">probEvent</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Event probabilities at given time</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Time</em>: 60.00</li>
<li><em>Accrual intensity</em>: 42.0</li>
<li><em>Piecewise survival times</em>: 0.00, 6.00, 9.00, 15.00, 21.00</li>
<li><em>lambda(2)</em>: 0.025, 0.040, 0.015, 0.010, 0.007</li>
<li><em>Hazard ratio</em>: 0.750</li>
<li><em>Drop-out rate (1)</em>: 0.050</li>
<li><em>Drop-out rate (2)</em>: 0.050</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>kappa</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Time and output</strong></p>
<ul>
<li><em>Cumulative event probabilities</em>: 0.3868</li>
<li><em>Event probabilities (1)</em>: 0.3444</li>
<li><em>Event probabilities (2)</em>: 0.4292</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Total expected number of events until 60 months</span></span>
<span id="cb35-2">probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cumulativeEventProbabilities <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 386.7958</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Expected number of events per group until 60 months</span></span>
<span id="cb37-2">probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>eventProbabilities1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects1 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># intervention</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 172.1793</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>eventProbabilities2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects2 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># control</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 214.6165</code></pre>
</div>
</div>
<p>The function <code>getEventProbabilities()</code> also allows a vector argument for <code>time</code> and the code below illustrates how to calculate (and plot) expected event numbers over time (overall and by group). In addition, the number of recruited subjects is added to the plot which can be obtained with function <code>getNumberOfSubjects()</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">time <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span></span>
<span id="cb41-2"></span>
<span id="cb41-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Expected number of events overall and per group at 1-60 months after study start</span></span>
<span id="cb41-4">probEvent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getEventProbabilities</span>(</span>
<span id="cb41-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> time,</span>
<span id="cb41-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb41-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb41-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb41-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb41-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb41-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb41-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>,</span>
<span id="cb41-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> maxNumberOfSubjects</span>
<span id="cb41-14">)</span>
<span id="cb41-15">expEvent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cumulativeEventProbabilities <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># overall</span></span>
<span id="cb41-16">expEventInterv <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>eventProbabilities1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects1 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># intervention</span></span>
<span id="cb41-17">expEventCtrl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> probEvent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>eventProbabilities2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects2 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># control</span></span>
<span id="cb41-18"></span>
<span id="cb41-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Cumulative number of recruited patients over time</span></span>
<span id="cb41-20">nSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getNumberOfSubjects</span>(</span>
<span id="cb41-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> time, </span>
<span id="cb41-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb41-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, </span>
<span id="cb41-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> maxNumberOfSubjects</span>
<span id="cb41-25">)</span>
<span id="cb41-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plot result</span></span>
<span id="cb41-27"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(time, nSubjects<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>numberOfSubjects,</span>
<span id="cb41-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb41-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Number of patients and expected number of events over time"</span>,</span>
<span id="cb41-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time from study start (months)"</span>,</span>
<span id="cb41-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Number of patients / events"</span></span>
<span id="cb41-32">)</span>
<span id="cb41-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lines</span>(time, expEvent, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb41-34"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lines</span>(time, expEventCtrl, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>)</span>
<span id="cb41-35"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lines</span>(time, expEventInterv, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orange"</span>)</span>
<span id="cb41-36"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">legend</span>(</span>
<span id="cb41-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>,</span>
<span id="cb41-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb41-39">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Recruitment"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected events - All subjects"</span>,</span>
<span id="cb41-40">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected events - Control"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expected events - Intervention"</span></span>
<span id="cb41-41">    ),</span>
<span id="cb41-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orange"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb41-43">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="interim-analyses-for-multiple-time-to-event-endpoints" class="level1">
<h1>Interim analyses for multiple time-to-event endpoints</h1>
<p>The function <code>getEventProbabilities()</code> can also be used to align interim analyses of different time to event endpoints as illustrated in two examples below.</p>
<section id="example-both-pfs-and-os-as-primary-endpoints-os-interim-aligned-with-pfs-final-analysis" class="level2">
<h2 class="anchored" data-anchor-id="example-both-pfs-and-os-as-primary-endpoints-os-interim-aligned-with-pfs-final-analysis">Example: Both PFS and OS as primary endpoints, OS interim aligned with PFS final analysis</h2>
<ul>
<li>Overall Type I error 5% (two-sided), 1:1 randomized with PFS and OS both as primary endpoints.</li>
<li>Assumptions for PFS (1% Type I error assigned):
<ul>
<li>Median PFS in control arm is 6 months, target hazard ratio is 0.65, 95% power at two-sided 1% significance level.</li>
<li>Only one primary analysis.</li>
</ul></li>
<li>Assumptions for OS (4% Type I error assigned):
<ul>
<li>Median OS in control arm is 12 month, target hazard ratio is 0.75, 80% power at two-sided 4% significance level.</li>
<li>Interim analysis at the primary PFS analysis, final analysis when the target number of OS events has been reached.</li>
<li>O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function.</li>
</ul></li>
<li>Uniform recruitment of 60 patients/month over 10 months, no dropout.</li>
</ul>
<p>To display results more concisely, all outputs below were created with the generic <code>summary()</code> function.</p>
<p>The first step is to calculate the <strong>required number of events and the timing of the primary analyses for PFS</strong>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1">sampleSizePFS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb42-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb42-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb42-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb42-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, </span>
<span id="cb42-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>,</span>
<span id="cb42-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), </span>
<span id="cb42-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span></span>
<span id="cb42-9">)</span>
<span id="cb42-10">sampleSizePFS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 1%, power 95%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.65, control lambda(2) = 0.116, accrual time = 10, accrual intensity = 60.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0100</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.576</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>0.769</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>1.301</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>600.0</td>
</tr>
<tr class="even">
<td>Number of events</td>
<td>384.0</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>16.37</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td>16.37</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>Based on this, the estimated time of the primary PFS analysis is after 16.37 months.</p>
<p>Second, we <strong>calculate the expected number of OS events at the final PFS analysis</strong> after 16.37 months.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb43-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Expected number of OS events at the time of the final PFS analysis</span></span>
<span id="cb43-2">probOS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getEventProbabilities</span>(</span>
<span id="cb43-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.37</span>,</span>
<span id="cb43-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), </span>
<span id="cb43-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb43-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb43-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span></span>
<span id="cb43-8">)</span>
<span id="cb43-9">probOS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cumulativeEventProbabilities <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 257.5158</code></pre>
</div>
</div>
<p>Third, we calculate the <strong>required number of events and the timing of analyses for OS using an initial guess for the information fraction at the OS interim analysis</strong> of 50%:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Preliminary group sequential design for OS assuming interim at 50% information</span></span>
<span id="cb45-2">designOS1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb45-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb45-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>, </span>
<span id="cb45-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb45-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb45-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb45-8">)</span>
<span id="cb45-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Preliminary sample size for OS assuming interim at 50% information</span></span>
<span id="cb45-10">sampleSizeOS1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb45-11">  designOS1,</span>
<span id="cb45-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb45-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb45-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), </span>
<span id="cb45-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span></span>
<span id="cb45-16">)</span>
<span id="cb45-17">sampleSizeOS1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), two-sided overall significance level 4%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.75, control lambda(2) = 0.058, accrual time = 10, accrual intensity = 60.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0020</td>
<td>0.0400</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0020</td>
<td>0.0393</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.090</td>
<td>2.061</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>0.648</td>
<td>0.815</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>1.543</td>
<td>1.227</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.1493</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>600.0</td>
<td>600.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>600.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events</td>
<td>203.2</td>
<td>406.4</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1</td>
<td></td>
<td>376.0</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>13.43</td>
<td>27.85</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td>25.70</td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0020</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.1493</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>Finally, we <strong>recalculate</strong> the required number of events and timing of analyses for OS using <strong>an updated estimate of the information fraction at the interim analysis</strong>. Specifically, we calculate this fraction as the expected number of events at the time of the final PFS analysis (i.e., 258 events) relative to the maximal number of events based on the calculation for OS above (i.e., 407):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Updated group sequential design for OS assuming an updated information fraction</span></span>
<span id="cb46-2">designOS2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb46-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb46-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>, </span>
<span id="cb46-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb46-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">258</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">407</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb46-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb46-8">)</span>
<span id="cb46-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Updated sample size for OS</span></span>
<span id="cb46-10">sampleSizeOS2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb46-11">  designOS2,</span>
<span id="cb46-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb46-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb46-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), </span>
<span id="cb46-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span></span>
<span id="cb46-16">)</span>
<span id="cb46-17">sampleSizeOS2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), two-sided overall significance level 4%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.75, control lambda(2) = 0.058, accrual time = 10, accrual intensity = 60.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>63.4%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0070</td>
<td>0.0400</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.0070</td>
<td>0.0378</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.699</td>
<td>2.077</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>0.715</td>
<td>0.814</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>1.398</td>
<td>1.228</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3508</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>600.0</td>
<td>600.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>600.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events</td>
<td>259.2</td>
<td>408.8</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1</td>
<td></td>
<td>356.3</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>16.47</td>
<td>28.11</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td>24.03</td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0070</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1)</td>
<td>0.3508</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>According to the updated calculation, the planned timing of the OS interim analysis is after 16.47 months which is sufficiently close to the planned timing of the PFS final analysis after 16.37 months for planning purposes.</p>
</section>
<section id="example-power-considerations-for-os-as-a-secondary-endpoint-os-interim-aligned-with-primary-pfs-analysis" class="level2">
<h2 class="anchored" data-anchor-id="example-power-considerations-for-os-as-a-secondary-endpoint-os-interim-aligned-with-primary-pfs-analysis">Example: Power considerations for OS as a secondary endpoint, OS interim aligned with primary PFS analysis</h2>
<ul>
<li>Overall Type I error 5% (two-sided), 1:1 randomized with PFS as the primary endpoint.<br>
</li>
<li>Sample size calculation for PFS resulted in the following design:
<ul>
<li>No interim analyses for PFS.</li>
<li>Uniform recruitment of 80 patients/month over 10 months (800 patients in total), no dropout.</li>
<li>Final PFS analysis with 80% power for the targeted HR is expected after a study duration of 24 months.</li>
</ul></li>
<li>Asssumption for OS:
<ul>
<li>Median OS in control arm 30 months, OS HR expected to be around 0.8.</li>
<li>OS is only formally tested if PFS is significant (hierarchical testing).</li>
<li>One interim analysis at the time of the final PFS analysis.</li>
<li>It is anticipated that the OS analysis cannot be fully powered. The target number of OS events at the final OS analysis will be pre-defined after considering all possible trade-offs between study power and duration.</li>
<li>O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function.</li>
</ul></li>
</ul>
<p>The code below calulates study duration and power for the final OS analysis (conditional on significance for the primary PFS analysis) depending on the target number of OS events at the final analysis. The resulting plots should facilitate the final choice of the timing of the OS analysis.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1) Calculate expected number of OS events at the time of the final PFS analysis</span></span>
<span id="cb47-2">noDeathsAtPFSAnalysis <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getEventProbabilities</span>(</span>
<span id="cb47-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>,</span>
<span id="cb47-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, </span>
<span id="cb47-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb47-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), </span>
<span id="cb47-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb47-8">)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cumulativeEventProbabilities <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span></span>
<span id="cb47-9">noDeathsAtPFSAnalysis</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 197.4038</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2) Set up data frame which will contain number of OS events and</span></span>
<span id="cb49-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    corresponding power and study durations</span></span>
<span id="cb49-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    (vary target number of OS events from 250-700)</span></span>
<span id="cb49-4">powerOSevents <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb49-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOSEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">250</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb49-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">power =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>,</span>
<span id="cb49-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">durationFinalOSAnalysis =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span></span>
<span id="cb49-8">)</span>
<span id="cb49-9"></span>
<span id="cb49-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3) Calculate power and study durations depending on target number of OS events</span></span>
<span id="cb49-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(powerOSevents)) {</span>
<span id="cb49-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define OF-type design, with first interim after noDeathsAtPFSAnalysis events</span></span>
<span id="cb49-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and final analysis after maxNumberOSEvents[i] events</span></span>
<span id="cb49-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PS: beta not explicitly set here because boundary and</span></span>
<span id="cb49-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     subsequent power calculations do not depend on it</span></span>
<span id="cb49-16">    informationRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(noDeathsAtPFSAnalysis, powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOSEvents[i]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span></span>
<span id="cb49-17">        powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOSEvents[i]</span>
<span id="cb49-18">    design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb49-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb49-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb49-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb49-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> informationRates, </span>
<span id="cb49-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb49-24">    )</span>
<span id="cb49-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Power and study duration after maxNumberOSEvents[i]</span></span>
<span id="cb49-26">    powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb49-27">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb49-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, </span>
<span id="cb49-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb49-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), </span>
<span id="cb49-31">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>,</span>
<span id="cb49-32">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOSEvents[i]</span>
<span id="cb49-33">    )</span>
<span id="cb49-34">    powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>power[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> powerResult<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span>
<span id="cb49-35">    powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>durationFinalOSAnalysis[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> powerResult<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxStudyDuration</span>
<span id="cb49-36">}</span>
<span id="cb49-37"></span>
<span id="cb49-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4) Plot results</span></span>
<span id="cb49-39"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">par</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mfrow =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb49-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#  events cs power</span></span>
<span id="cb49-41"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOSEvents,</span>
<span id="cb49-42">    powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>power,</span>
<span id="cb49-43">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>,</span>
<span id="cb49-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Required # OS events at final analysis"</span>,</span>
<span id="cb49-45">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>, </span>
<span id="cb49-46">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb49-47">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb49-48">)</span>
<span id="cb49-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Duration vs power</span></span>
<span id="cb49-50"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>durationFinalOSAnalysis,</span>
<span id="cb49-51">    powerOSevents<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>power,</span>
<span id="cb49-52">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>,</span>
<span id="cb49-53">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time until final OS analysis (months)"</span>,</span>
<span id="cb49-54">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Power"</span>, </span>
<span id="cb49-55">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb49-56">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb49-57">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_examples/index_files/figure-html/unnamed-chunk-26-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="extracting-information-from-rpact-objects" class="level1">
<h1>Extracting information from rpact objects</h1>
<p><code>names(rpact_object)</code> gives variable names of an <a href="https://cran.r-project.org/package=rpact">rpact</a> object which can be accessed via <code>rpact_object$varname</code>. For example, <code>sampleSizeResult$studyDurationH1</code> contains the expected study duration under H1. For more details on using R generics for <a href="https://cran.r-project.org/package=rpact">rpact</a> objects, please refer to vignette <a href="https://vignettes.rpact.com/html/rpact_generic_functions.html">Example: using rpact with R generics</a>.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_survival_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_23.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Simulation-Based Design of Group Sequential Trials with a Survival Endpoint with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Marcel Wolbers](https://www.linkedin.com/in/marcel-wolbers-396882260 &quot;Visit Marcel Wolbers&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_survival_simulation_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p><a href="https://cran.r-project.org/package=rpact">rpact</a> provides the function <code>getSimulationSurvival()</code> for simulation of group sequential trials with a time-to-event endpoint. For a given scenario, <code>getSimulationSurvival()</code> simulates many hypothetical group sequential trials and calculates the test results. Based on this Monte Carlo simulation, estimates of key quantities such as overall study power, stopping probabilities at each interim analysis, timing of analyses etc. can be obtained.</p>
<p><code>getSimulationSurvival()</code> complements the analytical calculations from the function <code>getPowerSurvival()</code> (and <code>getSampleSizeSurvival()</code>) in multiple ways:</p>
<ul>
<li>Simulations can be used to assess the accuracy of the analytical formulas.</li>
<li>Simulations allow to answer questions such as the following:
<ul>
<li>How variable is the timing of interim analysis (even if all assumptions are correct)?</li>
<li>How could a dataset of a trial that is stopped early for efficacy at an interim analysis look like?</li>
</ul></li>
<li>Simulation is also possible for scenarios that are analytically intractable such as scenarios with delayed treatment effects.</li>
</ul>
<p>The syntax of the function <code>getSimulationSurvival()</code> is very similar to the functions <code>getPowerSurvival()</code> and <code>getSampleSizeSurvival()</code>. Hence, this document only provides some examples and expects that the reader is familiar with the R Markdown document <a href="https://vignettes.rpact.com/html/rpact_survival_examples.html">Designing group sequential trials with two groups and a survival endpoint with rpact</a> which describes standard designs of a trial with a survival endpoint in <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
<p><code>getSimulationSurvival()</code> also supports the usage of adaptive sample size recalculation but this is not covered here. For more details, please also consult the help <code>?getSimulationSurvival</code>.</p>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>For this R Markdown document, some <strong>additional R packages</strong> are loaded which will be used to examine simulated datasets.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load ggplot2 for plotting</span></span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># general plotting</span></span>
<span id="cb3-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(survminer) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plotting of KM curves with ggplot2</span></span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Loading required package: ggpubr</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(survival) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># survival analysis routines</span></span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>
Attaching package: 'survival'</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>The following object is masked from 'package:survminer':

    myeloma</code></pre>
</div>
</div>
</section>
<section id="standard-analytical-calculation" class="level1">
<h1>Standard analytical calculation</h1>
<p>For comparison with the simulation-based analysis, a standard example is first calculated under the following assumptions:</p>
<ul>
<li>Group-sequential design with one interim analysis after 66% of information using an O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending function, one-sided Type I error 2.5%, power 80%:</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.66</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>, </span>
<span id="cb8-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb8-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb8-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb8-7">)</span></code></pre></div></div>
</div>
<ul>
<li>Exponential PFS with a median PFS of 60 months in control (<code>median2 = 60</code>) and a target hazard ratio of 0.74 (<code>hazardRatio = 0.74</code>).</li>
<li>Annual drop-out of 2.5% in both arms (<code>dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12</code>).</li>
<li>Recruitment is 42 patients/month from month 6 onwards after linear ramp up. (<code>accrualTime = c(0,1,2,3,4,5,6), accrualIntensity = c(6,12,18,24,30,36,42)</code>)</li>
<li>Randomization ratio 1:1 (<code>allocation1 = 1</code> and <code>allocation2 = 1</code>); this is how subjects are randomized in treatment groups 1 and 2 in a subsequent way). 1:1 allocation is the default and is thus not explicitly set in the function call below.</li>
<li>A fixed total sample size of 1200 (<code>maxNumberOfSubjects = 1200</code>).</li>
</ul>
<p>As described in the vignette <a href="https://vignettes.rpact.com/html/rpact_survival_examples.html">Designing group sequential trials with two groups and a survival endpoint with rpact</a>, sample size calculations for this design can be performed as per the code below:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">sampleSizeResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb9-2">  design,</span>
<span id="cb9-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb9-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb9-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb9-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb9-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb9-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb9-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb9-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span></span>
<span id="cb9-11">)</span>
<span id="cb9-12"></span>
<span id="cb9-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summary of results</span></span>
<span id="cb9-14">sampleSizeResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 0.74, control median(2) = 60, maximum number of subjects = 1200, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>66%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0058</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0058</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.524</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.718</td>
<td>0.808</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.4074</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1200.0</td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>1200.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>231.3</td>
<td>350.5</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td>302.0</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>39.54</td>
<td>53.65</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td>47.91</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0058</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.4074</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>By design, the power of the trial is 80%. The interim analysis is after 232 events which is expected to occur after 39.5 months, and the final analysis is after 351 events which is expected to occur after 53.7 months.</p>
<p>Use <code>getPowerSurvival()</code> to calculate the power achieved for the ceiled number of events. Note that the direction of the alternative needs to be specified. Here, the alternative is towards hazard ratios &lt; 1 which is specified as <code>directionUpper = FALSE</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">powerResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb10-2">  design,</span>
<span id="cb10-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(sampleSizeResult<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfEvents),</span>
<span id="cb10-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb10-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb10-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb10-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb10-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb10-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb10-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb10-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb10-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span></span>
<span id="cb10-13">)</span>
<span id="cb10-14"></span>
<span id="cb10-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summary of results</span></span>
<span id="cb10-16">powerResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.74, control median(2) = 60, maximum number of subjects = 1200, maximum number of events = 351, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>66%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0058</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0058</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.524</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.718</td>
<td>0.808</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.4080</td>
<td>0.8005</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>1200.0</td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>1200.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>231.7</td>
<td>351.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td>302.3</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>39.58</td>
<td>53.72</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td>47.95</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0058</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.4080</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>These numbers will now be compared to simulations.</p>
</section>
<section id="simulation-under-proportional-hazards" class="level1">
<h1>Simulation under proportional hazards</h1>
<p>The call <code>getSimulationSurvival()</code> uses the same arguments as <code>getSampleSizeSurvival()</code> with the following changes:</p>
<ul>
<li>The maximum number of patients (<code>maxNumberOfSubjects = 1200</code>) is always provided to allow the simulation.</li>
<li>The number of events at each analysis is specified as per the analytical calculation above (<code>plannedEvents = c(232,351)</code>).</li>
<li>The direction of the alternative is specified as <code>directionUpper = FALSE</code>.</li>
<li>The number of simulated trials is specified (<code>maxNumberOfIterations = 10000</code> in the example below).</li>
<li>By default, raw datasets from simulation runs are not extracted. However, in this example, it is specified that one raw dataset that led to stopping after each stage, respectively, will be stored: <code>maxNumberOfRawDatasetsPerStage = 1</code>.</li>
<li>For reproducibility, it is useful to set the random seed which is set to <code>seed = 234</code> in the example.</li>
<li>For simulation of trials with unequal randomization, integer arguments <code>allocation1</code> and <code>allocation2</code> must be provided to the function <code>getSimulationSurvival</code> (instead of argument <code>allocationRatioPlanned</code> in the function <code>getSampleSizeSurvival</code>). <code>allocation1</code> and <code>allocation2</code> specify the number of consecutively enrolled subjects in the intervention and control groups, respectively, before another subject from the opposite group is recruited. For example, <code>allocation1 = 2,  allocation2 = 1</code> refers to 2 (intervention):1 (control) randomization and <code>allocation1 = 1, allocation2 = 2</code> to 1 (intervention):2 (control) randomization.</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">simulationResult <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb11-2">    design,</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span>,</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb11-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb11-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">232</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">351</span>),</span>
<span id="cb11-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb11-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>,</span>
<span id="cb11-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb11-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfRawDatasetsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb11-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">234</span></span>
<span id="cb11-16">)</span>
<span id="cb11-17"></span>
<span id="cb11-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summary of simulation results</span></span>
<span id="cb11-19">simulationResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%. The results were simulated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = 0.74, control median(2) = 60, planned cumulative events = c(232, 351), maximum number of subjects = 1200, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12, simulation runs = 10000, seed = 234.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>66%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0058</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0058</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.524</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3974</td>
<td>0.7959</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>1200.0</td>
<td>1200.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events</td>
<td>232.0</td>
<td>351.0</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1</td>
<td></td>
<td>303.7</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>39.61</td>
<td>53.66</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td>48.09</td>
</tr>
<tr class="even">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.5446</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>According to the output, the simulated overall power is 79.6% and the probability to cross the efficacy boundary at the interim analysis is 39.7%. These are both within 1% of the analytical power.</p>
<p>The mean simulated analysis times are after 39.61 months for the interim analysis and after 53.66 for the final analysis. Both timings differ by &lt;0.1 months from the analytical calculation (Difference analysis times = 0.06, 0.01).</p>
<p>You can show median [range] and mean+/-sd of the trial results across the simulated datasets with the <code>print()</code> command together <code>showStatistics = TRUE</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print of simulation results showing trial results statistics</span></span>
<span id="cb12-2">simulationResult <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showStatistics =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of survival data (group sequential design)</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.660, 1.000</li>
<li><em>Critical values</em>: 2.524, 1.992</li>
<li><em>Futility bounds (non-binding)</em>: -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.005798, 0.025000</li>
<li><em>Local one-sided significance levels</em>: 0.005798, 0.023210</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Planned cumulative events</em>: 232, 351</li>
<li><em>median(2)</em>: 60.0</li>
<li><em>Hazard ratio</em>: 0.740</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual intensity</em>: 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0</li>
<li><em>Drop-out rate (1)</em>: 0.025</li>
<li><em>Drop-out rate (2)</em>: 0.025</li>
<li><em>Seed</em>: 234</li>
<li><em>Maximum number of subjects</em>: 1200</li>
<li><em>Maximum number of iterations</em>: 10000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Allocation 1</em>: 1</li>
<li><em>Allocation 2</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.00855</li>
<li><em>lambda(2)</em>: 0.0116</li>
<li><em>median(1)</em>: 81.1</li>
<li><em>Accrual time</em>: 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57</li>
</ul>
<p><strong>Results</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.0975</li>
<li><em>Assumed control rate</em>: 0.129</li>
<li><em>Single number of events [1]</em>: 232</li>
<li><em>Single number of events [2]</em>: 119</li>
<li><em>Cumulative number of events [1]</em>: 232</li>
<li><em>Cumulative number of events [2]</em>: 351</li>
<li><em>Expected number of events</em>: 303.7</li>
<li><em>Events not achieved [1]</em>: 0.000</li>
<li><em>Events not achieved [2]</em>: 0.000</li>
<li><em>Number of subjects [1]</em>: 1200</li>
<li><em>Number of subjects [2]</em>: 1200</li>
<li><em>Expected number of subjects</em>: 1200</li>
<li><em>Reject per stage [1]</em>: 0.3974</li>
<li><em>Reject per stage [2]</em>: 0.3985</li>
<li><em>Overall reject</em>: 0.7959</li>
<li><em>Overall futility stop</em>: 0.0000</li>
<li><em>Futility stop per stage</em>: 0.0000</li>
<li><em>Early stop</em>: 0.3974</li>
<li><em>Analysis time [1]</em>: 39.61</li>
<li><em>Analysis time [2]</em>: 53.66</li>
<li><em>Expected study duration</em>: 48.09</li>
<li><em>Conditional power (achieved) [1]</em>: NA</li>
<li><em>Conditional power (achieved) [2]</em>: 0.5446</li>
<li><em>Iterations [1]</em>: 10000</li>
<li><em>Iterations [2]</em>: 6026</li>
</ul>
<p><strong>Simulated data</strong></p>
<ul>
<li><em>Analysis time</em> [1] : median [range]: 39.578 [33.988 - 45.552]; mean +/-sd: 39.606 +/-1.47; n = 10000</li>
<li><em>Analysis time</em> [2] : median [range]: 53.616 [46.872 - 61.013]; mean +/-sd: 53.659 +/-2.007; n = 6026</li>
<li><em>Number of subjects</em> [1] : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0; n = 10000</li>
<li><em>Number of subjects</em> [2] : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0; n = 6026</li>
<li><em>Test statistic</em> [1] : median [range]: 2.267 [-1.52 - 5.611]; mean +/-sd: 2.269 +/-0.99; n = 10000</li>
<li><em>Test statistic</em> [2] : median [range]: 2.314 [-0.877 - 4.832]; mean +/-sd: 2.282 +/-0.773; n = 6026</li>
<li><em>Log-rank statistic</em> [1] : median [range]: 2.267 [-1.52 - 5.611]; mean +/-sd: 2.269 +/-0.99; n = 10000</li>
<li><em>Log-rank statistic</em> [2] : median [range]: 2.314 [-0.877 - 4.832]; mean +/-sd: 2.282 +/-0.773; n = 6026</li>
<li><em>Hazard ratio estimate LR</em> [1] : median [range]: 0.743 [0.479 - 1.221]; mean +/-sd: 0.749 +/-0.098; n = 10000</li>
<li><em>Hazard ratio estimate LR</em> [2] : median [range]: 0.781 [0.597 - 1.098]; mean +/-sd: 0.787 +/-0.066; n = 6026</li>
<li><em>Conditional power (achieved)</em> [2] : median [range]: 0.607 [0 - 0.972]; mean +/-sd: 0.545 +/-0.336; n = 6026</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
</div>
<section id="accessing-trial-summaries-per-stage-for-each-simulation" class="level2">
<h2 class="anchored" data-anchor-id="accessing-trial-summaries-per-stage-for-each-simulation">Accessing trial summaries per stage for each simulation</h2>
<p>Summary results for each trial can be obtained from the simulation object using the function <code>getData()</code>. Similarly, raw data from individual trials that were stopped at each stage can be obtained using the function <code>getRawData()</code> (if <code>maxNumberOfRawDatasetsPerStage</code> was set &gt; 0). The format of these datasets is described in the help <code>?getSimulationSurvival</code> and illustrated now.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># get aggregate datasets from all simulation runs</span></span>
<span id="cb13-2">aggregateSimulationData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getData</span>(simulationResult)</span>
<span id="cb13-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># show the first 6 records of the dataset</span></span>
<span id="cb13-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(aggregateSimulationData)</span></code></pre></div></div>
</div>
<table class="caption-top table">
<colgroup>
<col style="width: 37%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
</colgroup>
<tbody>
<tr class="odd">
<td style="text-align: left;">iterationNumber</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">3</td>
<td style="text-align: left;">3</td>
<td style="text-align: left;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">stageNumber</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">pi1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
</tr>
<tr class="even">
<td style="text-align: left;">pi2</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">hazardRatio</td>
<td style="text-align: left;">0.74</td>
<td style="text-align: left;">0.74</td>
<td style="text-align: left;">0.74</td>
<td style="text-align: left;">0.74</td>
<td style="text-align: left;">0.74</td>
<td style="text-align: left;">0.74</td>
</tr>
<tr class="even">
<td style="text-align: left;">analysisTime</td>
<td style="text-align: left;">40.07</td>
<td style="text-align: left;">53.85</td>
<td style="text-align: left;">41.22</td>
<td style="text-align: left;">40.62</td>
<td style="text-align: left;">54.54</td>
<td style="text-align: left;">40.74</td>
</tr>
<tr class="odd">
<td style="text-align: left;">numberOfSubjects</td>
<td style="text-align: left;">1200</td>
<td style="text-align: left;">1200</td>
<td style="text-align: left;">1200</td>
<td style="text-align: left;">1200</td>
<td style="text-align: left;">1200</td>
<td style="text-align: left;">1200</td>
</tr>
<tr class="even">
<td style="text-align: left;">overallEvents1</td>
<td style="text-align: left;">100</td>
<td style="text-align: left;">159</td>
<td style="text-align: left;">94</td>
<td style="text-align: left;">107</td>
<td style="text-align: left;">165</td>
<td style="text-align: left;">98</td>
</tr>
<tr class="odd">
<td style="text-align: left;">overallEvents2</td>
<td style="text-align: left;">132</td>
<td style="text-align: left;">192</td>
<td style="text-align: left;">138</td>
<td style="text-align: left;">125</td>
<td style="text-align: left;">186</td>
<td style="text-align: left;">134</td>
</tr>
<tr class="even">
<td style="text-align: left;">eventsPerStage</td>
<td style="text-align: left;">232</td>
<td style="text-align: left;">119</td>
<td style="text-align: left;">232</td>
<td style="text-align: left;">232</td>
<td style="text-align: left;">119</td>
<td style="text-align: left;">232</td>
</tr>
<tr class="odd">
<td style="text-align: left;">rejectPerStage</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="even">
<td style="text-align: left;">eventsNotAchieved</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">futilityPerStage</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
<td style="text-align: left;">0</td>
</tr>
<tr class="even">
<td style="text-align: left;">testStatistic</td>
<td style="text-align: left;">2.474</td>
<td style="text-align: left;">2.328</td>
<td style="text-align: left;">3.162</td>
<td style="text-align: left;">1.446</td>
<td style="text-align: left;">1.558</td>
<td style="text-align: left;">2.724</td>
</tr>
<tr class="odd">
<td style="text-align: left;">logRankStatistic</td>
<td style="text-align: left;">2.474</td>
<td style="text-align: left;">2.328</td>
<td style="text-align: left;">3.162</td>
<td style="text-align: left;">1.446</td>
<td style="text-align: left;">1.558</td>
<td style="text-align: left;">2.724</td>
</tr>
<tr class="even">
<td style="text-align: left;">conditionalPowerAchieved</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">0.9644</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">0.3572</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="odd">
<td style="text-align: left;">pValuesSeparate</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: left;">trialStop</td>
<td style="text-align: left;">FALSE</td>
<td style="text-align: left;">TRUE</td>
<td style="text-align: left;">TRUE</td>
<td style="text-align: left;">FALSE</td>
<td style="text-align: left;">TRUE</td>
<td style="text-align: left;">TRUE</td>
</tr>
<tr class="odd">
<td style="text-align: left;">hazardRatioEstimateLR</td>
<td style="text-align: left;">0.7226</td>
<td style="text-align: left;">0.7800</td>
<td style="text-align: left;">0.6602</td>
<td style="text-align: left;">0.8271</td>
<td style="text-align: left;">0.8468</td>
<td style="text-align: left;">0.6993</td>
</tr>
</tbody>
</table>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The aggregated dataset contains one record for each of the 10'000 simulated</span></span>
<span id="cb14-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interim datasets (stageNumber = 1), and one additional record for the final</span></span>
<span id="cb14-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># analysis (stageNumber = 2) for all simulated trials which were not stopped at</span></span>
<span id="cb14-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the interim analysis</span></span>
<span id="cb14-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(aggregateSimulationData<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageNumber)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>
    1     2 
10000  6026 </code></pre>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># One possible analysis which uses the aggregated dataset:</span></span>
<span id="cb16-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># display the distribution of the timing of the analyses (by stage)</span></span>
<span id="cb16-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># across simulation runs</span></span>
<span id="cb16-4">p <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(aggregateSimulationData, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(stageNumber), analysisTime))</span>
<span id="cb16-5">p <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb16-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Analysis stage"</span>,</span>
<span id="cb16-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Timing of analysis (months </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">from first patient randomized)"</span></span>
<span id="cb16-8">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_simulation_examples/index_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div style="page-break-after: always;"></div>
</section>
<section id="accessing-summaries-for-a-simulated-trial-stopped-at-interim" class="level2">
<h2 class="anchored" data-anchor-id="accessing-summaries-for-a-simulated-trial-stopped-at-interim">Accessing summaries for a simulated trial stopped at interim</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get all stored raw datasets</span></span>
<span id="cb17-2">rawSimulationDataData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getRawData</span>(simulationResult)</span>
<span id="cb17-3"></span>
<span id="cb17-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Choose one dataset which corresponds to a simulated (hypothetical) trial</span></span>
<span id="cb17-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which was stopped at the efficacy interim analysis</span></span>
<span id="cb17-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (only 1 such dataset exists here, because maxNumberOfRawDatasetsPerStage</span></span>
<span id="cb17-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># was set to 1 above)</span></span>
<span id="cb17-8">stage1rawData <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">subset</span>(rawSimulationDataData, stopStage <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-9"></span>
<span id="cb17-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform a Cox regression analysis of the simulated trial</span></span>
<span id="cb17-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (treatmentGroup == 1 is the intervention arm)</span></span>
<span id="cb17-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Note that the $p$-value from the Cox regression is two-sided whereas</span></span>
<span id="cb17-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the group sequential test is one-sided.</span></span>
<span id="cb17-14"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coxph</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Surv</span>(timeUnderObservation, event) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">I</span>(treatmentGroup <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb17-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> stage1rawData</span>
<span id="cb17-16">))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Call:
coxph(formula = Surv(timeUnderObservation, event) ~ I(treatmentGroup == 
    1), data = stage1rawData)

  n= 1200, number of events= 232 

                              coef exp(coef) se(coef)      z Pr(&gt;|z|)   
I(treatmentGroup == 1)TRUE -0.4199    0.6571   0.1337 -3.139  0.00169 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

                           exp(coef) exp(-coef) lower .95 upper .95
I(treatmentGroup == 1)TRUE    0.6571      1.522    0.5056    0.8541

Concordance= 0.553  (se = 0.017 )
Likelihood ratio test= 10.05  on 1 df,   p=0.002
Wald test            = 9.85  on 1 df,   p=0.002
Score (logrank) test = 10  on 1 df,   p=0.002</code></pre>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Show Kaplan-Meier curves of the simulated trial</span></span>
<span id="cb19-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggsurvplot</span>(</span>
<span id="cb19-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">survfit</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Surv</span>(timeUnderObservation, event) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> treatmentGroup,</span>
<span id="cb19-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> stage1rawData</span>
<span id="cb19-5">    ),</span>
<span id="cb19-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pval =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb19-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">risk.table =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb19-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">break.time.by =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb19-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">censor.size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb19-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">risk.table.y.text.col =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb19-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">risk.table.fontsize =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb19-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.labs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Treatment"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Control"</span>),</span>
<span id="cb19-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb19-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Kaplan-Meier curve of one simulated trial</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> which "</span>,</span>
<span id="cb19-15">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"was stopped at the interim analysis"</span></span>
<span id="cb19-16">    ),</span>
<span id="cb19-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Time (months)"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> stage1rawData</span>
<span id="cb19-18">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Ignoring unknown labels:
• colour : "Strata"</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_survival_simulation_examples/index_files/figure-html/unnamed-chunk-15-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="simulation-under-non-proportional-hazards" class="level1">
<h1>Simulation under non-proportional hazards</h1>
<p>For the sake of illustration, assume that the treatment effect in the example above is delayed by 6 months, i.e., that the active treatment does not affect the hazard in the first 6 months but still reduces it by 0.74-fold from month 6 onwards. The code below determines the power of the design in this situation via simulation.</p>
<p>The code to specify a delayed treatment effect is similar to the simulation under proportional hazards except that now the survival function in each arm is specified via a piecewise constant exponential distribution <em>defined through the hazard rates</em> (not the medians):</p>
<p><code>piecewiseSurvivalTime = c(0,6),</code></p>
<p><code>lambda2 = c(log(2)/60,log(2)/60),</code></p>
<p><code>lambda1 = c(log(2)/60,0.74*log(2)/60)</code></p>
<p>(as always for <a href="https://cran.r-project.org/package=rpact">rpact</a>, “2” refers to the control arm which still has a constant hazard rate, i.e., an exponential distribution).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simulation assuming a delayed treatment effect</span></span>
<span id="cb21-2">simulationResultNPH <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb21-3">  design,</span>
<span id="cb21-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb21-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb21-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb21-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb21-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb21-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb21-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb21-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb21-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">232</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">351</span>),</span>
<span id="cb21-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb21-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>,</span>
<span id="cb21-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb21-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfRawDatasetsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb21-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">234</span></span>
<span id="cb21-18">)</span>
<span id="cb21-19">simulationResultNPH <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%. The results were simulated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = c(1, 0.74), piecewise survival distribution, piecewise survival time = c(0, 6), control lambda(2) = c(0.0116, 0.0116), planned cumulative events = c(232, 351), maximum number of subjects = 1200, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12, simulation runs = 10000, seed = 234.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>66%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0058</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0058</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.524</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.1525</td>
<td>0.5671</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>1200.0</td>
<td>1200.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events</td>
<td>232.0</td>
<td>351.0</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1</td>
<td></td>
<td>332.9</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>38.64</td>
<td>52.63</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td>50.53</td>
</tr>
<tr class="even">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.3512</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>As can be seen from the output above, power drops substantially to 56.7%.</p>
<p>If one wants the trial to maintain a power of 80% despite the delayed treatment effect, the maximal number of events would need to be increased and some experimentation shows that one would need 498 events in this case as demonstrated in the simulation below. Note further that in this non-proportional hazards scenario, power does not only depend on the number of events but also on other assumptions, in particular on assumptions regarding the speed of recruitment.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simulation assuming a delayed treatment effect</span></span>
<span id="cb22-2">plannedEventsMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">498</span></span>
<span id="cb22-3">simulationResultNPH2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb22-4">  design,</span>
<span id="cb22-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb22-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb22-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.74</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb22-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb22-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb22-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb22-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb22-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>),</span>
<span id="cb22-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.66</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> plannedEventsMax), plannedEventsMax),</span>
<span id="cb22-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb22-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>,</span>
<span id="cb22-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb22-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfRawDatasetsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">456</span></span>
<span id="cb22-19">)</span>
<span id="cb22-20">simulationResultNPH2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%. The results were simulated for a two-sample logrank test, H0: hazard ratio = 1, power directed towards smaller values, H1: hazard ratio = c(1, 0.74), piecewise survival distribution, piecewise survival time = c(0, 6), control lambda(2) = c(0.0116, 0.0116), planned cumulative events = c(329, 498), maximum number of subjects = 1200, accrual time = c(1, 2, 3, 4, 5, 6, 31.571), accrual intensity = c(6, 12, 18, 24, 30, 36, 42), dropout rate(1) = 0.025, dropout rate(2) = 0.025, dropout time = 12, simulation runs = 10000, seed = 456.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>66%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0058</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0058</td>
<td>0.0232</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.524</td>
<td>1.992</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.3269</td>
<td>0.7958</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>1200.0</td>
<td>1200.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td>1200.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events</td>
<td>329.0</td>
<td>498.0</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1</td>
<td></td>
<td>442.8</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>49.87</td>
<td>74.11</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td></td>
<td>66.22</td>
</tr>
<tr class="even">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.4867</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Survival</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_survival_simulation_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_25.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Planning a Survival Trial with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_survival_planning_example/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="types-of-calculations" class="level1">
<h1>Types of calculations</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) </span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>A survival trial is planned to be performed with one interim stage and using an O’Brien &amp; Fleming type <img src="https://latex.codecogs.com/png.latex?%5Calpha">-spending approach at <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025">. The interim is planned to be performed after half of the necessary events were observed. It is assumed that the median survival time is 18 months in the treatment group, and 12 months in the control. We assume that the dropout rate is 5% after 1 year and the dropout time is exponentially distributed.</p>
<section id="Case1" class="level2">
<h2 class="anchored" data-anchor-id="Case1">Accrual and follow-up time given</h2>
<p>The patients should be recruited within 12 months assuming uniform accrual. We assume an additional follow-up time of 12 months, i.e., the study should be conducted within 2 years. We also assume the survival time to be exponentially distributed.</p>
<p>In this simplest example, accrual and follow-up time need to be specified and the necessary number of events and patients (total and per month) in order to reach power 90% with the assumed median survival times will be calculated.</p>
<p>The effect size is defined in terms of <code>lambda1</code> and <code>lambda2</code> (you can also specify <code>lambda2</code> and <code>hazardRatio</code>) and the function <code>getLambdaByMedian()</code> is used (for <code>lambda2</code> the direct calculation is illustrated):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">dGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>, </span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb3-5">)</span>
<span id="cb3-6"></span>
<span id="cb3-7">x1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb3-8">  dGS,</span>
<span id="cb3-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getLambdaByMedian</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>), </span>
<span id="cb3-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb3-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb3-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb3-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb3-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb3-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb3-16">)</span>
<span id="cb3-17">x1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 2 looks (group sequential design), one-sided overall significance level 2.5%, power 90%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: treatment lambda(1) = 0.039, control lambda(2) = 0.058, accrual time = 12, accrual intensity = 38.9, follow-up time = 12, dropout rate(1) = 0.05, dropout rate(2) = 0.05, dropout time = 12.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>50%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0015</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0015</td>
<td>0.0245</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.963</td>
<td>1.969</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.593</td>
<td>0.782</td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2525</td>
<td>0.9000</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>467.3</td>
<td>467.3</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td>467.3</td>
</tr>
<tr class="odd">
<td>Cumulative number of events</td>
<td>128.3</td>
<td>256.5</td>
</tr>
<tr class="even">
<td>Expected number of events under H1</td>
<td></td>
<td>224.1</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>13.14</td>
<td>24.00</td>
</tr>
<tr class="even">
<td>Expected study duration under H1</td>
<td></td>
<td>21.26</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0015</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2525</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
<p>We conclude that a maximum number of 257 events needs to be observed to reach 90% power. Under the assumed accrual and follow-up time (and the median survival times) this number of events is expected to be observed if 468 subjects are observed at the end of the trial. This corresponds to about 39 patient per month to be accrued (= <code>accrualIntensity</code>).</p>
<p>The interim analysis is performed after 128.3 events (which in practice needs to be rounded up or down). This number is expected to be observed at analysis time 13.14.</p>
<p>Note that in this case you can also enter the accrual time as <code>accrualTime = c(0,12)</code> and so <code>accrualTime = 12</code> is just a shortcut (see below).</p>
</section>
<section id="sec-Case2" class="level2">
<h2 class="anchored" data-anchor-id="sec-Case2">Accrual time and maximum number of patients given</h2>
<p>Assume that accrual stops after 16 months with 25 patients per month, i.e., after 400 patients were recruited. We now can estimate the necessary follow-up time such that 257 events will be observed at the end of the trial.</p>
<p>There are two ways of defining the situation of <em>given maximum number of subjects</em>: You can either specify <code>accrualTime</code> and <code>maxNumberOfSubjects</code> directly; or you specify <code>accrualTime</code> and <code>accrualIntensity</code>.</p>
<p>In both cases, at given accrual time and number of patients, the follow-up time is calculated.</p>
<p>This is the code and the output for the first case:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">x2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb4-2">  dGS,</span>
<span id="cb4-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb4-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb4-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb4-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb4-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb4-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb4-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span></span>
<span id="cb4-10">)</span>
<span id="cb4-11"></span>
<span id="cb4-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 400</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 15.96226</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 16.82864
[2,] 31.96226</code></pre>
</div>
</div>
<p>This is the code and the output for the second case:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">x2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb10-2">  dGS,</span>
<span id="cb10-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb10-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb10-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb10-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb10-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb10-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb10-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span></span>
<span id="cb10-10">)</span>
<span id="cb10-11"></span>
<span id="cb10-12">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualIntensity</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 25</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 15.96226</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 16.82864
[2,] 31.96226</code></pre>
</div>
</div>
<p>Note that for these two cases entering the accrual time in the form of <code>c(0,16)</code> is mandatory, i.e., you cannot enter just the end of accrual which was the shortcut before.</p>
<p>Alternatively, you might enter the <code>accrualTime</code> as a list in the form</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">atList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb16-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;16"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span></span>
<span id="cb16-3">)</span></code></pre></div></div>
</div>
<p>and then enter <code>accrualTime = atList</code> in <code>getSampleSizeSurvival()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">x2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb17-2">  dGS,</span>
<span id="cb17-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb17-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb17-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb17-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb17-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb17-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> atList</span>
<span id="cb17-9">)</span>
<span id="cb17-10"></span>
<span id="cb17-11">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualIntensity</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 25</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 15.96226</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">x2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 16.82864
[2,] 31.96226</code></pre>
</div>
</div>
</section>
<section id="sec-Case3" class="level2">
<h2 class="anchored" data-anchor-id="sec-Case3">Follow-up time and absolute intensity given</h2>
<p>Assume now that 25 patients can be recruited each month and that there is uniform accrual. We now want to estimate the necessary accrual time if the <em>planned follow-up time is given</em> and equal to 12 as before.</p>
<p>Here, the end of accrual and the number of patients is calculated at given follow-up time and absolute accrual intensity:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">x3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb23-2">  dGS,</span>
<span id="cb23-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb23-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb23-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb23-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb23-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb23-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb23-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, </span>
<span id="cb23-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb23-11">)</span>
<span id="cb23-12"></span>
<span id="cb23-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 435</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">x3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 17.38334</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">x3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 16.79806
[2,] 29.38334</code></pre>
</div>
</div>
</section>
<section id="staggered-patient-entry" class="level2">
<h2 class="anchored" data-anchor-id="staggered-patient-entry">Staggered patient entry</h2>
<p>This case illustrates how the accrual of subjects can be entered if there is piecewise accrual over predefined intervals where it is assumed that accrual within the intervals is uniform.</p>
<p>For example, assume that in the first 3 months, 15 patients, in the second 3 months, 20 patients, and from 6 months to 16 months, 25 patients per month can be accrued.</p>
<p>If the follow-up time at a given number of patients is to be calculated<br>
(Section&nbsp;1.2), <code>accrualTime = c(0, 3, 6, 16)</code> and <code>accrualIntensity = c(15, 20, 25)</code> can be entered as follows, resulting in the calculation of <code>maxNumberOfSubjects</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">x4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb29-2">  dGS,</span>
<span id="cb29-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb29-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb29-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb29-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb29-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb29-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb29-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>)</span>
<span id="cb29-10">)</span>
<span id="cb29-11"></span>
<span id="cb29-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 355</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 23.60973</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 18.83368
[2,] 39.60973</code></pre>
</div>
</div>
<p>Alternatively, you can enter</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1">atList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb35-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt; 3"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb35-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3 - &lt; 6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>,</span>
<span id="cb35-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;= 16"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span></span>
<span id="cb35-5">)</span></code></pre></div></div>
</div>
<p>and run</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1">x4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb36-2">  dGS,</span>
<span id="cb36-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb36-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb36-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb36-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb36-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb36-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> atList</span>
<span id="cb36-9">)</span>
<span id="cb36-10"></span>
<span id="cb36-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span>
<span id="cb36-12">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span>
<span id="cb36-13">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
</div>
<p>If <code>maxNumberOfSubjects</code> is specified, the corresponding list definition is as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1">atList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb37-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt; 3"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>,</span>
<span id="cb37-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3 - &lt; 6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>,</span>
<span id="cb37-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - Inf"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span></span>
<span id="cb37-5">)</span></code></pre></div></div>
</div>
<p>and</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1">x4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb38-2">  dGS,</span>
<span id="cb38-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb38-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb38-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb38-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb38-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb38-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> atList, </span>
<span id="cb38-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">355</span></span>
<span id="cb38-10">)</span>
<span id="cb38-11"></span>
<span id="cb38-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualTime)</span>
<span id="cb38-13">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>followUpTime</span>
<span id="cb38-14">x4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
</div>
<p>does the job.</p>
<p>If the follow-up time is given and the end of accrual is to be calculated (Section&nbsp;1.3), this can be achieved as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">x5 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb39-2">  dGS,</span>
<span id="cb39-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb39-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb39-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), </span>
<span id="cb39-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>), </span>
<span id="cb39-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span></span>
<span id="cb39-8">)</span>
<span id="cb39-9"></span>
<span id="cb39-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(x5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfSubjects)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 421</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">x5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>accrualTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1]  3.00000  6.00000 18.61383</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb43-1">x5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 18.28469
[2,] 30.61383</code></pre>
</div>
</div>
</section>
</section>
<section id="verify-results-by-simulation" class="level1">
<h1>Verify results by simulation</h1>
<p>Assume that the study is planned with 257 events and 400 patients under the assumptions that accrual stops after 16 months with 25 patients per month and the staggered patient entry from above. We now want to verify by simulation the correctness of the results obtained by the analytical formulae.</p>
<p>For this, we first use the function <code>getPowerSurvival()</code> in order to obtain the test characteristics if the study is performed with 257 events. The analysis time is obtained by the analytical formulae and we verify that the power indeed exceeds 90% (note that we have to specify <code>directionUpper = FALSE</code> in order to indicate that <img src="https://latex.codecogs.com/png.latex?p">-values are getting small for <em>negative</em> values of the test statistics, i.e., for observed hazard ratios smaller than 1):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1">y3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb45-2">  dGS,</span>
<span id="cb45-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb45-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb45-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb45-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb45-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb45-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb45-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb45-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>, </span>
<span id="cb45-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb45-12">)</span>
<span id="cb45-13">y3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 18.85699
[2,] 39.74904</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1">y3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.9005251</code></pre>
</div>
</div>
<p>Practically the same result is obtained with the simulation function <code>getSimulationSurvival()</code> (note that <code>plannedEvents = c(129,257)</code> needs to be specified in the simulation tool instead of <code>maxNumberOfEvents = 257</code> in the power calculation):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1">z3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb49-2">  dGS,</span>
<span id="cb49-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb49-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb49-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb49-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb49-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb49-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb49-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb49-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb49-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>), </span>
<span id="cb49-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb49-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb49-14">)</span>
<span id="cb49-15">z3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>         [,1]
[1,] 18.91939
[2,] 39.63640</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb51-1">z3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.9054</code></pre>
</div>
</div>
</section>
<section id="assess-sample-size-reassessment-in-adaptive-survival-design" class="level1">
<h1>Assess sample size reassessment in adaptive survival design</h1>
<p>Assume now that a sample size increase up to a ten-fold of the originally planned number of events is foreseen. Conditional power 90% <em>based on the observed hazard ratios</em> is used to increase the number of events. We can now assess by simulation the magnitude of power increase when using the appropriate method.</p>
<p>Note that we have to make sure that enough subjects are used in the simulation. For this, we set <code>maxNumberOfSubjects = 2000</code> and no dropouts.</p>
<p>Since we perform a data driven sample size recalculation (SSR), we define an inverse normal design with the same parameters as the original group sequential design:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb53-1">dIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb53-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb53-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>, </span>
<span id="cb53-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb53-5">)</span></code></pre></div></div>
</div>
<p>The following code simulates the SSR with conditional power 90% under the observed hazard ratio. <code>minNumberOfEventsPerStage = c(NA,128)</code>, and <code>maxNumberOfEventsPerStage = 10*c(NA,128)</code> defines:</p>
<ul>
<li>no sample size decrease</li>
<li>up to a 10 fold increase of number of events for the final stage.</li>
</ul>
<p>This is compared with the situation without SSR:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#  Without SSR</span></span>
<span id="cb54-2">z0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb54-3">  dIN,</span>
<span id="cb54-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb54-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb54-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb54-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, </span>
<span id="cb54-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>,</span>
<span id="cb54-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb54-10">)</span>
<span id="cb54-11">z0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>          [,1]
[1,]  6.911003
[2,] 10.010260</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb56-1">z0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.9005251</code></pre>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># With SSR</span></span>
<span id="cb58-2">z4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb58-3">  dIN,</span>
<span id="cb58-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, </span>
<span id="cb58-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb58-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb58-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb58-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, </span>
<span id="cb58-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>),</span>
<span id="cb58-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb58-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb58-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>),</span>
<span id="cb58-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>), </span>
<span id="cb58-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23456</span></span>
<span id="cb58-15">)</span>
<span id="cb58-16">z4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>analysisTime</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>          [,1]
[1,]  6.914569
[2,] 15.037551</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1">z4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.9842</code></pre>
</div>
</div>
<p>Finally, we simulate the Type I error rate when using</p>
<ul>
<li><p>the group sequential method</p></li>
<li><p>the inverse normal method</p></li>
</ul>
<p>for analysing the data. The difference here is that the group sequential design uses the logrank tests for the test decision, whereas with the combination test, the <em>increments</em> of the sequence of logrank statistics are combined with the use of the inverse normal combination function. This assures Type I error control also for the data-driven SSR.</p>
<p>The following simulation compares the Type I error rate of the inverse normal method with the Type I error rate of the (inappropriate) use of the group sequential method:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb62-1">dGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb62-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb62-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb62-4">)</span>
<span id="cb62-5">dIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb62-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb62-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span></span>
<span id="cb62-8">)</span>
<span id="cb62-9"></span>
<span id="cb62-10">IN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb62-11">  dIN,</span>
<span id="cb62-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb62-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb62-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb62-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, </span>
<span id="cb62-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>),</span>
<span id="cb62-17">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb62-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb62-19">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>),</span>
<span id="cb62-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>), </span>
<span id="cb62-21">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34567</span></span>
<span id="cb62-22">)</span>
<span id="cb62-23"></span>
<span id="cb62-24">GS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb62-25">  dGS,</span>
<span id="cb62-26">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb62-27">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb62-28">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), </span>
<span id="cb62-29">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, </span>
<span id="cb62-30">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>),</span>
<span id="cb62-31">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb62-32">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, </span>
<span id="cb62-33">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>),</span>
<span id="cb62-34">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>), </span>
<span id="cb62-35">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45678</span></span>
<span id="cb62-36">)</span>
<span id="cb62-37"></span>
<span id="cb62-38">IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.0255</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1">GS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.0352</code></pre>
</div>
</div>
<p>We see that, indeed, the Type I error rate is controlled for the inverse normal but not for the group sequential method (see also <a href="https://vignettes.rpact.com/html/rpact_ggplot_examples.html">this vignette</a>).</p>
</section>
<section id="references" class="level1">
<h1>References</h1>
<ol type="1">
<li>Gernot Wassmer and Werner Brannath, <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, Springer 2016, ISBN 978-3319325606</li>
</ol>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Survival</category>
  <category>Sample size</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_survival_planning_example/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_24.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Enhanced Futility Bounds Specification with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Daniel Sabanés Bové](https://www.linkedin.com/in/danielsabanesbove/ &quot;Visit Daniel Sabanés Bové&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0002-0176-9239 &quot;Visit Daniel Sabanés Bové&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/planning/rpact_futility_bounds/</link>
  <description><![CDATA[ 




<section id="introduction" class="level2">
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>This vignette demonstrates how to specify, transform, and work with futility bounds in <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a>.</p>
<p>Futility stopping is an important tool in adaptive and group sequential designs, allowing early termination if accumulating data suggests that confirming the alternative hypothesis is unlikely. Traditionally, futility bounds are specified on the <strong>z-value</strong> or <strong>p-value</strong> scale, but in practice it is often desirable to express these boundaries on other scales, such as the <strong>effect size scale</strong>, <strong>conditional power</strong>, <strong>Bayesian predictive power</strong>, or the <strong>reverse conditional power</strong>.</p>
<p>In this vignette, you will learn:</p>
<ul>
<li>how futility bounds arise in classical designs,</li>
<li>how <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a> handles these boundaries across multiple scales,</li>
<li>how <a href="https://docs.rpact.org/reference/getFutilityBounds.html"><code>getFutilityBounds()</code></a> can translate futility bound values consistently between scales,</li>
<li>and how these transformations are used in real trial-planning workflows.</li>
</ul>
<section id="current-situation" class="level3">
<h3 class="anchored" data-anchor-id="current-situation">Current situation</h3>
<p>See the following example of group sequential designs with futility bounds specified or calculated on the z-value scale in <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a> version &lt; <code>4.3.0</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb2-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb2-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb2-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb2-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb2-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>)</span>
<span id="cb2-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 3 looks (group sequential design)</em></p>
<p>O’Brien &amp; Fleming design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0628, ASN H1 0.8528, ASN H01 0.8821, ASN H0 0.7059.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>-Inf</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0356</td>
<td>0.4617</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.048</td>
<td>0</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The <strong>derivation</strong> of futility bounds is possible with the use of the beta spending function approach. The following example yields similar futility bounds as in the example from above:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsKD"</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaB =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>,</span>
<span id="cb3-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityStops =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-9">)</span>
<span id="cb3-10">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 3 looks (group sequential design)</em></p>
<p>O’Brien &amp; Fleming type alpha spending design and Kim &amp; DeMets beta spending (gammaB = 1.3), non-binding futility, futility stops c(TRUE, FALSE), one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0586, ASN H1 0.8634, ASN H01 0.8829, ASN H0 0.7038.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0479</td>
<td>0.0479</td>
<td>0.2000</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0001</td>
<td>0.0060</td>
<td>0.0231</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>3.710</td>
<td>2.511</td>
<td>1.993</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>-0.001</td>
<td>-Inf</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0204</td>
<td>0.4370</td>
<td>0.8000</td>
</tr>
<tr class="even">
<td>Futility probabilities under H1</td>
<td>0.048</td>
<td>0</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_futility_bounds/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>In comparison, recall how a Fisher’s combination test design is specified in <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a> and how the futility boundaries look like:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb5-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb5-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">method =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fullAlpha"</span>,</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha0Vec =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb5-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design)</em></p>
<p>Full last stage level design, binding futility, one-sided overall significance level 2.5%, undefined endpoint.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0084</td>
<td>0.0128</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0084</td>
<td>0.0084</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0084123</td>
<td>0.0010734</td>
<td>0.0007284</td>
</tr>
<tr class="odd">
<td>Futility boundary (separate p-value scale)</td>
<td>0.5000</td>
<td>1.0000</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The key points are:</p>
<ul>
<li>For group sequential designs, futility bounds have to be specified on the <img src="https://latex.codecogs.com/png.latex?z">-value scale. For Fisher’s combination test, they are instead specified on the separate <img src="https://latex.codecogs.com/png.latex?p">-value scale.</li>
<li>It is desired, however, to also define futility bounds on other scales, e.g., the conditional power scale.</li>
</ul>
<p>On the effect size scale, futility bounds are already shown in the output of the <code>getSampleSize...()</code> and <code>getPower...()</code> functions. The following example illustrates this when calculating sample sizes:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb6-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb6-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb6-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb6-11">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sample size calculation for a continuous endpoint</em></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test (normal approximation), H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.3</td>
<td>0.623</td>
<td>0.312</td>
<td>0.208</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.5</td>
<td>1.039</td>
<td>0.520</td>
<td>0.346</td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.3</td>
<td>0</td>
<td>0.064</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.5</td>
<td>0</td>
<td>0.106</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0359</td>
<td>0.4633</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.3</td>
<td>124.0</td>
<td>248.0</td>
<td>372.0</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.5</td>
<td>44.6</td>
<td>89.3</td>
<td>133.9</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.3</td>
<td></td>
<td></td>
<td>296.2</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.5</td>
<td></td>
<td></td>
<td>106.6</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.5003</td>
<td>0.2459</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.0833</td>
<td>0.4444</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0003</td>
<td>0.0069</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0359</td>
<td>0.4274</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.5000</td>
<td>0.2391</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.0474</td>
<td>0.0171</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
</div>
<p>This output shows, among others:</p>
<ul>
<li>futility boundaries on the z-scale,</li>
<li>their effect-size equivalents,</li>
<li>and the expected sample size implications.</li>
</ul>
</section>
</section>
<section id="the-function-getfutilitybounds" class="level2">
<h2 class="anchored" data-anchor-id="the-function-getfutilitybounds">The Function getFutilityBounds()</h2>
<ul>
<li>The function <a href="https://docs.rpact.org/reference/getFutilityBounds.html"><code>getFutilityBounds()</code></a> converts futility bounds between different scales.</li>
<li>For one-sided group sequential designs, futility bounds can be specified for different scales:
<ul>
<li>the <img src="https://latex.codecogs.com/png.latex?z">-value or <img src="https://latex.codecogs.com/png.latex?p">-value scale</li>
<li>the effect size scale</li>
<li>the reverse conditional power scale</li>
<li>the conditional power scale, where one can select between:
<ul>
<li>the conditional power at some specified effect size</li>
<li>the conditional power at observed effect</li>
<li>the Bayesian predictive power</li>
</ul></li>
</ul></li>
</ul>
<p>For applications where the direction of the test decision is relevant, it can be specified with <code>directionUpper = TRUE</code> (the default), meaning that larger test statistics yield smaller p-values, or <code>directionUpper = FALSE</code> for the opposite direction.</p>
<p>Generally, the function can also be applied to the inverse normal or Fisher combination tests. Note that specifying futility bounds on different conditional power scales requires defining a two-stage design.</p>
<p>Before looking at the formulas, the following small examples demonstrate how direct scale conversion works.</p>
<p><strong>Example: z → p</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span></span>
<span id="cb7-5">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.5</code></pre>
</div>
</div>
<p><strong>Example: p → z</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span></span>
<span id="cb9-5">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.0000000 0.5244005</code></pre>
</div>
</div>
<p>Here we show an example of how we would use the lower direction:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb11-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb11-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb11-6">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1]  0.0000000 -0.5244005</code></pre>
</div>
</div>
<p><strong>Example: p → z → design → summary</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span></span>
<span id="cb13-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 3 looks (group sequential design)</em></p>
<p>O’Brien &amp; Fleming design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0668, ASN H1 0.849, ASN H01 0.842, ASN H0 0.6214.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0.524</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0359</td>
<td>0.4635</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.047</td>
<td>0.018</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>Example: Conditional power at observed effect → p</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span>,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb14-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb14-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb14-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"condPowerAtObserved"</span>,</span>
<span id="cb14-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span></span>
<span id="cb14-10">    )</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.1223971</code></pre>
</div>
</div>
<p>This and the other conversions will become clearer with the theoretical derivations below.</p>
<section id="z-value-and-p-value-scale" class="level3">
<h3 class="anchored" data-anchor-id="z-value-and-p-value-scale">z-value and p-value scale</h3>
<p>A futility bound <img src="https://latex.codecogs.com/png.latex?u_1%5E0"> on the <img src="https://latex.codecogs.com/png.latex?z%5C,">-value scale is transformed to the <img src="https://latex.codecogs.com/png.latex?p%5C,">-value scale and vice versa via <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%20%20%5Calpha_0%20=%201%20-%20%5CPhi(u_1%5E0)%0A%5C;%5Chbox%7B%20and%20%20%7D%5C;%20u_1%5E0%20=%20%5CPhi%5E%7B-1%7D(1%20-%20%5Calpha_0),%20%5Cend%7Bequation%7D"> respectively. This simple relationship forms the basis for all other, more complex transformations.</p>
</section>
<section id="effect-estimate-scale" class="level3">
<h3 class="anchored" data-anchor-id="effect-estimate-scale">Effect estimate scale</h3>
<p>Here we explain how interim effect estimates relate to z-values through the Fisher information.</p>
<p>A futility bound <img src="https://latex.codecogs.com/png.latex?u_1%5E0"> on the <img src="https://latex.codecogs.com/png.latex?z%5C,">-value scale is transformed to the effect size scale and vice versa via</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%20%20%5Chat%5Cdelta_0%20=%20%5Cfrac%7Bu_1%5E0%7D%7B%5Csqrt%7BI_1%7D%7D%20%5C;%5Chbox%7B%20and%20%20%7D%5C;%20u_1%5E0%0A=%20%5Chat%5Cdelta_0%20%5Csqrt%7BI_1%7D,%20%5Cend%7Bequation%7D"></p>
<p>respectively, where <img src="https://latex.codecogs.com/png.latex?I_1"> is the first stage Fisher information.</p>
<p>For example, for a one-sample test with continuous endpoint, known variance <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2">, and first stage sample size <img src="https://latex.codecogs.com/png.latex?n_1">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20I_1%20=%20%5Cfrac%7Bn_1%7D%7B%5Csigma%5E2%7D%5C;.%20%5Cend%7Bequation%7D"></p>
<p>For a two-sample test with continuous endpoint, known variance <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2">, allocation ratio <img src="https://latex.codecogs.com/png.latex?r">, and first stage overall sample size <img src="https://latex.codecogs.com/png.latex?N_1">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20I_1%20=%20%5Cfrac%7Br%7D%7B(1%20+%20r)%5E2%7D%5C,%20%5Cfrac%7BN_1%7D%7B%5Csigma%5E2%7D%5C;.%0A%5Cend%7Bequation%7D"></p>
<p>For a one-sample test with binary endpoint testing <img src="https://latex.codecogs.com/png.latex?H_0:%20%5Cpi%20=%20%5Cpi_0"> and first stage sample size <img src="https://latex.codecogs.com/png.latex?n_1">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20I_1%20=%20%5Cfrac%7Bn_1%7D%7B%5Cpi_0(1%20-%20%5Cpi_0)%7D%5C;.%20%5Cend%7Bequation%7D"></p>
<p>This is an example for the latter case:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">pi0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb16-2">n1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span></span>
<span id="cb16-3">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb16-4">pi0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb16-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb16-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb16-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"effectEstimate"</span>,</span>
<span id="cb16-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">information1 =</span> n1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (pi0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pi0))</span>
<span id="cb16-9">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.3204939</code></pre>
</div>
</div>
<p>You can check with the calculation from <code>getPowerRates()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> futilityBounds</span>
<span id="cb18-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb18-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb18-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> pi0,</span>
<span id="cb18-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb18-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n1</span>
<span id="cb18-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb18-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fetch</span>(futilityBoundsEffectScale)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$futilityBoundsEffectScale
          [,1]
[1,] 0.3204939</code></pre>
</div>
</div>
<p>For a two-sample test with binary endpoint testing the difference <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%20-%20%5Cpi_2">, allocation ratio <img src="https://latex.codecogs.com/png.latex?r">, and first stage overall sample size <img src="https://latex.codecogs.com/png.latex?N_1">, an approximation for <img src="https://latex.codecogs.com/png.latex?I_1"> can be obtained with a guess about the unknown probabilities, <img src="https://latex.codecogs.com/png.latex?%5Cpi_1"> and <img src="https://latex.codecogs.com/png.latex?%5Cpi_2">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20I_1%20=%20%5Cfrac%7Br%7D%7B%5Cpi_1(1%20-%20%5Cpi_1)%20+%20r%20%5C,%20%5Cpi_2(1%20-%20%5Cpi_2)%7D%5C,%0A%5Cfrac%7BN_1%7D%7B1%20+%20r%7D%20%5Cend%7Bequation%7D"></p>
<p>An example is the following:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">pi1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb20-2">pi2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span></span>
<span id="cb20-3">N1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span></span>
<span id="cb20-4">r <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb20-5">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb20-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb20-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb20-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb20-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"effectEstimate"</span>,</span>
<span id="cb20-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">information1 =</span> r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (pi1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pi1) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pi2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pi2)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r)</span>
<span id="cb20-11">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] -0.1137431</code></pre>
</div>
</div>
<p>Check against the calculation from <code>getPowerRates()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb22-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> futilityBounds),</span>
<span id="cb22-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb22-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> pi1,</span>
<span id="cb22-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> pi2,</span>
<span id="cb22-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> r,</span>
<span id="cb22-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N1</span>
<span id="cb22-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb22-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fetch</span>(futilityBoundsEffectScale)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$futilityBoundsEffectScale
           [,1]
[1,] -0.1111636</code></pre>
</div>
</div>
<p>For a survival design using the log-rank test for testing the log-hazard ratio,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20I_1%20=%20%5Cfrac%7Br%7D%7B(1%20+%20r)%5E2%7D%5C,%20D_1%5C;,%20%5Cend%7Bequation%7D"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?D_1"> is the total number of first stage events and <img src="https://latex.codecogs.com/png.latex?r"> is the allocation ratio.</p>
<p>For example, in the survival case, assume that the interim analysis is planned after observing <img src="https://latex.codecogs.com/png.latex?D_1%20=%2030"> events. With a balanced randomization (<img src="https://latex.codecogs.com/png.latex?r%20=%201">), the futility bound is transformed from the <img src="https://latex.codecogs.com/png.latex?z"> value scale to the hazard ratio scale through</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">r <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb24-2">D1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span></span>
<span id="cb24-3">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb24-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb24-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb24-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"effectEstimate"</span>,</span>
<span id="cb24-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">information1 =</span> r <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D1</span>
<span id="cb24-9">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb24-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exp</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 1.075762</code></pre>
</div>
</div>
<p>This is the same results as obtained from <code>getPowerSurvival()</code></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb26-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb26-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> futilityBounds</span>
<span id="cb26-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb26-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb26-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>,</span>
<span id="cb26-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D1</span>
<span id="cb26-9">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb26-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fetch</span>(futilityBoundsEffectScale)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>$futilityBoundsEffectScale
         [,1]
[1,] 1.075762</code></pre>
</div>
</div>
<p>For other testing situations, this needs to be derived accordingly.</p>
</section>
<section id="conditional-power-at-specified-effect-size-for-the-group-sequential-and-inverse-normal-combination-case" class="level3">
<h3 class="anchored" data-anchor-id="conditional-power-at-specified-effect-size-for-the-group-sequential-and-inverse-normal-combination-case">Conditional power at specified effect size for the group sequential and inverse normal combination case</h3>
<p>Conditional power at a specified effect size is typically used during planning when the anticipated alternative is fixed. Futility rules of the form “stop if the conditional power is lower than a threshold” are common, but require explicit conversion to the underlying z-scale.</p>
<p>At interim, the conditional power is given by</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%5Cbegin%7Bsplit%7D%20%20%20%5Ctextrm%7BCP%7D_%7BH_1%7D%20%20&amp;=%20P_%7BH_1%7D(Z_2%5E*%20%5Cgeq%20u_2%20%5Cmid%0Az_1)%20%5C%5C%20%20%20&amp;=%20P_%7BH_1%7D%5Cleft(Z_2%20%5Cgeq%20%5Cfrac%7Bu_2%20-%20w_1%20z_1%7D%7Bw_2%7D%5Cright)%20%5C%5C%20%20%20&amp;=%201%20-%0A%5CPhi%5Cleft(%5Cfrac%7Bu_2%20-%20w_1%20z_1%7D%7Bw_2%7D%20-%20%5Cdelta%20%5Csqrt%7BI_2%7D%5Cright)%5C;,%20%5Cend%7Bsplit%7D%0A%5Cend%7Bequation%7D"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?w_1%20=%20%5Csqrt%7Bt_1%7D">, <img src="https://latex.codecogs.com/png.latex?w_2%20=%20%5Csqrt%7B1%20-%20t_1%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is the treatment effect, and <img src="https://latex.codecogs.com/png.latex?I_2"> is the second stage Fisher information.</p>
<p>Specifying a lower bound <img src="https://latex.codecogs.com/png.latex?cp_0"> for the conditional power with regard to futility stopping yields</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%5Cbegin%7Bsplit%7D%20%20%20%5Ctextrm%7BCP%7D_%7BH_1%7D%20&amp;%5Cgeq%20cp_0%20%20%5C%5C%5B3mm%5D%20%20%20%5Cfrac%7Bu_2%20-%0Aw_1%20z_1%7D%7Bw_2%7D%20-%20%5Cdelta%20%5Csqrt%7BI_2%7D%20&amp;%5Cleq%20%20%5CPhi%5E%7B-1%7D(1%20-%20cp_0)%20%5C%5C%20%20%20z_1%20&amp;%5Cgeq%0A%5Cfrac%7Bu_2%20-%20w_2%5Cbig(%5CPhi%5E%7B-1%7D(1%20-%20cp_0)%20+%20%5Cdelta%20%5Csqrt%7BI_2%7D%5Cbig)%7D%7Bw_1%7D%20=:%20u_1%5E0%0A%5C;.%20%5Cend%7Bsplit%7D%20%5Cend%7Bequation%7D"></p>
<p>as a lower bound on the <img src="https://latex.codecogs.com/png.latex?z">-value scale for proceeding the trial (without stopping for futility).</p>
<p>We note that the formulas depend on the effect size <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> and the second stage Fisher information <img src="https://latex.codecogs.com/png.latex?I_2">.</p>
</section>
<section id="conditional-power-at-observed-effect-for-the-group-sequential-and-inverse-normal-combination-case" class="level3">
<h3 class="anchored" data-anchor-id="conditional-power-at-observed-effect-for-the-group-sequential-and-inverse-normal-combination-case">Conditional power at observed effect for the group sequential and inverse normal combination case</h3>
<p>This variant replaces <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> with the interim estimate <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cdelta">. Then, the conditional power depends only on the information rate and therefore avoids assumptions about the true effect size.</p>
<p>If the observed treatment effect estimate, <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cdelta">, is used to calculate the conditional power,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Chat%5Cdelta%20%5Csqrt%7BI_2%7D%20=%20z_1%5Csqrt%7B%5Cfrac%7BI_2%7D%7BI_1%7D%7D%20%5C;,%0A%5Cend%7Bequation%7D"></p>
<p>and therefore</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D%20=%20%201-%20%5CPhi%5Cleft(%5Cfrac%7Bu_2%20-%20w_1%0Az_1%7D%7Bw_2%7D%20-%20z_1%5Csqrt%7B%5Cfrac%7BI_2%7D%7BI_1%7D%7D%5Cright)%20%5C;,%20%5Cend%7Bequation%7D"></p>
<p>which depends on <img src="https://latex.codecogs.com/png.latex?I_1"> and <img src="https://latex.codecogs.com/png.latex?I_2"> only through <img src="https://latex.codecogs.com/png.latex?I_2%20/%20I_1%20=%20(1%20-%20t_1)/t_1">, so absolute values are irrelevant. The formula simplifies to</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D%20=%20%201%20-%20%5CPhi%5Cleft(%5Cfrac%7Bu_2%20-%20z_1%20/%0A%5Csqrt%7Bt_1%7D%7D%7B%5Csqrt%7B1%20-%20t_1%7D%7D%20%5Cright)%20%5C;.%20%5Cend%7Bequation%7D"></p>
<p>A futility bound on the <img src="https://latex.codecogs.com/png.latex?z">-value scale at given bound for <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D"> is obtained by simple conversion.</p>
</section>
<section id="bayesian-predictive-power-for-the-group-sequential-and-inverse-normal-combination-case" class="level3">
<h3 class="anchored" data-anchor-id="bayesian-predictive-power-for-the-group-sequential-and-inverse-normal-combination-case">Bayesian predictive power for the group sequential and inverse normal combination case</h3>
<p>The Bayesian predictive power integrates a prior distribution and is widely used in modern decision frameworks (e.g.&nbsp;incorporating historical information or skeptical priors). The predictive power incorporates both uncertainty in the effect as well as the remaining sample size. This makes it particularly attractive for futility stopping, where we want to quantify the chance of eventual success after considering prior information.</p>
<p>The Bayesian predictive power using a normal prior <img src="https://latex.codecogs.com/png.latex?%5Cpi_0"> with mean <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0"> and variance <img src="https://latex.codecogs.com/png.latex?1%20/%20I_0"> can be shown to be (cf., <span class="citation" data-cites="wassmer2025">Wassmer and Brannath (2025)</span>, Sect. 7.4)</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20=%201%20-%20%5CPhi%5Cleft(%5Csqrt%7B%5Cfrac%7BI_0%20+%20I_1%7D%7BI_0%0A+%20I_1%20+%20I_2%7D%7D%5Cleft(%5Cfrac%7Bu_2%20-%20w_1%20z_1%7D%7Bw_2%7D%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Chat%5Cdelta_%7B%5Cpi_0%7D%5Csqrt%7BI_2%7D%5Cright)%5Cright)%5C;,%20%5Cend%7Bequation%7D"></p>
<p>where</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation*%7D%20%5Chat%5Cdelta_%7B%5Cpi_0%7D%20=%20%5Cdelta_0%20%5Cfrac%7BI_0%7D%7BI_0%20+%20I_1%7D%20+%0A%5Chat%5Cdelta%20%5Cfrac%7BI_1%7D%7BI_0%20+%20I_1%7D%5C;.%20%5Cend%7Bequation*%7D"></p>
<p>The Bayesian predictive power using a flat (improper) prior distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi_0"> (implying <img src="https://latex.codecogs.com/png.latex?I_0%20=%200">) is then</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20=%201%20-%20%5CPhi%5Cleft(%5Csqrt%7B%5Cfrac%7BI_1%7D%7BI_1%20+%0AI_2%7D%7D%5Cleft(%5Cfrac%7Bu_2%20-%20w_1%20z_1%7D%7Bw_2%7D%20-%0Az_1%5Csqrt%7B%5Cfrac%7BI_2%7D%7BI_1%7D%7D%5Cright)%5Cright)%5C;.%20%5Cend%7Bequation%7D"></p>
<p>As for the conditional power at observed effect, <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D"> depends on <img src="https://latex.codecogs.com/png.latex?I_1"> and <img src="https://latex.codecogs.com/png.latex?I_2"> only through <img src="https://latex.codecogs.com/png.latex?I_2%20/%20I_1">, so absolute values again are irrelevant. With the specifications from above, this yields</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20=%20%201%20-%20%5CPhi%5Cleft(%5Cfrac%7B%5Csqrt%7Bt_1%7D%20%5C;%20u_2%20-%0Az_1%20%7D%7B%5Csqrt%7B1%20-%20t_1%7D%7D%20%5Cright)%20%5C;.%20%5Cend%7Bequation%7D"></p>
<p>A futility bound on the <img src="https://latex.codecogs.com/png.latex?z">-value scale at given bound for <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D"> is obtained by simple conversion.</p>
</section>
<section id="reverse-conditional-power-scale" class="level3">
<h3 class="anchored" data-anchor-id="reverse-conditional-power-scale">Reverse conditional power scale</h3>
<p>According to <span class="citation" data-cites="tan1998clinical">Tan et al. (1998)</span>, the reverse conditional power, RCP, is an alternative tool for assessing futility of a trial. They call this “Reverse stochastic curtailment”.</p>
<p>RCP can be understood as a “reverse” view of conditional power: instead of asking how likely we are to succeed, we ask how surprising the interim data would be if we were destined to succeed. Low RCP therefore signals that the current interim results are incompatible with ultimate success, suggesting futility.</p>
<p>For a two-stage trial using test statistics <img src="https://latex.codecogs.com/png.latex?Z_1"> and <img src="https://latex.codecogs.com/png.latex?Z_2%5E*"> at interim and at the final stage, respectively, the RCP is the conditional probability of obtaining results at least as disappointing as the current results given that a significant result will be obtained at the end of the trial.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?t_1"> be the information rate at interim. (Note that this relates to the absolute Fisher information values mentioned above via <img src="https://latex.codecogs.com/png.latex?t_1%20=%20I_1%20/%20(I_1%20+%20I_2)">.) The formula for RCP is then:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%20%20%5Ctextrm%7BRCP%7D%20=%20P(Z_1%20%5Cleq%20z_1%20%7C%20Z_2%5E*%20=%20u_2)%20=%0A%5CPhi%5Cleft(%5Cfrac%7Bz_1%20%20-%20%5Csqrt%7Bt_1%7D%20u_2%7D%7B%5Csqrt%7B1%20-%20t_1%7D%7D%20%5Cright)%20%5Cend%7Bequation%7D"></p>
<p>which is independent from the alternative because <img src="https://latex.codecogs.com/png.latex?Z_2%5E*"> is a sufficient statistic (cf., <span class="citation" data-cites="ortega2025futility">Ortega-Villa et al. (2025)</span>).</p>
<p>Interestingly, this coincides exactly with the predictive power previously obtained using a flat prior and the specified information rates, thereby allowing an alternative interpretation of Bayesian predictive power.</p>
<p>One attractive choice is stopping for futility if <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BRCP%7D%20%5Cleq%200.025"> (which corresponds to <img src="https://latex.codecogs.com/png.latex?z%20%5Cleq%200"> for two-stage design at level <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200.025"> with no early stopping).</p>
</section>
<section id="conditional-power-at-specified-effect-size-for-fishers-combination-test" class="level3">
<h3 class="anchored" data-anchor-id="conditional-power-at-specified-effect-size-for-fishers-combination-test">Conditional power at specified effect size for Fisher’s combination test</h3>
<p>If <img src="https://latex.codecogs.com/png.latex?p_1%3Eu_2">, at interim, the conditional power can be shown to be</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%5Cbegin%7Bsplit%7D%20%20%20%5Ctextrm%7BCP%7D_%7BH_1%7D%20%20&amp;=%20P_%7BH_1%7D(p_1%20p_2%5E%7Bw_2%7D%20%5Cleq%0Au_2%20%5Cmid%20p_1)%20%5C%5C%5B3mm%5D%20%20%20&amp;=%20%5CPhi%5Cleft(%5CPhi%5E%7B-1%7D%5Cleft(%5Cleft(%5Cfrac%7Bu_2%7D%7B1%20-%0A%5CPhi(z_1)%7D%5Cright)%5E%7B1/w_2%7D%5Cright)%20+%20%5Cdelta%20%5Csqrt%7BI_2%7D%5Cright)%5C;,%20%5Cend%7Bsplit%7D%0A%5Cend%7Bequation%7D"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?w_2%20=%20%5Csqrt%7B%5Cfrac%7B1%20-%20t_1%7D%7Bt_1%7D%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is the treatment effect, and <img src="https://latex.codecogs.com/png.latex?I_2"> is the second stage Fisher information.</p>
<p>If <img src="https://latex.codecogs.com/png.latex?p_1%5Cleq%20u_2">, due to stochastic curtailment, <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BCP%7D_%7BH_1%7D%20=%201">.</p>
<p>Specifying an upper bound <img src="https://latex.codecogs.com/png.latex?cp_0"> for the conditional power with regard to futility stopping yields</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%5Cbegin%7Bsplit%7D%20%20%20%5Ctextrm%7BCP%7D_%7BH_1%7D%20&amp;%5Cgeq%20cp_0%20%20%5C%5C%5B1mm%5D%0A%5CLeftrightarrow%20%5Cquad%20z_1%20&amp;%5Cgeq%20%5CPhi%5E%7B-1%7D%5Cleft(1%20-%0A%5Cfrac%7Bu_2%7D%7B%5Cleft(%5CPhi(%5CPhi%5E%7B-1%7D(cp_0)%20-%20%5Cdelta%20%5Csqrt%7BI_2%7D)%5Cright)%5E%7Bw_2%7D%7D%5Cright)%0A=:%20u_1%5E0%20%5C;.%20%5Cend%7Bsplit%7D%20%5Cend%7Bequation%7D"></p>
<p>as a lower bound for proceeding the trial (without stopping for futility).</p>
</section>
<section id="conditional-power-at-observed-effect-for-fishers-combination-test" class="level3">
<h3 class="anchored" data-anchor-id="conditional-power-at-observed-effect-for-fishers-combination-test">Conditional power at observed effect for Fisher’s combination test</h3>
<p>If <img src="https://latex.codecogs.com/png.latex?p_1%3Eu_2"> and if the observed treatment effect estimate, <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cdelta">, is used to calculate the conditional power,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D%20=%0A%5CPhi%5Cleft(%5CPhi%5E%7B-1%7D%5Cleft(%5Cleft(%5Cfrac%7Bu_2%7D%7B1%20-%20%5CPhi(z_1)%7D%5Cright)%5E%7B1/w_2%7D%5Cright)%20+%0Az_1%5Csqrt%7B%5Cfrac%7BI_2%7D%7BI_1%7D%7D%5Cright)%5C;.%20%5Cend%7Bequation%7D"></p>
<p>If <img src="https://latex.codecogs.com/png.latex?p_1%5Cleq%20u_2">, <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D%20=%201">.</p>
<p>The futility bound is then found numerically by finding the minimum <img src="https://latex.codecogs.com/png.latex?z_1"> value fulfilling</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BCP%7D_%7B%5Chat%20H_1%7D%20%5Cgeq%20cp_0%20%5C;.%20%5Cend%7Bequation%7D"></p>
</section>
<section id="bayesian-predictive-power-for-fishers-combination-test" class="level3">
<h3 class="anchored" data-anchor-id="bayesian-predictive-power-for-fishers-combination-test">Bayesian predictive power for Fisher’s combination test</h3>
<p>If <img src="https://latex.codecogs.com/png.latex?p_1%3Eu_2"> and we use a flat (improper) prior distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi_0"> on the treatment effect <img src="https://latex.codecogs.com/png.latex?%5Cdelta">, the Bayesian predictive power is</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20=%20%20%5CPhi%5Cleft(%5Csqrt%7B%5Cfrac%7BI_1%7D%7BI_1%20+%0AI_2%7D%7D%5Cleft(%20%5CPhi%5E%7B-1%7D%5Cleft(%5Cleft(%5Cfrac%7Bu_2%7D%7B1%20-%20%5CPhi(z_1)%7D%5Cright)%5E%7B1/w_2%7D%5Cright)%0A+%20z_1%5Csqrt%7B%5Cfrac%7BI_2%7D%7BI_1%7D%7D%5Cright)%5Cright)%5C;,%20%5Cend%7Bequation%7D"> If <img src="https://latex.codecogs.com/png.latex?p_1%5Cleq%20u_2">, <img src="https://latex.codecogs.com/png.latex?%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20=%201">.</p>
<p>The futility bound is found numerically by finding the minimum <img src="https://latex.codecogs.com/png.latex?z_1"> value fulfilling</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bequation%7D%20%20%20%5Ctextrm%7BPP%7D_%7B%5Cpi_0%7D%20%5Cgeq%20cp_0%20%20%5C;.%20%5Cend%7Bequation%7D"></p>
</section>
</section>
<section id="examples" class="level2">
<h2 class="anchored" data-anchor-id="examples">Examples</h2>
<p>In this final section, each example contrasts two scales.</p>
</section>
<section id="p-value-vs.-conditional-power-at-observed-effect" class="level2">
<h2 class="anchored" data-anchor-id="p-value-vs.-conditional-power-at-observed-effect">p-value vs.&nbsp;conditional power at observed effect</h2>
<p>The original promising zone approach (<span class="citation" data-cites="mehta2011adaptive">Mehta and Pocock (2011)</span>) proposes that, if the conditional power at the observed effect exceeds 50%, the conventional test statistic may still be used after a sample size increase, with later work suggesting refined threshold values.</p>
<p>We illustrate how this translates to the <img src="https://latex.codecogs.com/png.latex?p">-value scale, i.e., for which <img src="https://latex.codecogs.com/png.latex?p">-values a sample size increase might be performed. It shows specifically that only for relatively small <img src="https://latex.codecogs.com/png.latex?p">-values (<img src="https://latex.codecogs.com/png.latex?p%20%3C%200.081">) a sample size increase is allowed whereas for more interesting cases (e.g., <img src="https://latex.codecogs.com/png.latex?p%20=%200.114"> yielding conditional power <img src="https://latex.codecogs.com/png.latex?0.35">) would not trigger an increase. This may be viewed as questionable and was criticized by others (e.g., <span class="citation" data-cites="glimm2012comments">Glimm (2012)</span>).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb29-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb29-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb29-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb29-5">)</span>
<span id="cb29-6"></span>
<span id="cb29-7">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb29-8"></span>
<span id="cb29-9">y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb29-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb29-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb29-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"condPowerAtObserved"</span></span>
<span id="cb29-14">    )</span>
<span id="cb29-15"></span>
<span id="cb29-16"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb29-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pValue =</span> futilityBounds,</span>
<span id="cb29-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">condPower =</span> y) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-19"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>( <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pValue, condPower)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(</span>
<span id="cb29-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.081</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.114</span>),</span>
<span id="cb29-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>,</span>
<span id="cb29-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>,</span>
<span id="cb29-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb29-26">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(</span>
<span id="cb29-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb29-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>,</span>
<span id="cb29-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>,</span>
<span id="cb29-31">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb29-32">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.081</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.114</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb29-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_futility_bounds/index_files/figure-html/unnamed-chunk-20-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb30-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb30-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"condPowerAtObserved"</span>,</span>
<span id="cb30-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span></span>
<span id="cb30-6">    )</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.11398692 0.08101828</code></pre>
</div>
</div>
<p>As described above, we can now see that when the interim analysis is at <img src="https://latex.codecogs.com/png.latex?t_1%20=%200.5"> information rate (i.e.&nbsp;at half of the total information), a p-value boundary of approximately 0.081 corresponds to a conditional power at observed effect of 50%. If the conditional power threshold is lowered to 35%, the corresponding p-value boundary increases to approximately 0.114.</p>
<section id="predictive-power-vs.-conditional-power-at-observed-effect" class="level3">
<h3 class="anchored" data-anchor-id="predictive-power-vs.-conditional-power-at-observed-effect">Predictive power vs.&nbsp;conditional power at observed effect</h3>
<p>Here we illustrate how predictive power and conditional power at observed effect relate to each other. We select a design with no early efficacy stops and the interim at information rate 0.40:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb32-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span>,</span>
<span id="cb32-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-5">)</span>
<span id="cb32-6"></span>
<span id="cb32-7">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>)</span>
<span id="cb32-8"></span>
<span id="cb32-9">y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb32-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb32-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb32-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"predictivePower"</span></span>
<span id="cb32-14">    )</span>
<span id="cb32-15">dat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb32-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zValue =</span> futilityBounds,</span>
<span id="cb32-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">CP =</span> y,</span>
<span id="cb32-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">out =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pred"</span></span>
<span id="cb32-19">)</span>
<span id="cb32-20"></span>
<span id="cb32-21">y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb32-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb32-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span>,</span>
<span id="cb32-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"condPowerAtObserved"</span></span>
<span id="cb32-26">    )</span>
<span id="cb32-27">dat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dat <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rbind</span>(</span>
<span id="cb32-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb32-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zValue =</span> futilityBounds,</span>
<span id="cb32-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">CP =</span> y,</span>
<span id="cb32-31">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">out =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cond"</span></span>
<span id="cb32-32">    )</span>
<span id="cb32-33">)</span>
<span id="cb32-34"></span>
<span id="cb32-35">dat <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(zValue, CP, out)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb32-37">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> out), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb32-38">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb32-39">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_futility_bounds/index_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>The Bayesian predictive power is always closer to 0.50 than the conditional power at observed effect and hence downweighs extreme results: For example, when the conditional power is only 1% then the predictive power is still 5%. The two power scales intersect at 50%, corresponding to a z-value of 1.170.</p>
</section>
<section id="p-value-vs.-bayesian-predictive-powerreverse-conditional-power" class="level3">
<h3 class="anchored" data-anchor-id="p-value-vs.-bayesian-predictive-powerreverse-conditional-power">p-value vs.&nbsp;Bayesian predictive power/reverse conditional power</h3>
<p>Both Bayesian predictive power/RCP and p-values are effect-size independent scales. Here we illustrate how they relate to each other for a design with no early efficacy stop at information rate = 0.5.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb33-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb33-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span>,</span>
<span id="cb33-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span></span>
<span id="cb33-5">)</span>
<span id="cb33-6"></span>
<span id="cb33-7">futilityBounds <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb33-8">y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb33-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> futilityBounds,</span>
<span id="cb33-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb33-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"predictivePower"</span></span>
<span id="cb33-13">    )</span>
<span id="cb33-14">    </span>
<span id="cb33-15"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb33-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pValue =</span> futilityBounds,</span>
<span id="cb33-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">predictivePower =</span> y) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-18"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pValue, predictivePower)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(</span>
<span id="cb33-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb33-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>,</span>
<span id="cb33-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>,</span>
<span id="cb33-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb33-25">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(</span>
<span id="cb33-27">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.055</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.221</span>),</span>
<span id="cb33-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>,</span>
<span id="cb33-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>,</span>
<span id="cb33-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb33-31">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.055</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.221</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb33-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/planning/rpact_futility_bounds/index_files/figure-html/unnamed-chunk-22-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb34-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb34-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb34-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"predictivePower"</span>,</span>
<span id="cb34-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span></span>
<span id="cb34-6">        </span>
<span id="cb34-7">    )</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.22072949 0.05461352 0.02500000</code></pre>
</div>
</div>
<p>We see that a p-value of 0.5 corresponds to an Bayesian predictive power/RCP of 0.025, which was already mentioned above.</p>
</section>
</section>
<section id="remarks" class="level2">
<h2 class="anchored" data-anchor-id="remarks">Remarks</h2>
<p>The <a href="https://docs.rpact.org/reference/getFutilityBounds.html"><code>getFutilityBounds()</code></a> function supports a <code>summary()</code> method that displays all information about the conversion:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getFutilityBounds</span>(</span>
<span id="cb36-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceValue =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb36-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sourceScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span>,</span>
<span id="cb36-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">targetScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zValue"</span></span>
<span id="cb36-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Futility bounds summary:

User-defined parameters:
  sourceValue: 0.2, 0.4, 0.5
  sourceScale: 'pValue'

Default parameters:
  targetScale: 'zValue'

Output:
  targetValue: 0.842, 0.253, 0</code></pre>
</div>
</div>
<p>The functions <a href="https://docs.rpact.org/reference/getDesignGroupSequential.html"><code>getDesignGroupSequential()</code></a>, <a href="https://docs.rpact.org/reference/getDesignInverseNormal.html"><code>getDesignInverseNormal()</code></a>, and <a href="https://docs.rpact.org/reference/getDesignFisher.html"><code>getDesignFisher()</code></a> support the argument <code>futilityBoundsScale</code> which can be used to specify the scale of the futility bounds. The value must be one of <code>zValue</code>, <code>pValue</code>, <code>reverseCondPower</code>, <code>condPowerAtObserved</code>, or <code>predictivePower</code>. The default value is <code>zValue</code> for group-sequential and inverse normal designs and <code>pValue</code> for Fisher’s combination test designs.</p>
<section id="example" class="level3">
<h3 class="anchored" data-anchor-id="example">Example</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb38-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb38-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb38-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb38-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBoundsScale =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pValue"</span></span>
<span id="cb38-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><em>Sequential analysis with a maximum of 3 looks (group sequential design)</em></p>
<p>O’Brien &amp; Fleming design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0668, ASN H1 0.849, ASN H01 0.842, ASN H0 0.6214.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0.524</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0359</td>
<td>0.4635</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0.047</td>
<td>0.018</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>There are several complementary ways to define futility stopping in interim analyses. Depending on the design strategy and decision philosophy, futility may be based on classical test statistics, conditional or predictive quantities, or probability statements derived from the interim effect estimate.</p>
<p>Predictive interval plots offer an intuitive visual alternative. As discussed in <span class="citation" data-cites="ortega2025futility">Ortega-Villa et al. (2025)</span>, predictive intervals for future test statistics or effect estimates can be used to judge whether meaningful treatment effects remain plausible given the data observed so far. If the predictive interval lies almost entirely below the efficacy boundary, early stopping for futility becomes a natural conclusion.</p>
<p>A beta spending function provides yet another way to construct futility boundaries in a principled manner. Analogous to alpha spending for efficacy, beta spending distributes the Type II error budget across interim looks. This yields futility boundaries that are internally coherent, design-driven, and compatible with the desired overall power.</p>
<p>Importantly, all futility boundaries should be interpreted as guidelines rather than strict rules. They are typically implemented as non-binding rules, meaning that the sponsor or monitoring committee may decide to continue a trial even if a futility criterion is met, provided there is sufficient scientific or clinical justification to do so.</p>
<p>The <a href="https://docs.rpact.org/reference/getFutilityBounds.html"><code>getFutilityBounds()</code></a> function in <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a> is deliberately provided as a stand-alone tool to support this flexibility. It enables users to convert or reconstruct futility boundaries across multiple scales.</p>
<p>All transformations implemented in <a href="https://docs.rpact.org/reference/getFutilityBounds.html"><code>getFutilityBounds()</code></a> have been extensively validated, including through reverse-transform checks ensuring that converting a boundary from one scale to another and back yields the same value within numerical tolerance.</p>
<p>Finally, the endpoint independent scales are implemented in the functions <a href="https://docs.rpact.org/reference/getDesignGroupSequential.html"><code>getDesignGroupSequential()</code></a>, <a href="https://docs.rpact.org/reference/getDesignInverseNormal.html"><code>getDesignInverseNormal()</code></a>, and <a href="https://docs.rpact.org/reference/getDesignFisher.html"><code>getDesignFisher()</code></a> using the argument <code>futilityBoundsScale</code>. This allows direct specification of futility boundaries on any endpoint independent scale when defining a design.</p>
<p>Endpoint dependent scales will be fully integrated into the sample size and power calculation functions of <a href="https://www.rpact.com/products/r-package-rpact/"><code>rpact</code></a> in future releases.</p>
</section>
<section id="references" class="level2 scrollable">




</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-glimm2012comments" class="csl-entry">
Glimm, Ekkehard. 2012. <span>“Comments on <em><span>A</span>daptive Increase in Sample Size When Interim Results Are Promising: <span>A</span> Practical Guide with Examples</em> by <span>CR</span> <span>M</span>ehta and <span>SJ</span> <span>P</span>ocock.”</span> <em>Statistics in Medicine</em> 31 (1): 98–99.
</div>
<div id="ref-mehta2011adaptive" class="csl-entry">
Mehta, Cyrus R, and Stuart J Pocock. 2011. <span>“Adaptive Increase in Sample Size When Interim Results Are Promising: A Practical Guide with Examples.”</span> <em>Statistics in Medicine</em> 30 (28): 3267–84.
</div>
<div id="ref-ortega2025futility" class="csl-entry">
Ortega-Villa, Ana M, Megan C Grieco, Kevin Rubenstein, Jing Wang, and Michael A Proschan. 2025. <span>“Futility Monitoring in Clinical Trials.”</span> <em>Statistics in Medicine</em> 44 (13-14): e70157.
</div>
<div id="ref-tan1998clinical" class="csl-entry">
Tan, Ming, Xiaoping Xiong, and Michael H Kutner. 1998. <span>“Clinical Trial Designs Based on Sequential Conditional Probability Ratio Tests and Reverse Stochastic Curtailing.”</span> <em>Biometrics</em>, 682–95.
</div>
<div id="ref-wassmer2025" class="csl-entry">
Wassmer, Gernot, and Werner Brannath. 2025. <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>. 2nd ed. Springer. <a href="https://link.springer.com/book/10.1007/978-3-031-89669-9">https://link.springer.com/book/10.1007/978-3-031-89669-9</a>.
</div>
</div></section><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Planning</category>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/planning/rpact_futility_bounds/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_30.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Hidden rpact Features: Options and Environment Variables</title>
  <dc:creator>[[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_hidden_features/</link>
  <description><![CDATA[ 




<section id="introduction" class="level2">
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
</section>
<section id="introduction-1" class="level2">
<h2 class="anchored" data-anchor-id="introduction-1">Introduction</h2>
<p><code>rpact</code> exposes many user-facing arguments, but it also has a set of package options that can be used to adjust recurring behavior without passing the same argument again and again. These settings are intentionally lightweight: they can be configured through R options with <code>options()</code> or, starting with <code>rpact</code> versions greater than 4.4.0, through environment variables. Environment variables are useful for reproducible scripts, CI jobs, validation runs, and shared project profiles. In <code>rpact</code> versions up to and including 4.4.0, only the R option variant is available.</p>
<p>This vignette collects the options that are currently read through the internal <code>.getEnvironmentVariable()</code> helper. The helper first checks the environment variable and then falls back to the R option. In practice, this means that an environment variable overrides the corresponding R option for the current R process.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R option: convenient inside an R session or script</span></span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb1-3"></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Environment variable: useful before code calls rpact functionality</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Available starting with rpact versions greater than 4.4.0</span></span>
<span id="cb1-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_DIGITS =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>)</span></code></pre></div></div>
</div>
<p>For option keys that start with <code>rpact.</code>, the environment variable name is derived by uppercasing the option key and replacing dots with underscores. For example, <code>rpact.summary.digits</code> becomes <code>RPACT_SUMMARY_DIGITS</code>.</p>
<p>Logical environment variables are parsed as <code>TRUE</code> for values such as <code>"true"</code>, <code>"1"</code>, <code>"yes"</code>, and <code>"on"</code>; other non-empty values are interpreted as <code>FALSE</code>.</p>
</section>
<section id="configuration-pattern" class="level2">
<h2 class="anchored" data-anchor-id="configuration-pattern">Configuration Pattern</h2>
<p>Every option in this vignette can be adjusted in one of two ways:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Option style</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.show.beta.spent =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Environment-variable style</span></span>
<span id="cb2-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_SHOW_BETA_SPENT =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"true"</span>)</span></code></pre></div></div>
</div>
<p>Environment variables are strings, so quote values when using <code>Sys.setenv()</code>. R options can use native R values such as <code>TRUE</code>, <code>4L</code>, or <code>"large"</code>.</p>
</section>
<section id="persistent-configuration-file-location" class="level2">
<h2 class="anchored" data-anchor-id="persistent-configuration-file-location">Persistent Configuration File Location</h2>
<p>rpact can persist its options in an <code>options.yml</code> file. Previously, both <code>saveOptions()</code> and the internal <code>.loadOptions()</code> function always used <code>rappdirs::user_config_dir("rpact")</code> as the directory containing this file. The save and load locations can now be configured independently.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Purpose</th>
<th>R option</th>
<th>Environment variable</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Directory used by <code>saveOptions()</code></td>
<td><code>rpact.config.dir.save</code></td>
<td><code>RPACT_CONFIG_DIR_SAVE</code></td>
</tr>
<tr class="even">
<td>Directory used by <code>.loadOptions()</code></td>
<td><code>rpact.config.dir.load</code></td>
<td><code>RPACT_CONFIG_DIR_LOAD</code></td>
</tr>
</tbody>
</table>
<p>The values must identify directories, not the <code>options.yml</code> file itself. If a configured directory does not exist, rpact falls back to <code>rappdirs::user_config_dir("rpact")</code>. Consequently, create a custom directory before using it.</p>
<p>The load directory is consulted when rpact is loaded. Set its R option before calling <code>library(rpact)</code>, or define the corresponding environment variable before starting or loading rpact. For example:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">centralConfigDir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/company/rpact/config"</span></span>
<span id="cb3-2">personalConfigDir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/.config/rpact"</span></span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Both directories must already exist.</span></span>
<span id="cb3-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.config.dir.load =</span> centralConfigDir,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.config.dir.save =</span> personalConfigDir</span>
<span id="cb3-8">)</span>
<span id="cb3-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span></code></pre></div></div>
</div>
<p>The equivalent environment-variable configuration is:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_CONFIG_DIR_LOAD =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/company/rpact/config"</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_CONFIG_DIR_SAVE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/.config/rpact"</span></span>
<span id="cb4-4">)</span>
<span id="cb4-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span></code></pre></div></div>
</div>
<p>Using different directories for loading and saving supports centrally managed defaults without allowing routine user activity to overwrite them. For example, an organization can provide a read-only <code>options.yml</code> in a shared directory that defines company-specific output settings such as rounding rules. Every user can load this central configuration, while <code>saveOptions()</code> writes subsequent changes to a separate user-specific directory.</p>
<p>With different load and save directories, the current behavior should be understood as <strong>read-only configuration</strong>: <code>.loadOptions()</code> reads only the <code>options.yml</code> from <code>rpact.config.dir.load</code>. It does not additionally load the file written to <code>rpact.config.dir.save</code>. Consequently, user-specific changes can be saved to the separate directory, but they are not persisted across sessions by the current loading mechanism. If both settings point to the same directory, saved changes replace the <code>options.yml</code> that will be loaded in future sessions.</p>
<p>This behavior may be extended in a future rpact version, for example by loading and combining configuration files from both directories. Such layered loading is not currently implemented.</p>
</section>
<section id="summary-and-printed-output" class="level2">
<h2 class="anchored" data-anchor-id="summary-and-printed-output">Summary and Printed Output</h2>
<p>These options control the appearance and amount of information in printed summaries, markdown output, and formatted summary values.</p>
<section id="rpact.summary.digits" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.digits"><code>rpact.summary.digits</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_DIGITS</code></p>
<p>Default: <code>3</code></p>
<p>Controls the default number of digits used by summary methods when no explicit <code>digits</code> argument is supplied.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>L)</span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_DIGITS =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.digits.probs" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.digits.probs"><code>rpact.summary.digits.probs</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_DIGITS_PROBS</code></p>
<p>Default: <code>rpact.summary.digits + 1</code></p>
<p>Controls the number of digits used for probability-like summary values. If this setting cannot be parsed, rpact falls back to one more digit than <code>rpact.summary.digits</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.digits.probs =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>L)</span>
<span id="cb6-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_DIGITS_PROBS =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.intervalformat" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.intervalformat"><code>rpact.summary.intervalFormat</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_INTERVALFORMAT</code></p>
<p>Default: <code>"[%s; %s]"</code></p>
<p>Controls how two-part values, for example intervals, are displayed in summaries. The format string must contain exactly two <code>%s</code> placeholders.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.intervalFormat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(%s, %s)"</span>)</span>
<span id="cb7-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_INTERVALFORMAT =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(%s, %s)"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.justify" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.justify"><code>rpact.summary.justify</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_JUSTIFY</code></p>
<p>Default: <code>"right"</code></p>
<p>Controls how values are aligned in printed summary tables. The value is passed to base R formatting, so typical values are <code>"right"</code>, <code>"left"</code>, <code>"centre"</code>, and <code>"none"</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.justify =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>)</span>
<span id="cb8-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_JUSTIFY =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.na" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.na"><code>rpact.summary.na</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_NA</code></p>
<p>Default: <code>""</code></p>
<p>Controls the replacement text for <code>NA</code> values in summaries. The default leaves these cells visually blank.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.na =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>)</span>
<span id="cb9-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_NA =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.output.size" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.output.size"><code>rpact.summary.output.size</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_OUTPUT_SIZE</code></p>
<p>Default: <code>"large"</code></p>
<p>Controls how much detail selected summary methods include. The code recognizes the levels <code>"small"</code>, <code>"medium"</code>, and <code>"large"</code> in several summary paths. <code>"large"</code> includes the most detail; <code>"small"</code> produces more compact summaries.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.output.size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>)</span>
<span id="cb10-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_OUTPUT_SIZE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.trim.zeroes" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.trim.zeroes"><code>rpact.summary.trim.zeroes</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_TRIM_ZEROES</code></p>
<p>Default: <code>TRUE</code></p>
<p>Controls whether formatted zero values such as <code>"0.000"</code> are shown as <code>"0"</code> in summary output.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.trim.zeroes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb11-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_TRIM_ZEROES =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"false"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.width" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.width"><code>rpact.summary.width</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_WIDTH</code></p>
<p>Default: <code>83</code></p>
<p>Controls the maximum line length used when rpact inserts line breaks in summary header text.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>L)</span>
<span id="cb12-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_WIDTH =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.summary.list.item.prefix" class="level3">
<h3 class="anchored" data-anchor-id="rpact.summary.list.item.prefix"><code>rpact.summary.list.item.prefix</code></h3>
<p>Environment variable: <code>RPACT_SUMMARY_LIST_ITEM_PREFIX</code></p>
<p>Default: two spaces</p>
<p>Controls the prefix used for certain generated group captions, especially in multi-group, enrichment, and multi-arm summaries.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.summary.list.item.prefix =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  - "</span>)</span>
<span id="cb13-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_SUMMARY_LIST_ITEM_PREFIX =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  - "</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.print.heading.base.number" class="level3">
<h3 class="anchored" data-anchor-id="rpact.print.heading.base.number"><code>rpact.print.heading.base.number</code></h3>
<p>Environment variable: <code>RPACT_PRINT_HEADING_BASE_NUMBER</code></p>
<p>Default: <code>-2</code></p>
<p>Controls how headings are rendered when rpact prints markdown output. Values below <code>-2</code> are reset to the default; values above <code>4</code> are capped at <code>4</code>.</p>
<p>The special values <code>-2</code> and <code>-1</code> render headings as italic and bold inline text, respectively. Non-negative values render markdown headings by adding the value to the internal heading level.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.print.heading.base.number =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>L)</span>
<span id="cb14-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PRINT_HEADING_BASE_NUMBER =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.markdown.plot.print.separator" class="level3">
<h3 class="anchored" data-anchor-id="rpact.markdown.plot.print.separator"><code>rpact.markdown.plot.print.separator</code></h3>
<p>Environment variable: <code>RPACT_MARKDOWN_PLOT_PRINT_SEPARATOR</code></p>
<p>Default: a markdown horizontal-rule separator</p>
<p>Controls the separator inserted between plot output and printed output in markdown contexts.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.markdown.plot.print.separator =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_MARKDOWN_PLOT_PRINT_SEPARATOR =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="automatic-markdown-behavior" class="level2">
<h2 class="anchored" data-anchor-id="automatic-markdown-behavior">Automatic Markdown Behavior</h2>
<p>rpact detects R Markdown and Quarto contexts and can switch selected print, summary, and plot methods into markdown-aware output. The following dynamic options are constructed from <code>rpact.auto.markdown.</code> plus a scope name.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 23%">
<col style="width: 23%">
<col style="width: 30%">
<col style="width: 23%">
</colgroup>
<thead>
<tr class="header">
<th>Option</th>
<th>Environment variable</th>
<th style="text-align: right;">Default</th>
<th>Scope</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>rpact.auto.markdown.all</code></td>
<td><code>RPACT_AUTO_MARKDOWN_ALL</code></td>
<td style="text-align: right;"><code>TRUE</code></td>
<td>Global markdown checks</td>
</tr>
<tr class="even">
<td><code>rpact.auto.markdown.print</code></td>
<td><code>RPACT_AUTO_MARKDOWN_PRINT</code></td>
<td style="text-align: right;"><code>TRUE</code></td>
<td>Print methods</td>
</tr>
<tr class="odd">
<td><code>rpact.auto.markdown.summary</code></td>
<td><code>RPACT_AUTO_MARKDOWN_SUMMARY</code></td>
<td style="text-align: right;"><code>TRUE</code></td>
<td>Summary methods</td>
</tr>
<tr class="even">
<td><code>rpact.auto.markdown.plot</code></td>
<td><code>RPACT_AUTO_MARKDOWN_PLOT</code></td>
<td style="text-align: right;"><code>TRUE</code></td>
<td>Plot methods</td>
</tr>
</tbody>
</table>
<p>Set a scope to <code>FALSE</code> when a document should keep console-style output for that part of rpact.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.auto.markdown.plot =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb16-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_AUTO_MARKDOWN_PLOT =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"false"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="output-number-formatting" class="level2">
<h2 class="anchored" data-anchor-id="output-number-formatting">Output Number Formatting</h2>
<p>Output-format options are dynamic. They are all listed in <code>C_OUTPUT_FORMAT_DEFAULT_VALUES</code> internally and are read with <code>.getEnvironmentVariable(.getEnvironmentVariableKey(optionKey), optionKey)</code>.</p>
<p>Each value is a comma-separated string of formatting arguments. Supported arguments are:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>Argument</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>digits</code></td>
<td>Significant digits, as an integer</td>
</tr>
<tr class="even">
<td><code>nsmall</code></td>
<td>Minimum digits to the right of the decimal point</td>
</tr>
<tr class="odd">
<td><code>trimSingleZeros</code></td>
<td>If <code>TRUE</code>, display values such as <code>"0.00"</code> as <code>"0"</code></td>
</tr>
<tr class="even">
<td><code>futilityProbabilityEnabled</code></td>
<td>If <code>TRUE</code>, display very small futility probabilities below <code>1e-09</code> as <code>0</code></td>
</tr>
<tr class="odd">
<td><code>roundFunction</code></td>
<td>One of <code>ceiling</code>, <code>floor</code>, <code>trunc</code>, <code>round</code>, or <code>signif</code></td>
</tr>
</tbody>
</table>
<p>The public <code>setOutputFormat()</code> function is usually the safest way to change these values during an R session. Environment variables are useful when the same format must be active before rpact code is called.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.output.format.p.value =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digits = 5, nsmall = 5"</span>)</span>
<span id="cb17-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_OUTPUT_FORMAT_P_VALUE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digits = 5, nsmall = 5"</span>)</span></code></pre></div></div>
</div>
<p>The available output-format options are:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Option</th>
<th>Environment variable</th>
<th>Default</th>
<th>Affects</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>rpact.output.format.p.value</code></td>
<td><code>RPACT_OUTPUT_FORMAT_P_VALUE</code></td>
<td><code>digits = 4, nsmall = 4</code></td>
<td>p-values</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.repeated.p.value</code></td>
<td><code>RPACT_OUTPUT_FORMAT_REPEATED_P_VALUE</code></td>
<td><code>digits = 4, nsmall = 4</code></td>
<td>repeated p-values</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.probability</code></td>
<td><code>RPACT_OUTPUT_FORMAT_PROBABILITY</code></td>
<td><code>digits = 4, nsmall = 4</code></td>
<td>general probabilities</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.futility.probability</code></td>
<td><code>RPACT_OUTPUT_FORMAT_FUTILITY_PROBABILITY</code></td>
<td><code>digits = 4, nsmall = 4, futilityProbabilityEnabled = TRUE</code></td>
<td>futility probabilities</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.sample.size</code></td>
<td><code>RPACT_OUTPUT_FORMAT_SAMPLE_SIZE</code></td>
<td><code>digits = 1, nsmall = 1</code></td>
<td>sample sizes</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.event</code></td>
<td><code>RPACT_OUTPUT_FORMAT_EVENT</code></td>
<td><code>digits = 1, nsmall = 1, trimSingleZeros = TRUE</code></td>
<td>event counts</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.event.time</code></td>
<td><code>RPACT_OUTPUT_FORMAT_EVENT_TIME</code></td>
<td><code>digits = 3, trimSingleZeros = TRUE</code></td>
<td>event times</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.conditional.power</code></td>
<td><code>RPACT_OUTPUT_FORMAT_CONDITIONAL_POWER</code></td>
<td><code>digits = 4</code></td>
<td>conditional power values</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.critical.value</code></td>
<td><code>RPACT_OUTPUT_FORMAT_CRITICAL_VALUE</code></td>
<td><code>digits = 3, nsmall = 3</code></td>
<td>critical values</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.critical.value.fisher</code></td>
<td><code>RPACT_OUTPUT_FORMAT_CRITICAL_VALUE_FISHER</code></td>
<td><code>digits = 4</code></td>
<td>Fisher critical values</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.test.statistic.fisher</code></td>
<td><code>RPACT_OUTPUT_FORMAT_TEST_STATISTIC_FISHER</code></td>
<td><code>digits = 4</code></td>
<td>Fisher test statistics</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.test.statistic</code></td>
<td><code>RPACT_OUTPUT_FORMAT_TEST_STATISTIC</code></td>
<td><code>digits = 3, nsmall = 3</code></td>
<td>test statistics</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.rate</code></td>
<td><code>RPACT_OUTPUT_FORMAT_RATE</code></td>
<td><code>digits = 3, nsmall = 3</code></td>
<td>rates and related rate values</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.rate1</code></td>
<td><code>RPACT_OUTPUT_FORMAT_RATE1</code></td>
<td><code>digits = 1, nsmall = 1</code></td>
<td>dynamic rate values, including values routed through the rate formatter</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.accrual.intensity</code></td>
<td><code>RPACT_OUTPUT_FORMAT_ACCRUAL_INTENSITY</code></td>
<td><code>digits = 2, nsmall = 1</code></td>
<td>accrual intensities</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.mean</code></td>
<td><code>RPACT_OUTPUT_FORMAT_MEAN</code></td>
<td><code>digits = 4</code></td>
<td>means</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.ratio</code></td>
<td><code>RPACT_OUTPUT_FORMAT_RATIO</code></td>
<td><code>digits = 3</code></td>
<td>ratios</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.st.dev</code></td>
<td><code>RPACT_OUTPUT_FORMAT_ST_DEV</code></td>
<td><code>digits = 4</code></td>
<td>standard deviations</td>
</tr>
<tr class="odd">
<td><code>rpact.output.format.duration</code></td>
<td><code>RPACT_OUTPUT_FORMAT_DURATION</code></td>
<td><code>digits = 2, nsmall = 2</code></td>
<td>durations</td>
</tr>
<tr class="even">
<td><code>rpact.output.format.time</code></td>
<td><code>RPACT_OUTPUT_FORMAT_TIME</code></td>
<td><code>digits = 2, nsmall = 2</code></td>
<td>time values</td>
</tr>
</tbody>
</table>
</section>
<section id="plot-options" class="level2">
<h2 class="anchored" data-anchor-id="plot-options">Plot Options</h2>
<p>These options change defaults used by selected plot methods. Explicit plot arguments still take precedence where such arguments are available.</p>
<section id="rpact.plot.labs.type" class="level3">
<h3 class="anchored" data-anchor-id="rpact.plot.labs.type"><code>rpact.plot.labs.type</code></h3>
<p>Environment variable: <code>RPACT_PLOT_LABS_TYPE</code></p>
<p>Default: <code>"quote"</code></p>
<p>Controls how plot labels and title objects are rendered. The default <code>"quote"</code> uses plotmath-style expressions for selected labels such as theta and pi. Other values keep label items as text and can enable HTML title handling in contexts that support it.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.labs.type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>)</span>
<span id="cb18-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_LABS_TYPE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.plot.labs.caption.enabled" class="level3">
<h3 class="anchored" data-anchor-id="rpact.plot.labs.caption.enabled"><code>rpact.plot.labs.caption.enabled</code></h3>
<p>Environment variable: <code>RPACT_PLOT_LABS_CAPTION_ENABLED</code></p>
<p>Default: <code>TRUE</code></p>
<p>Controls whether additional plot title information is placed in the plot caption when <code>rpact.plot.labs.type</code> is not <code>"quote"</code>. If disabled, the same information is appended to the subtitle instead.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.labs.caption.enabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb19-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_LABS_CAPTION_ENABLED =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"false"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.plot.show.alpha.spent" class="level3">
<h3 class="anchored" data-anchor-id="rpact.plot.show.alpha.spent"><code>rpact.plot.show.alpha.spent</code></h3>
<p>Environment variable: <code>RPACT_PLOT_SHOW_ALPHA_SPENT</code></p>
<p>Default: <code>TRUE</code></p>
<p>Controls whether alpha-spent curves are included by default in plots that can show alpha and beta spending. Function arguments such as <code>showAlphaSpent</code> still override this option when supplied.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.show.alpha.spent =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb20-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_SHOW_ALPHA_SPENT =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"true"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.plot.show.beta.spent" class="level3">
<h3 class="anchored" data-anchor-id="rpact.plot.show.beta.spent"><code>rpact.plot.show.beta.spent</code></h3>
<p>Environment variable: <code>RPACT_PLOT_SHOW_BETA_SPENT</code></p>
<p>Default: <code>FALSE</code></p>
<p>Controls whether beta-spent curves are included by default in the same plot contexts. Setting both alpha and beta spending to <code>FALSE</code> causes rpact to fall back to alpha-spent output and issue a warning.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.show.beta.spent =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb21-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_SHOW_BETA_SPENT =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"true"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.plot.show.futility.on.pvalue.scale" class="level3">
<h3 class="anchored" data-anchor-id="rpact.plot.show.futility.on.pvalue.scale"><code>rpact.plot.show.futility.on.pvalue.scale</code></h3>
<p>Environment variable: <code>RPACT_PLOT_SHOW_FUTILITY_ON_PVALUE_SCALE</code></p>
<p>Default: <code>FALSE</code></p>
<p>Controls whether futility boundaries are shown by default on p-value scale boundary plots, provided that futility bounds are available for the design.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.plot.show.futility.on.pvalue.scale =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb22-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_PLOT_SHOW_FUTILITY_ON_PVALUE_SCALE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"true"</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="dataset-and-numerical-calculation-options" class="level2">
<h2 class="anchored" data-anchor-id="dataset-and-numerical-calculation-options">Dataset and Numerical Calculation Options</h2>
<section id="rpact.dataset.stdev.calc.mode" class="level3">
<h3 class="anchored" data-anchor-id="rpact.dataset.stdev.calc.mode"><code>rpact.dataset.stdev.calc.mode</code></h3>
<p>Environment variable: <code>RPACT_DATASET_STDEV_CALC_MODE</code></p>
<p>Default: <code>"auto"</code></p>
<p>Controls how standard deviations are reconstructed from <code>emmeans</code> results in <code>getDataset()</code>. The internal comment lists the modes <code>"auto"</code>, <code>"sigma"</code>, <code>"norm"</code>, and <code>"t"</code>.</p>
<p><code>"sigma"</code> uses the pooled standard deviation from the <code>emmeans</code> object. <code>"t"</code> uses a t-distribution based calculation when valid degrees of freedom are available. Other modes use the normal-distribution calculation, with special handling for non-<code>lm</code> model results.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.dataset.stdev.calc.mode =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>)</span>
<span id="cb23-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_DATASET_STDEV_CALC_MODE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.multivar.dist.eps" class="level3">
<h3 class="anchored" data-anchor-id="rpact.multivar.dist.eps"><code>rpact.multivar.dist.eps</code></h3>
<p>Environment variable: <code>RPACT_MULTIVAR_DIST_EPS</code></p>
<p>Default: <code>1e-05</code></p>
<p>Controls the epsilon tolerance used in multivariate Student t distribution calculations. rpact uses the configured value only if it is numeric and below <code>0.1</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.multivar.dist.eps =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-06</span>)</span>
<span id="cb24-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_MULTIVAR_DIST_EPS =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1e-06"</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="warnings-and-messages" class="level2">
<h2 class="anchored" data-anchor-id="warnings-and-messages">Warnings and Messages</h2>
<section id="rpact.out.of.validated.bounds.message.type" class="level3">
<h3 class="anchored" data-anchor-id="rpact.out.of.validated.bounds.message.type"><code>rpact.out.of.validated.bounds.message.type</code></h3>
<p>Environment variable: <code>RPACT_OUT_OF_VALIDATED_BOUNDS_MESSAGE_TYPE</code></p>
<p>Default: <code>"warning"</code></p>
<p>Controls how rpact reports parameters that are outside validated bounds. With <code>"warning"</code> rpact emits a warning. With <code>"message"</code> it emits an informational message. Other values silence this particular notification path.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.out.of.validated.bounds.message.type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"message"</span>)</span>
<span id="cb25-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_OUT_OF_VALIDATED_BOUNDS_MESSAGE_TYPE =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"message"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.analysis.repeated.p.values.warnings.enabled" class="level3">
<h3 class="anchored" data-anchor-id="rpact.analysis.repeated.p.values.warnings.enabled"><code>rpact.analysis.repeated.p.values.warnings.enabled</code></h3>
<p>Environment variable: <code>RPACT_ANALYSIS_REPEATED_P_VALUES_WARNINGS_ENABLED</code></p>
<p>Default: <code>TRUE</code></p>
<p>Controls whether rpact warns when repeated p-values are unavailable for certain inverse normal or group sequential designs. The option key intentionally uses the current spelling <code>analyis</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.analysis.repeated.p.values.warnings.enabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb26-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_ANALYSIS_REPEATED_P_VALUES_WARNINGS_ENABLED =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"false"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="rpact.deprecated.message.time.function.kable" class="level3">
<h3 class="anchored" data-anchor-id="rpact.deprecated.message.time.function.kable"><code>rpact.deprecated.message.time.function.kable</code></h3>
<p>Environment variable: <code>RPACT_DEPRECATED_MESSAGE_TIME_FUNCTION_KABLE</code></p>
<p>Default: not set</p>
<p>Stores the last time rpact warned about manual use of <code>kable()</code> for rpact result objects. rpact uses this timestamp to avoid repeating the deprecation message too frequently. This is primarily an internal throttle; users normally do not need to set it manually.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.deprecated.message.time.function.kable =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.time</span>())</span>
<span id="cb27-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_DEPRECATED_MESSAGE_TIME_FUNCTION_KABLE =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.time</span>()))</span></code></pre></div></div>
</div>
</section>
</section>
<section id="startup-and-validation-support" class="level2">
<h2 class="anchored" data-anchor-id="startup-and-validation-support">Startup and Validation Support</h2>
<p>These options are mostly used by package startup and qualification workflows. They can be useful in automated validation environments, but most analyses do not need to change them.</p>
<section id="rpact.startup.message.enabled" class="level3">
<h3 class="anchored" data-anchor-id="rpact.startup.message.enabled"><code>rpact.startup.message.enabled</code></h3>
<p>Environment variable: <code>RPACT_STARTUP_MESSAGE_ENABLED</code></p>
<p>Default: <code>TRUE</code></p>
<p>Controls whether rpact startup messages are enabled. The exported helper functions <code>enableStartupMessages()</code> and <code>disableStartupMessages()</code> update the R option and persist it through rpact’s option-saving mechanism.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.startup.message.enabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb28-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_STARTUP_MESSAGE_ENABLED =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"false"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="package-level-startup-message-control-with-startup_message" class="level3">
<h3 class="anchored" data-anchor-id="package-level-startup-message-control-with-startup_message">Package-level startup message control with <code>STARTUP_MESSAGE</code></h3>
<p>The R option and environment variable above are user- or process-specific. This can be inconvenient for centrally managed installations. For example, an administrator may install and qualify rpact with a service account and then make that installation available to many users. A configuration saved in the service account’s user directory is not automatically available to those users. As described in <a href="https://github.com/rpact-com/rpact/issues/121">GitHub issue #121</a>, users can consequently receive a misleading startup message suggesting that the shared rpact installation is not validated, even though it has already been qualified centrally.</p>
<p>To disable startup messages for everyone using the same rpact installation, place a text file named <code>STARTUP_MESSAGE</code> in the rpact package directory. If any line in this file contains the word <code>disabled</code> (case-insensitive), rpact does not display startup messages.</p>
<p>The following R code identifies the active rpact installation and creates the file:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">rpactDirectory <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">system.file</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">package =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span>
<span id="cb29-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">stopifnot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nzchar</span>(rpactDirectory))</span>
<span id="cb29-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">writeLines</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disabled"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(rpactDirectory, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STARTUP_MESSAGE"</span>))</span></code></pre></div></div>
</div>
<p>Writing to a centrally managed package directory may require administrator permissions. The file must be added to the specific installation returned by <code>system.file(package = "rpact")</code>; if rpact is reinstalled or upgraded, check whether the file needs to be added again. To re-enable startup messages at the package level, remove the file or remove the word <code>disabled</code> from its contents.</p>
<p>Unlike <code>rpact.startup.message.enabled</code>, this marker file applies to all users of that package installation. It is therefore particularly suitable for shared, centrally qualified installations and directly addresses the deployment scenario reported in issue <a href="https://github.com/rpact-com/rpact/issues/121">GitHub issue #121</a>.</p>
</section>
<section id="rpact.startup.message.timestamp" class="level3">
<h3 class="anchored" data-anchor-id="rpact.startup.message.timestamp"><code>rpact.startup.message.timestamp</code></h3>
<p>Environment variable: <code>RPACT_STARTUP_MESSAGE_TIMESTAMP</code></p>
<p>Default: not set</p>
<p>Stores the timestamp of the last startup message. rpact uses it to avoid showing the startup message again within a 72-hour window. The expected string begins with a timestamp like <code>YYYY-MM-DD HH:MM:SS</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.startup.message.timestamp =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.time</span>()))</span>
<span id="cb30-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.setenv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">RPACT_STARTUP_MESSAGE_TIMESTAMP =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026-06-17 09:00:00"</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="quick-reference" class="level2">
<h2 class="anchored" data-anchor-id="quick-reference">Quick Reference</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>Group</th>
<th>Option pattern</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Summary formatting</td>
<td><code>rpact.summary.*</code></td>
</tr>
<tr class="even">
<td>Output value formatting</td>
<td><code>rpact.output.format.*</code></td>
</tr>
<tr class="odd">
<td>Plot defaults</td>
<td><code>rpact.plot.*</code></td>
</tr>
<tr class="even">
<td>Automatic markdown</td>
<td><code>rpact.auto.markdown.*</code></td>
</tr>
<tr class="odd">
<td>Persistent configuration paths</td>
<td><code>rpact.config.dir.save</code>, <code>rpact.config.dir.load</code></td>
</tr>
<tr class="even">
<td>Dataset import helpers</td>
<td><code>rpact.dataset.*</code></td>
</tr>
<tr class="odd">
<td>Numerical tolerances</td>
<td><code>rpact.multivar.dist.*</code></td>
</tr>
<tr class="even">
<td>Warnings and deprecation throttles</td>
<td><code>rpact.out.of.*</code>, <code>rpact.analyis.*</code>, <code>rpact.deprecated.*</code></td>
</tr>
<tr class="odd">
<td>Startup and validation</td>
<td><code>rpact.startup.*</code>, <code>rpact.system.*</code>, package-level <code>STARTUP_MESSAGE</code> file</td>
</tr>
</tbody>
</table>
<p>When both an environment variable and an R option are set, the environment variable wins. For project-local reproducibility, set these values near the start of the analysis script or in the execution environment before the script is launched.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_hidden_features/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_29.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>How to Create One- and Multi-Arm Analysis Result Plots with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="preparation" class="level1">
<h1>Preparation</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="create-a-design" class="level1">
<h1>Create a design</h1>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">designIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), </span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>, </span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-8">)</span>
<span id="cb3-9"></span>
<span id="cb3-10">designF <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb3-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-14">)</span></code></pre></div></div>
</div>
</section>
<section id="analysis-results-base" class="level1">
<h1>Analysis results base</h1>
<section id="analysis-results-base---means" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-base---means">Analysis results base - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">simpleDataExampleMeans1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>),</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.51</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb4-5">)</span>
<span id="cb4-6"></span>
<span id="cb4-7">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb4-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb4-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleMeans1,</span>
<span id="cb4-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>, </span>
<span id="cb4-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, </span>
<span id="cb4-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, </span>
<span id="cb4-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb4-14">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-5-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">simpleDataExampleMeans2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>),</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stds1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stds2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb9-8">)</span>
<span id="cb9-9"></span>
<span id="cb9-10">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb9-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb9-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleMeans2,</span>
<span id="cb9-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, </span>
<span id="cb9-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">equalVariances =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb9-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb9-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb9-17">)</span>
<span id="cb9-18">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-5-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-5-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="analysis-results-base---rates" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-base---rates">Analysis results base - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">simpleDataExampleRates1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb12-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb12-4">)</span>
<span id="cb12-5"></span>
<span id="cb12-6">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb12-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb12-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleRates1,</span>
<span id="cb12-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb12-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, </span>
<span id="cb12-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb12-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb12-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span></span>
<span id="cb12-14">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb17-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb17-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleRates1,</span>
<span id="cb17-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb17-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, </span>
<span id="cb17-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb17-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb17-8">)</span>
<span id="cb17-9">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">simpleDataExampleRates2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb20-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb20-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb20-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>),</span>
<span id="cb20-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb20-6">)</span>
<span id="cb20-7"></span>
<span id="cb20-8">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb20-9">  designIN, simpleDataExampleRates2,</span>
<span id="cb20-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb20-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb20-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb20-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb20-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, </span>
<span id="cb20-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb20-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb20-17">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Repeated confidence intervals will be calculated under the normal approximation</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatmentRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-6-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="analysis-results-base---survival" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-base---survival">Analysis results base - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">simpleDataExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb25-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb25-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallAllocationRatios =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb25-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.52</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.38</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9</span>)</span>
<span id="cb25-5">)</span>
<span id="cb25-6"></span>
<span id="cb25-7">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(designIN,</span>
<span id="cb25-8">    simpleDataExampleSurvival,</span>
<span id="cb25-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb25-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span></span>
<span id="cb25-11">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-7-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="analysis-results-multi-arm" class="level1">
<h1>Analysis results multi-arm</h1>
<section id="analysis-results-multi-arm---means" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-multi-arm---means">Analysis results multi-arm - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">dataExampleMeans <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb30-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb30-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb30-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>),</span>
<span id="cb30-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb30-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">242</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">222</span>),</span>
<span id="cb30-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">188</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb30-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">267</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">277</span>),</span>
<span id="cb30-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">92</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">122</span>),</span>
<span id="cb30-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">244</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">221</span>),</span>
<span id="cb30-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">212</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb30-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">232</span>),</span>
<span id="cb30-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">215</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">227</span>)</span>
<span id="cb30-14">)</span>
<span id="cb30-15"></span>
<span id="cb30-16">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb30-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designF, </span>
<span id="cb30-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleMeans,</span>
<span id="cb30-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>, </span>
<span id="cb30-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb30-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">varianceOption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"notPooled"</span>, </span>
<span id="cb30-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>),</span>
<span id="cb30-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>)</span>
<span id="cb30-24">)</span>
<span id="cb30-25"></span>
<span id="cb30-26">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb32-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), </span>
<span id="cb32-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>), </span>
<span id="cb32-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb32-6">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb34-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), </span>
<span id="cb34-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">250</span>),</span>
<span id="cb34-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>), </span>
<span id="cb34-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb34-6">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>`geom_line()`: Each group consists of only one observation.
ℹ Do you need to adjust the group aesthetic?</code></pre>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treatmentArms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1">x2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb42-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN, </span>
<span id="cb42-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleMeans,</span>
<span id="cb42-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>, </span>
<span id="cb42-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb42-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">varianceOption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"notPooled"</span>, </span>
<span id="cb42-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb42-8">)</span>
<span id="cb42-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Observed standard deviations will be used</span></span>
<span id="cb42-10">x2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-8-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
</div>
</section>
<section id="analysis-results-multi-arm---rates" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-multi-arm---rates">Analysis results multi-arm - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1">dataExampleRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb44-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb44-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb44-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>),</span>
<span id="cb44-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb44-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb44-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb44-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb44-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span>
<span id="cb44-10">)</span>
<span id="cb44-11"></span>
<span id="cb44-12">analysisResultsRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb44-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designIN,</span>
<span id="cb44-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleRates, </span>
<span id="cb44-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb44-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), </span>
<span id="cb44-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb44-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span></span>
<span id="cb44-19">)</span>
<span id="cb44-20"></span>
<span id="cb44-21">analysisResultsRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1">analysisResultsRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb46-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb46-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatmentRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb46-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-9-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1">analysisResultsRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb48-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb48-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb48-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatmentRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb48-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-9-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1">analysisResultsRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb50-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-9-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1">analysisResultsRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-9-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="analysis-results-multi-arm---survival" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-multi-arm---survival">Analysis results multi-arm - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb53-1">dataExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb53-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>),</span>
<span id="cb53-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb53-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>),</span>
<span id="cb53-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>),</span>
<span id="cb53-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.99</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb53-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.52</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.11</span>)</span>
<span id="cb53-8">)</span>
<span id="cb53-9"></span>
<span id="cb53-10">analysisResultsSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb53-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(),</span>
<span id="cb53-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleSurvival, </span>
<span id="cb53-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb53-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, </span>
<span id="cb53-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, </span>
<span id="cb53-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb53-17">)</span>
<span id="cb53-18">analysisResultsSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb55-1">analysisResultsSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-10-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb57-1">analysisResultsSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-10-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="analysis-results-enrichment" class="level1">
<h1>Analysis results enrichment</h1>
<section id="analysis-results-enrichment---means" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-enrichment---means">Analysis results enrichment - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb58-1">S1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb58-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean1       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">68.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">107.4</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean2       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">140.9</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">124.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">134.7</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">116.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">133.7</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb58-8">)</span>
<span id="cb58-9"></span>
<span id="cb58-10">S2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb58-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean1       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">107.7</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean2       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">125.6</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">128.5</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">120.1</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb58-17">)</span>
<span id="cb58-18"></span>
<span id="cb58-19">S3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb58-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean1       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">64.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">101.4</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean2       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">103.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">170.4</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">128.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">125.3</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">111.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">143.6</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb58-26">)</span>
<span id="cb58-27"></span>
<span id="cb58-28">F <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb58-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">83</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSize2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">79</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean1       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">77.1</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean2       =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">142.4</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">163.5</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb58-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2      =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">120.6</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb58-35">)</span>
<span id="cb58-36"></span>
<span id="cb58-37">dataInput <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S2 =</span> S2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S3 =</span> S3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">F =</span> F)</span>
<span id="cb58-38"></span>
<span id="cb58-39">dataInput <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S2 =</span> S2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S12 =</span> S3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> F)</span>
<span id="cb58-40"></span>
<span id="cb58-41">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb58-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb58-43">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, </span>
<span id="cb58-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb58-45">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb58-46">)</span>
<span id="cb58-47"></span>
<span id="cb58-48">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb58-49">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb58-50">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataInput,</span>
<span id="cb58-51">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb58-52">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span></span>
<span id="cb58-53">)</span>
<span id="cb58-54"></span>
<span id="cb58-55">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">populations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">populations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># </span><span class="al" style="color: #AD0000;
background-color: null;
font-style: inherit;">TODO</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"> no output</span></span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-11-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb62-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb62-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(</span>
<span id="cb62-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaRange =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb62-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">210</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">220</span>)</span>
<span id="cb62-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-11-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-11-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="analysis-results-enrichment---rates" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-enrichment---rates">Analysis results enrichment - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb65" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb65-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb65-2">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb65-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb65-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb65-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>),</span>
<span id="cb65-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>)</span>
<span id="cb65-7">)</span>
<span id="cb65-8">R <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb65-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb65-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>),</span>
<span id="cb65-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>),</span>
<span id="cb65-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>)</span>
<span id="cb65-13">)</span>
<span id="cb65-14">dataSetExampleRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> R)</span>
<span id="cb65-15"></span>
<span id="cb65-16">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb65-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(),</span>
<span id="cb65-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataSetExampleRates,</span>
<span id="cb65-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span></span>
<span id="cb65-20">)</span>
<span id="cb65-21">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb67" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb67-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-12-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="analysis-results-enrichment---survival" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-enrichment---survival">Analysis results enrichment - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb68" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb68-1">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb68-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb68-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.59</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.53</span>)</span>
<span id="cb68-4">)</span>
<span id="cb68-5"></span>
<span id="cb68-6">F <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb68-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">59</span>),</span>
<span id="cb68-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.98</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.93</span>)</span>
<span id="cb68-9">)</span>
<span id="cb68-10">dataSetExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">F =</span> F)</span>
<span id="cb68-11"></span>
<span id="cb68-12">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb68-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(),</span>
<span id="cb68-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataSetExampleSurvival,</span>
<span id="cb68-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span></span>
<span id="cb68-16">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Test statistics from full (and sub-populations) need to be stratified log-rank tests</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb70" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb70-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb72" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb72-1">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/index_files/figure-html/unnamed-chunk-13-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_plot_analysis_results_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_17.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>How to Create Summaries with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_summary_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="global-options" class="level1">
<h1>Global options</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>The following options can be set globally:</p>
<p><code>rpact.summary.output.size</code>: one of <code>c("small", "medium", "large")</code>; defines how many details will be included into the summary; default is “large”, i.e., all available details are displayed.</p>
<p><code>rpact.summary.justify</code>: one of <code>c("right", "left", "centre")</code>; shall the values be right-justified (the default), left-justified or centered.</p>
<p><code>rpact.summary.intervalFormat</code>: defines how intervals will be displayed in the summary, default is <code>"[%s; %s]"</code>.</p>
<p><code>rpact.summary.digits</code>: defines how many digits are to be used for numeric values (default is 3).</p>
<p><code>rpact.summary.digits.probs</code>: defines how many digits are to be used for numeric values which refer to probabilities (default is one more than value of <code>rpact.summary.digits</code>, i.e., 4).</p>
<p><code>rpact.summary.trim.zeroes</code>: if <code>TRUE</code> (default), zeroes will be displayed as “0”, e.g., “0.000” will become “0”.</p>
<p><strong>Examples</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"small"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb3-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"large"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.intervalFormat"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[%s; %s]"</span>)</span>
<span id="cb3-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.intervalFormat"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s - %s"</span>)</span>
<span id="cb3-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.justify"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>)</span>
<span id="cb3-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.justify"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"centre"</span>)</span>
<span id="cb3-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.justify"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"right"</span>)</span></code></pre></div></div>
</div>
</section>
<section id="design-summaries" class="level1">
<h1>Design summaries</h1>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb4-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb4-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>,</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb4-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span></span>
<span id="cb4-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>Kim &amp; DeMets alpha spending design (gammaA = 1) and O’Brien &amp; Fleming type beta spending, non-binding futility, one-sided overall significance level 2.5%, power 95%, undefined endpoint, inflation factor 1.1247, ASN H1 0.6553, ASN H01 0.8792, ASN H0 0.7415.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0083</td>
<td>0.0167</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Cumulative beta spent</td>
<td>0.0007</td>
<td>0.0164</td>
<td>0.0500</td>
</tr>
<tr class="even">
<td>Stage levels (one-sided)</td>
<td>0.0083</td>
<td>0.0109</td>
<td>0.0139</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (z-value scale)</td>
<td>2.394</td>
<td>2.294</td>
<td>2.200</td>
</tr>
<tr class="even">
<td>Futility boundary (z-value scale)</td>
<td>-0.993</td>
<td>0.982</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.4259</td>
<td>0.8092</td>
<td>0.9500</td>
</tr>
<tr class="even">
<td>Futility probabilities under H1</td>
<td>&lt;0.001</td>
<td>0.016</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Fixed sample analysis</strong></p>
<p>Fixed design, one-sided significance level 2.5%, power 80%, undefined endpoint.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb6-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 4 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming design, two-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.017, ASN H1 0.8458, ASN H01 0.9876, ASN H0 1.0144.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>25%</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0012</td>
<td>0.0086</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>&lt;0.0001</td>
<td>0.0012</td>
<td>0.0082</td>
<td>0.0221</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>4.579</td>
<td>3.238</td>
<td>2.644</td>
<td>2.289</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0012</td>
<td>0.1494</td>
<td>0.5227</td>
<td>0.8000</td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb7-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 4 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming design, two-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.017, ASN H1 0.8458, ASN H01 0.9876, ASN H0 1.0144.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>25%</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.000004679</td>
<td>0.001207215</td>
<td>0.008644578</td>
<td>0.024999990</td>
</tr>
<tr class="odd">
<td>Stage levels (two-sided)</td>
<td>0.000004679</td>
<td>0.001205239</td>
<td>0.008204894</td>
<td>0.022058711</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>4.579</td>
<td>3.238</td>
<td>2.644</td>
<td>2.289</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.001247</td>
<td>0.149399</td>
<td>0.522709</td>
<td>0.800000</td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-3">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 3 looks (group sequential design)</strong></p>
<p>O’Brien &amp; Fleming design, non-binding futility, one-sided overall significance level 2.5%, power 80%, undefined endpoint, inflation factor 1.0178, ASN H1 0.8529, ASN H01 0.9413, ASN H0 0.8457.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.000259</td>
<td>0.007160</td>
<td>0.025000</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.000259</td>
<td>0.007055</td>
<td>0.022533</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.47109</td>
<td>2.45443</td>
<td>2.00404</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-Inf</td>
<td>0</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.032939</td>
<td>0.442575</td>
<td>0.800000</td>
</tr>
<tr class="odd">
<td>Futility probabilities under H1</td>
<td>0</td>
<td>0.01051</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="design-plan-summaries" class="level1">
<h1>Design plan summaries</h1>
<section id="design-plan-summaries---means" class="level2">
<h2 class="anchored" data-anchor-id="design-plan-summaries---means">Design plan summaries - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb9-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect = -0.5, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.241</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t)</td>
<td>-0.364</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t)</td>
<td>0.364</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>154.6</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb10-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb10-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb10-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a continuous endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, power directed towards smaller values, H1: effect as specified, standard deviation = 1, number of subjects = 100.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>-1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>-0.397</td>
</tr>
<tr class="even">
<td>Power, alt. = -0.5</td>
<td>0.6969</td>
</tr>
<tr class="odd">
<td>Power, alt. = -0.3</td>
<td>0.3175</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>100.0</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0002592</td>
<td>0.0071601</td>
<td>0.0250000</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0002592</td>
<td>0.0070554</td>
<td>0.0225331</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1.000</td>
<td>2.000</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.2</td>
<td>0.322</td>
<td>0.160</td>
<td>0.107</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.4</td>
<td>0.655</td>
<td>0.321</td>
<td>0.213</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.6</td>
<td>1.013</td>
<td>0.483</td>
<td>0.319</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.8</td>
<td>1.413</td>
<td>0.646</td>
<td>0.424</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 1</td>
<td>1.882</td>
<td>0.812</td>
<td>0.528</td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.2</td>
<td>0.0921</td>
<td>0.1303</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.4</td>
<td>0.184</td>
<td>0.261</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.6</td>
<td>0.276</td>
<td>0.391</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.8</td>
<td>0.368</td>
<td>0.522</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 1</td>
<td>0.459</td>
<td>0.653</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.09667</td>
<td>0.70304</td>
<td>0.80000</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.2</td>
<td>472.2</td>
<td>944.4</td>
<td>1416.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.4</td>
<td>118.9</td>
<td>237.8</td>
<td>356.8</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.6</td>
<td>53.5</td>
<td>107</td>
<td>160.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.8</td>
<td>30.6</td>
<td>61.3</td>
<td>91.9</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 1</td>
<td>20.1</td>
<td>40.1</td>
<td>60.2</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td>888.9</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>223.9</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>100.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td>57.7</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 1</td>
<td></td>
<td></td>
<td>37.8</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.8416</td>
<td>0.1462</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.2176</td>
<td>0.6822</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0002592</td>
<td>0.0062354</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.09667</td>
<td>0.60637</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.8413</td>
<td>0.1400</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.12094</td>
<td>0.07581</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb12-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb12-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-5">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect = 1, standard deviation = 1, maximum number of subjects = 100.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1.000</td>
<td>2.000</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t)</td>
<td>1.340</td>
<td>0.618</td>
<td>0.406</td>
</tr>
<tr class="odd">
<td>Futility boundary (t)</td>
<td>0.352</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.2700</td>
<td>0.9281</td>
<td>0.9563</td>
</tr>
<tr class="odd">
<td>Number of subjects</td>
<td>33.3</td>
<td>66.7</td>
<td>100.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>57.6</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.8416</td>
<td>0.1462</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.3015</td>
<td>0.6702</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0003</td>
<td>0.0062</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.2700</td>
<td>0.6582</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.8413</td>
<td>0.1400</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.0316</td>
<td>0.0120</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1.000</td>
<td>2.000</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.2</td>
<td>0.322</td>
<td>0.160</td>
<td>0.107</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.4</td>
<td>0.655</td>
<td>0.321</td>
<td>0.213</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.6</td>
<td>1.013</td>
<td>0.483</td>
<td>0.319</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.8</td>
<td>1.413</td>
<td>0.646</td>
<td>0.424</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 1</td>
<td>1.882</td>
<td>0.812</td>
<td>0.528</td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.2</td>
<td>0.092</td>
<td>0.130</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.4</td>
<td>0.184</td>
<td>0.261</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.6</td>
<td>0.276</td>
<td>0.391</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.8</td>
<td>0.368</td>
<td>0.522</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 1</td>
<td>0.459</td>
<td>0.653</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0967</td>
<td>0.7030</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.2</td>
<td>472.2</td>
<td>944.4</td>
<td>1416.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.4</td>
<td>118.9</td>
<td>237.8</td>
<td>356.8</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.6</td>
<td>53.5</td>
<td>107.0</td>
<td>160.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.8</td>
<td>30.6</td>
<td>61.3</td>
<td>91.9</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 1</td>
<td>20.1</td>
<td>40.1</td>
<td>60.2</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td>888.9</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>223.9</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>100.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td>57.7</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 1</td>
<td></td>
<td></td>
<td>37.8</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.8416</td>
<td>0.1462</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.2176</td>
<td>0.6822</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0003</td>
<td>0.0062</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0967</td>
<td>0.6064</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.8413</td>
<td>0.1400</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.1209</td>
<td>0.0758</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0002592</td>
<td>0.0071601</td>
<td>0.0250000</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0002592</td>
<td>0.0070554</td>
<td>0.0225331</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1.000</td>
<td>2.000</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.2</td>
<td>0.322</td>
<td>0.160</td>
<td>0.107</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.4</td>
<td>0.655</td>
<td>0.321</td>
<td>0.213</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.6</td>
<td>1.013</td>
<td>0.483</td>
<td>0.319</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.8</td>
<td>1.413</td>
<td>0.646</td>
<td>0.424</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 1</td>
<td>1.882</td>
<td>0.812</td>
<td>0.528</td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.2</td>
<td>0.0921</td>
<td>0.1303</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.4</td>
<td>0.184</td>
<td>0.261</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.6</td>
<td>0.276</td>
<td>0.391</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.8</td>
<td>0.368</td>
<td>0.522</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 1</td>
<td>0.459</td>
<td>0.653</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.09667</td>
<td>0.70304</td>
<td>0.80000</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.2</td>
<td>472.2</td>
<td>944.4</td>
<td>1416.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.4</td>
<td>118.9</td>
<td>237.8</td>
<td>356.8</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.6</td>
<td>53.5</td>
<td>107</td>
<td>160.5</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.8</td>
<td>30.6</td>
<td>61.3</td>
<td>91.9</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 1</td>
<td>20.1</td>
<td>40.1</td>
<td>60.2</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td>888.9</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>223.9</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>100.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td>57.7</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 1</td>
<td></td>
<td></td>
<td>37.8</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.8416</td>
<td>0.1462</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.2176</td>
<td>0.6822</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0002592</td>
<td>0.0062354</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.09667</td>
<td>0.60637</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.8413</td>
<td>0.1400</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.12094</td>
<td>0.07581</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, H1: effect as specified, standard deviation = 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.000259173723496486</td>
<td>0.00716005940148245</td>
<td>0.02499999</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.000259173723496486</td>
<td>0.00705536161371012</td>
<td>0.0225331246048346</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.4710914446541</td>
<td>2.45443229863353</td>
<td>2.00403557995285</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1</td>
<td>2</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.2</td>
<td>0.321710839190306</td>
<td>0.160038360077678</td>
<td>0.106587932791278</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.4</td>
<td>0.654823493383807</td>
<td>0.320689953155167</td>
<td>0.212954736915397</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 0.6</td>
<td>1.01268266453837</td>
<td>0.482561132966477</td>
<td>0.318855026247289</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), alt. = 0.8</td>
<td>1.41302933799472</td>
<td>0.646240615813089</td>
<td>0.4239964819812</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), alt. = 1</td>
<td>1.88164819392791</td>
<td>0.812280944461674</td>
<td>0.52802083832574</td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.2</td>
<td>0.09213829</td>
<td>0.13033753</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.4</td>
<td>0.18418994</td>
<td>0.26075187</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 0.6</td>
<td>0.27608063</td>
<td>0.39130341</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), alt. = 0.8</td>
<td>0.36776309</td>
<td>0.52201903</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), alt. = 1</td>
<td>0.45923643</td>
<td>0.65287366</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0966650610605349</td>
<td>0.703040057014069</td>
<td>0.80000000002314</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.2</td>
<td>472.175971190541</td>
<td>944.351942381081</td>
<td>1416.52791357162</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.4</td>
<td>118.91882087368</td>
<td>237.83764174736</td>
<td>356.75646262104</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 0.6</td>
<td>53.5130463596034</td>
<td>107.026092719207</td>
<td>160.53913907881</td>
</tr>
<tr class="even">
<td>Number of subjects, alt. = 0.8</td>
<td>30.635272552971</td>
<td>61.2705451059419</td>
<td>91.9058176589129</td>
</tr>
<tr class="odd">
<td>Number of subjects, alt. = 1</td>
<td>20.061450159433</td>
<td>40.122900318866</td>
<td>60.184350478299</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td>888.920027605175</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>223.876961098363</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>100.743836089914</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td>57.6740643002559</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 1</td>
<td></td>
<td></td>
<td>37.7677516807113</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.841603919792039</td>
<td>0.146222739762505</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.217605032843877</td>
<td>0.682186663832684</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.000259173723496486</td>
<td>0.00623541950983217</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0966650610605349</td>
<td>0.606374995953535</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.841344746068543</td>
<td>0.139987320252672</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.120939971783342</td>
<td>0.0758116678791494</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
</div>
</section>
<section id="design-plan-summaries---rates" class="level2">
<h2 class="anchored" data-anchor-id="design-plan-summaries---rates">Design plan summaries - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) as specified, control rate pi(2) = 0.3.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), pi(1) = 0.4</td>
<td>0.069</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), pi(1) = 0.5</td>
<td>0.139</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), pi(1) = 0.6</td>
<td>0.210</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.4</td>
<td>711.9</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.5</td>
<td>186.0</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.6</td>
<td>83.9</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%, power 80%. The results were calculated for a two-sample test for rates (normal approximation), H0: pi(1) - pi(2) = 0, H1: pi(1) as specified, control rate pi(2) = 0.2.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>1.000</td>
<td>2.000</td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), pi(1) = 0.4</td>
<td>0.339</td>
<td>0.158</td>
<td>0.102</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), pi(1) = 0.5</td>
<td>0.509</td>
<td>0.238</td>
<td>0.152</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), pi(1) = 0.6</td>
<td>0.669</td>
<td>0.322</td>
<td>0.205</td>
</tr>
<tr class="odd">
<td>Futility boundary (t), pi(1) = 0.4</td>
<td>0.087</td>
<td>0.126</td>
<td></td>
</tr>
<tr class="even">
<td>Futility boundary (t), pi(1) = 0.5</td>
<td>0.130</td>
<td>0.190</td>
<td></td>
</tr>
<tr class="odd">
<td>Futility boundary (t), pi(1) = 0.6</td>
<td>0.175</td>
<td>0.257</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power</td>
<td>0.0967</td>
<td>0.7030</td>
<td>0.8000</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.4</td>
<td>97.5</td>
<td>195.0</td>
<td>292.5</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.5</td>
<td>46.2</td>
<td>92.4</td>
<td>138.6</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.6</td>
<td>26.8</td>
<td>53.6</td>
<td>80.4</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.4</td>
<td></td>
<td></td>
<td>183.5</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, pi(1) = 0.5</td>
<td></td>
<td></td>
<td>86.9</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.6</td>
<td></td>
<td></td>
<td>50.5</td>
</tr>
<tr class="odd">
<td>Overall exit probability (under H0)</td>
<td>0.8416</td>
<td>0.1462</td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability (under H1)</td>
<td>0.2176</td>
<td>0.6822</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0003</td>
<td>0.0062</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1)</td>
<td>0.0967</td>
<td>0.6064</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility (under H0)</td>
<td>0.8413</td>
<td>0.1400</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility (under H1)</td>
<td>0.1209</td>
<td>0.0758</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb18-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>(</span>
<span id="cb18-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb18-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb18-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb18-9">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a binary endpoint</strong></p>
<p>Fixed sample analysis, two-sided significance level 2.5%, power 80%. The results were calculated for a one-sample test for rates (normal approximation), H0: pi = 0.2, H1: pi as specified.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (two-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.241</td>
</tr>
<tr class="odd">
<td>Lower efficacy boundary (t), pi(1) = 0.4</td>
<td>0.063</td>
</tr>
<tr class="even">
<td>Lower efficacy boundary (t), pi(1) = 0.4</td>
<td>0.063</td>
</tr>
<tr class="odd">
<td>Upper efficacy boundary (t), pi(1) = 0.4</td>
<td>0.337</td>
</tr>
<tr class="even">
<td>Upper efficacy boundary (t), pi(1) = 0.4</td>
<td>0.337</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.4</td>
<td>42.8</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.4</td>
<td>42.8</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
<section id="design-plan-summaries---survival" class="level2">
<h2 class="anchored" data-anchor-id="design-plan-summaries---survival">Design plan summaries - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb19-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb19-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span></span>
<span id="cb19-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 1.2, control lambda(2) = 0.3, accrual time = 12, accrual intensity = 81.6, follow-up time = 6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>1.136</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>979.2</td>
</tr>
<tr class="odd">
<td>Number of events</td>
<td>944.5</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td>18.00</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb20-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>),</span>
<span id="cb20-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span></span>
<span id="cb20-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: treatment median(1) as specified, control median(2) = 2.3, accrual time = 12, follow-up time = 6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t), median(1) = 3.1</td>
<td>0.812</td>
</tr>
<tr class="even">
<td>Efficacy boundary (t), median(1) = 3.2</td>
<td>0.794</td>
</tr>
<tr class="odd">
<td>Number of subjects, median(1) = 3.1</td>
<td>377.9</td>
</tr>
<tr class="even">
<td>Number of subjects, median(1) = 3.2</td>
<td>309.7</td>
</tr>
<tr class="odd">
<td>Number of events, median(1) = 3.1</td>
<td>352.4</td>
</tr>
<tr class="even">
<td>Number of events, median(1) = 3.2</td>
<td>287.9</td>
</tr>
<tr class="odd">
<td>Analysis time</td>
<td>18.00</td>
</tr>
<tr class="even">
<td>Expected study duration under H1, median(1) = 3.1</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1, median(1) = 3.2</td>
<td>18.00</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb21-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb21-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb21-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: treatment pi(1) = 0.1, control pi(2) = 0.3, event time = 12, accrual time = 12, accrual intensity = 8.9, follow-up time = 6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>0.426</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>106.7</td>
</tr>
<tr class="odd">
<td>Number of events</td>
<td>21.1</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td>18.00</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb22-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb22-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb22-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb22-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb22-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb22-7">)</span>
<span id="cb22-8"></span>
<span id="cb22-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb22-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb22-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span></span>
<span id="cb22-12">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sample size calculation for a survival endpoint</strong></p>
<p>Fixed sample analysis, one-sided significance level 2.5%, power 80%. The results were calculated for a two-sample logrank test, H0: hazard ratio = 1, H1: hazard ratio = 1.2, piecewise survival distribution, piecewise survival time = c(0, 6, 9, 15, 21), control lambda(2) = c(0.025, 0.04, 0.015, 0.01, 0.007), accrual time = 12, accrual intensity = 279.2, follow-up time = 6.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stage level (one-sided)</td>
<td>0.0250</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>1.960</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>1.136</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>3350.9</td>
</tr>
<tr class="odd">
<td>Number of events</td>
<td>944.5</td>
</tr>
<tr class="even">
<td>Analysis time</td>
<td>18.00</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1</td>
<td>18.00</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
</ul>
</div>
</div>
</section>
</section>
<section id="simulation-results-summaries" class="level1">
<h1>Simulation results summaries</h1>
<section id="simulation-results-base" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-base">Simulation results base</h2>
<section id="simulation-results-base---means" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-base---means">Simulation results base - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb23-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb23-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb23-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb23-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb23-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>,</span>
<span id="cb23-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>,</span>
<span id="cb23-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb23-9">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMeans</span>(</span>
<span id="cb23-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb23-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>),</span>
<span id="cb23-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb23-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb23-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb23-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb23-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb23-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb23-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb23-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb23-21">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a two-sample t-test (normal approximation), H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect as specified, standard deviation = 1.2, planned cumulative sample size = c(40, 70, 100), sample size reassessment: conditional power = 0.8, minimum subjects per stage = c(40, 20, 20), maximum subjects per stage = c(40, 100, 100), theta H1 = 0.6, standard deviation H1 = 1.5, simulation runs = 1000, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.632</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0043</td>
<td>0.0134</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0043</td>
<td>0.0111</td>
<td>0.0182</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.631</td>
<td>2.287</td>
<td>2.092</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0</td>
<td>0.0040</td>
<td>0.0110</td>
<td>0.0270</td>
</tr>
<tr class="odd">
<td>Cumulative power, alt. = 0.2</td>
<td>0.0190</td>
<td>0.0960</td>
<td>0.2090</td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0.4</td>
<td>0.0390</td>
<td>0.3250</td>
<td>0.6260</td>
</tr>
<tr class="odd">
<td>Cumulative power, alt. = 0.6</td>
<td>0.1330</td>
<td>0.7100</td>
<td>0.9300</td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0.8</td>
<td>0.2830</td>
<td>0.9320</td>
<td>0.9930</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects, alt. = 0</td>
<td>40.0</td>
<td>99.3</td>
<td>98.1</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects, alt. = 0.2</td>
<td>40.0</td>
<td>98.6</td>
<td>95.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects, alt. = 0.4</td>
<td>40.0</td>
<td>96.8</td>
<td>86.6</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects, alt. = 0.6</td>
<td>40.0</td>
<td>93.5</td>
<td>75.7</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects, alt. = 0.8</td>
<td>40.0</td>
<td>88.9</td>
<td>73.3</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0</td>
<td></td>
<td></td>
<td>151.5</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td>186.1</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td>179.3</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td>139.1</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td>108.2</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), alt. = 0</td>
<td></td>
<td>0.2206</td>
<td>0.3011</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), alt. = 0.2</td>
<td></td>
<td>0.3112</td>
<td>0.4507</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), alt. = 0.4</td>
<td></td>
<td>0.4009</td>
<td>0.5970</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), alt. = 0.6</td>
<td></td>
<td>0.5292</td>
<td>0.7151</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), alt. = 0.8</td>
<td></td>
<td>0.6066</td>
<td>0.7396</td>
</tr>
<tr class="even">
<td>Exit probability for futility, alt. = 0</td>
<td>0.3200</td>
<td>0.2170</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility, alt. = 0.2</td>
<td>0.1500</td>
<td>0.0790</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility, alt. = 0.4</td>
<td>0.0610</td>
<td>0.0110</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility, alt. = 0.6</td>
<td>0.0230</td>
<td>0</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility, alt. = 0.8</td>
<td>0.0030</td>
<td>0</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
</div>
</section>
<section id="simulation-results-base---rates" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-base---rates">Simulation results base - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb24-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb24-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb24-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha0Vec =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>),</span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb24-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-7">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(</span>
<span id="cb24-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb24-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb24-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb24-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>),</span>
<span id="cb24-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb24-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb24-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb24-16">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a binary endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 2.5%. The results were simulated for a one-sample test for rates (normal approximation), H0: pi = 0.2, power directed towards smaller values, H1: pi as specified, planned cumulative sample size = c(40, 70, 100), simulation runs = 1000, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>0.866</td>
<td>0.866</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0132</td>
<td>0.0199</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0132</td>
<td>0.0132</td>
<td>0.0132</td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.013187</td>
<td>0.002705</td>
<td>0.000641</td>
</tr>
<tr class="odd">
<td>Futility boundary (separate p-value scale)</td>
<td>0.5000</td>
<td>0.4000</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power, pi(1) = 0.05</td>
<td>0.6790</td>
<td>0.9040</td>
<td>0.9780</td>
</tr>
<tr class="odd">
<td>Cumulative power, pi(1) = 0.1</td>
<td>0.2150</td>
<td>0.3760</td>
<td>0.5540</td>
</tr>
<tr class="even">
<td>Cumulative power, pi(1) = 0.15</td>
<td>0.0390</td>
<td>0.0670</td>
<td>0.1070</td>
</tr>
<tr class="odd">
<td>Cumulative power, pi(1) = 0.2</td>
<td>0.0090</td>
<td>0.0100</td>
<td>0.0110</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects, pi(1) = 0.05</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects, pi(1) = 0.1</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects, pi(1) = 0.15</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects, pi(1) = 0.2</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.05</td>
<td></td>
<td></td>
<td>52.4</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, pi(1) = 0.1</td>
<td></td>
<td></td>
<td>78.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.15</td>
<td></td>
<td></td>
<td>76.9</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, pi(1) = 0.2</td>
<td></td>
<td></td>
<td>58.0</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), pi(1) = 0.05</td>
<td></td>
<td>0.4489</td>
<td>0.5698</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), pi(1) = 0.1</td>
<td></td>
<td>0.2752</td>
<td>0.3434</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), pi(1) = 0.15</td>
<td></td>
<td>0.1405</td>
<td>0.1871</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), pi(1) = 0.2</td>
<td></td>
<td>0.0820</td>
<td>0.0932</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="simulation-results-base---survival" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-base---survival">Simulation results base - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb25-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb25-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb25-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb25-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb25-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>,</span>
<span id="cb25-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb25-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb25-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>),</span>
<span id="cb25-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>,</span>
<span id="cb25-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb25-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>),</span>
<span id="cb25-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb25-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocation1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb25-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb25-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb25-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb25-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb25-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb25-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb25-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb25-23">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint</strong></p>
<p>Sequential analysis with a maximum of 4 looks (inverse normal combination test design), one-sided overall significance level 5%. The results were simulated for a two-sample logrank test, H0: hazard ratio = 1.2, power directed towards smaller values, H1: treatment pi(1) as specified, control pi(2) = 0.2, planned cumulative events = c(40, 70, 100, 150), maximum number of subjects = 600, planned allocation ratio = 2, event time = 12, accrual time = 12, accrual intensity = 50, sample size reassessment: conditional power = 0.8, minimum events per stage = c(40, 20, 20, 20), maximum events per stage = c(40, 100, 100, 100), thetaH1 = 0.833, simulation runs = 1000, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.5</td>
<td>0.5</td>
<td>0.5</td>
<td>0.5</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0011</td>
<td>0.0105</td>
<td>0.0282</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0011</td>
<td>0.0100</td>
<td>0.0240</td>
<td>0.0390</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.069</td>
<td>2.326</td>
<td>1.978</td>
<td>1.763</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative power, pi(1) = 0.1</td>
<td>0.4490</td>
<td>0.9970</td>
<td>0.9980</td>
<td>0.9980</td>
</tr>
<tr class="odd">
<td>Cumulative power, pi(1) = 0.15</td>
<td>0.0720</td>
<td>0.7000</td>
<td>0.9080</td>
<td>0.9320</td>
</tr>
<tr class="even">
<td>Cumulative power, pi(1) = 0.2</td>
<td>0.0080</td>
<td>0.1110</td>
<td>0.2740</td>
<td>0.4160</td>
</tr>
<tr class="odd">
<td>Cumulative power, pi(1) = 0.25</td>
<td>0</td>
<td>0.0010</td>
<td>0.0040</td>
<td>0.0080</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.1</td>
<td>577.4</td>
<td>600.0</td>
<td>600.0</td>
<td>n/a</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.15</td>
<td>521.6</td>
<td>600.0</td>
<td>600.0</td>
<td>600.0</td>
</tr>
<tr class="even">
<td>Number of subjects, pi(1) = 0.2</td>
<td>474.5</td>
<td>600.0</td>
<td>600.0</td>
<td>600.0</td>
</tr>
<tr class="odd">
<td>Number of subjects, pi(1) = 0.25</td>
<td>434.5</td>
<td>600.0</td>
<td>600.0</td>
<td>600.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.1</td>
<td></td>
<td></td>
<td></td>
<td>589.8</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, pi(1) = 0.15</td>
<td></td>
<td></td>
<td></td>
<td>589.4</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, pi(1) = 0.2</td>
<td></td>
<td></td>
<td></td>
<td>567.6</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, pi(1) = 0.25</td>
<td></td>
<td></td>
<td></td>
<td>505.5</td>
</tr>
<tr class="even">
<td>Cumulative number of events, pi(1) = 0.1</td>
<td>40.0</td>
<td>140.0</td>
<td>240.0</td>
<td>240.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events, pi(1) = 0.15</td>
<td>40.0</td>
<td>140.0</td>
<td>240.0</td>
<td>340.0</td>
</tr>
<tr class="even">
<td>Cumulative number of events, pi(1) = 0.2</td>
<td>40.0</td>
<td>140.0</td>
<td>240.0</td>
<td>340.0</td>
</tr>
<tr class="odd">
<td>Cumulative number of events, pi(1) = 0.25</td>
<td>40.0</td>
<td>140.0</td>
<td>240.0</td>
<td>340.0</td>
</tr>
<tr class="even">
<td>Expected number of events under H1, pi(1) = 0.1</td>
<td></td>
<td></td>
<td></td>
<td>95.0</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1, pi(1) = 0.15</td>
<td></td>
<td></td>
<td></td>
<td>152.9</td>
</tr>
<tr class="even">
<td>Expected number of events under H1, pi(1) = 0.2</td>
<td></td>
<td></td>
<td></td>
<td>215.2</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1, pi(1) = 0.25</td>
<td></td>
<td></td>
<td></td>
<td>124.9</td>
</tr>
<tr class="even">
<td>Analysis time, pi(1) = 0.1</td>
<td>11.84</td>
<td>28.30</td>
<td>47.88</td>
<td></td>
</tr>
<tr class="odd">
<td>Analysis time, pi(1) = 0.15</td>
<td>10.45</td>
<td>23.55</td>
<td>39.32</td>
<td>60.37</td>
</tr>
<tr class="even">
<td>Analysis time, pi(1) = 0.2</td>
<td>9.50</td>
<td>20.36</td>
<td>33.58</td>
<td>50.99</td>
</tr>
<tr class="odd">
<td>Analysis time, pi(1) = 0.25</td>
<td>8.70</td>
<td>18.17</td>
<td>29.31</td>
<td>44.11</td>
</tr>
<tr class="even">
<td>Expected study duration under H1, pi(1) = 0.1</td>
<td></td>
<td></td>
<td></td>
<td>20.88</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1, pi(1) = 0.15</td>
<td></td>
<td></td>
<td></td>
<td>26.13</td>
</tr>
<tr class="even">
<td>Expected study duration under H1, pi(1) = 0.2</td>
<td></td>
<td></td>
<td></td>
<td>32.68</td>
</tr>
<tr class="odd">
<td>Expected study duration under H1, pi(1) = 0.25</td>
<td></td>
<td></td>
<td></td>
<td>18.03</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), pi(1) = 0.1</td>
<td></td>
<td>0.4510</td>
<td>0.5143</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), pi(1) = 0.15</td>
<td></td>
<td>0.2508</td>
<td>0.4691</td>
<td>0.4954</td>
</tr>
<tr class="even">
<td>Conditional power (achieved), pi(1) = 0.2</td>
<td></td>
<td>0.1281</td>
<td>0.2627</td>
<td>0.3225</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved), pi(1) = 0.25</td>
<td></td>
<td>0.0687</td>
<td>0.1110</td>
<td>0.1467</td>
</tr>
<tr class="even">
<td>Exit probability for futility, pi(1) = 0.1</td>
<td>0.0020</td>
<td>0</td>
<td>0</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility, pi(1) = 0.15</td>
<td>0.0630</td>
<td>0.0010</td>
<td>0</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for futility, pi(1) = 0.2</td>
<td>0.2500</td>
<td>0.0460</td>
<td>0.0130</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for futility, pi(1) = 0.25</td>
<td>0.5710</td>
<td>0.1790</td>
<td>0.0750</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="simulation-results-multi-arm" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-multi-arm">Simulation results multi-arm</h2>
<section id="simulation-results-multi-arm---means" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-multi-arm---means">Simulation results multi-arm - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb26-2"></span>
<span id="cb26-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb26-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb26-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb26-6">)</span>
<span id="cb26-7"></span>
<span id="cb26-8">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb26-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb26-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb26-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigmoidEmax"</span>,</span>
<span id="cb26-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gED50 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb26-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>,</span>
<span id="cb26-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb26-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb26-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb26-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb26-19">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 5%. The results were simulated for a multi-arm comparisons for means (3 treatments vs.&nbsp;control), H0: mu(i) - mu(control) = 0, power directed towards larger values, H1: effect as specified, standard deviation = 1.2, planned cumulative sample size = c(40, 70, 100), effect shape = sigmoid emax, slope = 1, ED50 = 2, dose levels = c(1, 2, 3), intersection test = Dunnett, selection = r best, r = 2, effect measure based on effect estimate, success criterion: all, simulation runs = 100, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Situation 2 Situation 3 Situation 4 Situation 5 Situation 6 Arm 1 0 0.06666667 0.1333333 0.20 0.2666667 0.3333333 Arm 2 0 0.10000000 0.2000000 0.30 0.4000000 0.5000000 Arm 3 0 0.12000000 0.2400000 0.36 0.4800000 0.6000000</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
<col style="width: 1%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0255</td>
<td>0.0398</td>
<td>0.0500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0255</td>
<td>0.0255</td>
<td>0.0255</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0255136</td>
<td>0.0038966</td>
<td>0.0007481</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [1]</td>
<td></td>
<td></td>
<td>0.0500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [2]</td>
<td></td>
<td></td>
<td>0.1400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [3]</td>
<td></td>
<td></td>
<td>0.2900</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [4]</td>
<td></td>
<td></td>
<td>0.4800</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [5]</td>
<td></td>
<td></td>
<td>0.7100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [6]</td>
<td></td>
<td></td>
<td>0.9100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [1]</td>
<td>0</td>
<td>0.0200</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [2]</td>
<td>0</td>
<td>0.0200</td>
<td>0.0100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [3]</td>
<td>0.0200</td>
<td>0.0400</td>
<td>0.0400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [4]</td>
<td>0.0400</td>
<td>0.1600</td>
<td>0.0500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [5]</td>
<td>0.0700</td>
<td>0.2400</td>
<td>0.1100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [6]</td>
<td>0.2000</td>
<td>0.4000</td>
<td>0.0900</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects [4]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [5]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects [6]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>40.0</td>
<td>19.2</td>
<td>19.3</td>
<td>40.0</td>
<td>17.4</td>
<td>17.8</td>
<td>40.0</td>
<td>17.1</td>
<td>17.6</td>
<td>40.0</td>
<td>15.9</td>
<td>16.5</td>
<td>40.0</td>
<td>12.6</td>
<td>12.2</td>
<td>40.0</td>
<td>12.4</td>
<td>16.5</td>
<td>40.0</td>
<td>18.9</td>
<td>19.0</td>
<td>40.0</td>
<td>20.1</td>
<td>19.9</td>
<td>40.0</td>
<td>20.8</td>
<td>20.7</td>
<td>40.0</td>
<td>18.8</td>
<td>19.1</td>
<td>40.0</td>
<td>22.9</td>
<td>23.5</td>
<td>40.0</td>
<td>20.2</td>
<td>18.0</td>
<td>40.0</td>
<td>21.9</td>
<td>21.7</td>
<td>40.0</td>
<td>22.5</td>
<td>22.3</td>
<td>40.0</td>
<td>22.0</td>
<td>21.7</td>
<td>40.0</td>
<td>25.3</td>
<td>24.4</td>
<td>40.0</td>
<td>24.5</td>
<td>24.3</td>
<td>40.0</td>
<td>27.4</td>
<td>25.5</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
<td>40.0</td>
<td>30.0</td>
<td>30.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [1]</td>
<td></td>
<td></td>
<td>338.2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [2]</td>
<td></td>
<td></td>
<td>338.2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [3]</td>
<td></td>
<td></td>
<td>332.8</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [4]</td>
<td></td>
<td></td>
<td>318.4</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [5]</td>
<td></td>
<td></td>
<td>305.8</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [6]</td>
<td></td>
<td></td>
<td>268.0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [1]</td>
<td>0</td>
<td>0.0200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [2]</td>
<td>0</td>
<td>0.0200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [3]</td>
<td>0.0200</td>
<td>0.0400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [4]</td>
<td>0.0400</td>
<td>0.1600</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [5]</td>
<td>0.0700</td>
<td>0.2400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [6]</td>
<td>0.2000</td>
<td>0.4000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.6400</td>
<td>0.6300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.6300</td>
<td>0.6200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7300</td>
<td>0.7100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.5800</td>
<td>0.5800</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.6700</td>
<td>0.6500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7500</td>
<td>0.7300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.5600</td>
<td>0.5500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.6800</td>
<td>0.6500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7200</td>
<td>0.6800</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [4]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.5100</td>
<td>0.4400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.6000</td>
<td>0.5100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.8100</td>
<td>0.6500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [5]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.3900</td>
<td>0.2800</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.7100</td>
<td>0.5400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7600</td>
<td>0.5600</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [6]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.2200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.5400</td>
<td>0.2400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.7300</td>
<td>0.3400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [1]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [2]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [3]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [4]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [5]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [6]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
<li><em>[j]</em>: effect matrix row j (situation to consider)</li>
</ul>
</div>
</div>
</section>
<section id="simulation-results-multi-arm---rates" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-multi-arm---rates">Simulation results multi-arm - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb27-2"></span>
<span id="cb27-3">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmRates</span>(</span>
<span id="cb27-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb27-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb27-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"userDefined"</span>,</span>
<span id="cb27-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectMatrix =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb27-9">            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb27-10">            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb27-11">            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span></span>
<span id="cb27-12">        ), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb27-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>,</span>
<span id="cb27-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb27-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb27-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb27-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb27-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb27-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb27-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb27-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatmentsH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb27-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControlH1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb27-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb27-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb27-25">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a binary endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 5%. The results were simulated for a multi-arm comparisons for rates (3 treatments vs.&nbsp;control), H0: pi(i) - pi(control) = 0, power directed towards smaller values, H1: pi_max as specified, control rate pi(control) = 0.4, planned cumulative sample size = c(40, 70, 100), planned allocation ratio = 2, effect shape = user defined, intersection test = Dunnett, selection = r best, r = 2, effect measure based on effect estimate, success criterion: all, sample size reassessment: conditional power = 0.8, minimum subjects per stage = c(40, 20, 20), maximum subjects per stage = c(40, 100, 100), pi(treatment)H1 = 0.6, pi(control)H1 = 0.4, simulation runs = 100, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Situation 2 Situation 3 Arm 1 0.1 0.2 0.3 Arm 2 0.2 0.3 0.4 Arm 3 0.2 0.4 0.4</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0255</td>
<td>0.0398</td>
<td>0.0500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0255</td>
<td>0.0255</td>
<td>0.0255</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0255136</td>
<td>0.0038966</td>
<td>0.0007481</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [1]</td>
<td></td>
<td></td>
<td>1.0000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [2]</td>
<td></td>
<td></td>
<td>0.9200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [3]</td>
<td></td>
<td></td>
<td>0.4300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [1]</td>
<td>0.1800</td>
<td>0.5500</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [2]</td>
<td>0</td>
<td>0.1600</td>
<td>0.0900</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [3]</td>
<td>0.0100</td>
<td>0.0200</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Control arm</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Treatment arm 2</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Treatment arm 3</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="odd">
<td>Control arm</td>
<td>40.0</td>
<td>69.3</td>
<td>22.2</td>
<td>40.0</td>
<td>91.0</td>
<td>62.6</td>
<td>40.0</td>
<td>93.9</td>
<td>88.0</td>
<td>40.0</td>
<td>39.8</td>
<td>16.3</td>
<td>40.0</td>
<td>78.6</td>
<td>54.8</td>
<td>40.0</td>
<td>45.5</td>
<td>41.0</td>
<td>40.0</td>
<td>34.4</td>
<td>13.3</td>
<td>40.0</td>
<td>14.4</td>
<td>10.2</td>
<td>40.0</td>
<td>60.6</td>
<td>59.4</td>
<td>20.0</td>
<td>35.9</td>
<td>13.0</td>
<td>20.0</td>
<td>46.0</td>
<td>31.9</td>
<td>20.0</td>
<td>50.0</td>
<td>47.1</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [1]</td>
<td></td>
<td></td>
<td>304.5</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1 [2]</td>
<td></td>
<td></td>
<td>504.0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1 [3]</td>
<td></td>
<td></td>
<td>616.0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [1]</td>
<td>0.1800</td>
<td>0.5500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [2]</td>
<td>0</td>
<td>0.1600</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [3]</td>
<td>0.0100</td>
<td>0.0200</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.8000</td>
<td>0.2600</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.4300</td>
<td>0.1400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.4100</td>
<td>0.1400</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.9900</td>
<td>0.8300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.8500</td>
<td>0.7000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.1600</td>
<td>0.1500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1</td>
<td>1.0000</td>
<td>0.9300</td>
<td>0.9100</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2</td>
<td>1.0000</td>
<td>0.4500</td>
<td>0.4300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 3</td>
<td>1.0000</td>
<td>0.6000</td>
<td>0.6000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [1]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [2]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [3]</td>
<td>3.000</td>
<td>2.000</td>
<td>2.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: treatment arm i</li>
<li><em>[j]</em>: effect matrix row j (situation to consider)</li>
</ul>
</div>
</div>
</section>
<section id="simulation-results-multi-arm---survival" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-multi-arm---survival">Simulation results multi-arm - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb28-2"></span>
<span id="cb28-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmSurvival</span>(</span>
<span id="cb28-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span>,</span>
<span id="cb28-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb28-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb28-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb28-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb28-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">omegaMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb28-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adaptations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb28-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb28-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb28-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb28-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>,</span>
<span id="cb28-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">calcEventsFunction =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(..., stage, minNumberOfEventsPerStage) {</span>
<span id="cb28-16">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(stage <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, minNumberOfEventsPerStage[stage]))</span>
<span id="cb28-17">    }</span>
<span id="cb28-18">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Note: 'simulationType' = "testStatisticBased" simulates normally distributed log-rank test statistics instead of patient-wise survival data. To simulate patient-wise survival data, specify 'simulationType' = "patientWise" and the corresponding arguments.</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint (multi-arm design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a multi-arm logrank test (4 treatments vs.&nbsp;control), H0: hazard ratio(i) = 1, power directed towards smaller values, H1: omega_max as specified, planned cumulative events = c(10, 30, 50), effect shape = linear, dose levels = c(1, 2, 3, 4), intersection test = Dunnett, selection = best, effect measure based on effect estimate, success criterion: all, sample size reassessment: user defined ‘calcEventsFunction’, minimum events per stage = c(10, 4, 4), maximum events per stage = c(10, 100, 100), simulation runs = 10, seed = 1234.</p>
<p>User defined effect shape: Situation 1 Situation 2 Situation 3 Situation 4 Arm 1 0.825 0.85 0.875 0.9 Arm 2 0.650 0.70 0.750 0.8 Arm 3 0.475 0.55 0.625 0.7 Arm 4 0.300 0.40 0.500 0.6</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
<col style="width: 2%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.447</td>
<td>0.632</td>
<td>0.632</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>&lt;0.0001</td>
<td>0.0051</td>
<td>0.0250</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>&lt;0.0001</td>
<td>0.0051</td>
<td>0.0232</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>4.455</td>
<td>2.572</td>
<td>1.992</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [1]</td>
<td></td>
<td></td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [2]</td>
<td></td>
<td></td>
<td>0.4000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one [3]</td>
<td></td>
<td></td>
<td>0.7000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one [4]</td>
<td></td>
<td></td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [1]</td>
<td>0</td>
<td>0.1000</td>
<td>0.2000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [2]</td>
<td>0</td>
<td>0</td>
<td>0.4000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage [3]</td>
<td>0</td>
<td>0.2000</td>
<td>0.5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage [4]</td>
<td>0</td>
<td>0.1000</td>
<td>0.2000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative number of events [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Cumulative number of events [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Cumulative number of events [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Cumulative number of events [4]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="even">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>5.6</td>
<td>8.5</td>
<td>32.5</td>
<td>5.3</td>
<td>8.0</td>
<td>30.2</td>
<td>5.0</td>
<td>7.7</td>
<td>30.0</td>
<td>4.8</td>
<td>7.4</td>
<td>28.5</td>
<td>5.1</td>
<td>8.1</td>
<td>33.4</td>
<td>4.9</td>
<td>7.7</td>
<td>31.3</td>
<td>4.7</td>
<td>7.3</td>
<td>29.5</td>
<td>4.5</td>
<td>7.0</td>
<td>28.0</td>
<td>4.5</td>
<td>7.8</td>
<td>33.7</td>
<td>4.4</td>
<td>7.7</td>
<td>34.6</td>
<td>4.3</td>
<td>7.4</td>
<td>32.6</td>
<td>4.2</td>
<td>7.4</td>
<td>34.3</td>
<td>4.0</td>
<td>7.0</td>
<td>31.9</td>
<td>4.0</td>
<td>7.3</td>
<td>34.2</td>
<td>4.0</td>
<td>7.0</td>
<td>31.6</td>
<td>4.0</td>
<td>6.6</td>
<td>28.7</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1 [1]</td>
<td></td>
<td></td>
<td>43.7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of events under H1 [2]</td>
<td></td>
<td></td>
<td>47.0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Expected number of events under H1 [3]</td>
<td></td>
<td></td>
<td>40.4</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of events under H1 [4]</td>
<td></td>
<td></td>
<td>43.7</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [1]</td>
<td>0</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [2]</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability [3]</td>
<td>0</td>
<td>0.2000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability [4]</td>
<td>0</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.1000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.2000</td>
<td>0.2000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.4000</td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.3000</td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [2]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.1000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.4000</td>
<td>0.4000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.5000</td>
<td>0.5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected arms [3]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.1000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.1000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.4000</td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.4000</td>
<td>0.3000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Selected arms [4]</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 1 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.2000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 2 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.1000</td>
<td>0.1000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Treatment arm 3 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.5000</td>
<td>0.5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Treatment arm 4 vs.&nbsp;control</td>
<td>1.0000</td>
<td>0.2000</td>
<td>0.2000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [1]</td>
<td>4.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [2]</td>
<td>4.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of selected active arms [3]</td>
<td>4.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of selected active arms [4]</td>
<td>4.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>[j]</em>: effect matrix row j (situation to consider)</li>
</ul>
</div>
</div>
</section>
</section>
<section id="simulation-results-enrichment" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-enrichment">Simulation results enrichment</h2>
<section id="simulation-results-enrichment---means" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-enrichment---means">Simulation results enrichment - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb30-2"></span>
<span id="cb30-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb30-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb30-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb30-6">)</span>
<span id="cb30-7"></span>
<span id="cb30-8">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>)</span>
<span id="cb30-9">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb30-10">alternative <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb30-11">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb30-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb30-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb30-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(alternative, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb30-15">)</span>
<span id="cb30-16"></span>
<span id="cb30-17">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentMeans</span>(</span>
<span id="cb30-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb30-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb30-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>,</span>
<span id="cb30-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb30-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb30-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb30-25">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint (enrichment design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 5%. The results were simulated for a population enrichment comparisons for means (treatment vs.&nbsp;control, 2 populations), H0: mu(treatment) - mu(control) = 0, power directed towards larger values, H1: effects = c(0.4, 0.5), subgroups = c(S, R), prevalences = c(0.1, 0.9), standard deviation = 1, planned cumulative sample size = c(40, 70, 100), intersection test = Simes, selection = r best, r = 2, effect measure based on effect estimate, success criterion: all, simulation runs = 100, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0255</td>
<td>0.0398</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0255</td>
<td>0.0255</td>
<td>0.0255</td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0255136</td>
<td>0.0038966</td>
<td>0.0007481</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td></td>
<td>0.5600</td>
</tr>
<tr class="even">
<td>Success per stage</td>
<td>0.0300</td>
<td>0.0400</td>
<td>0.0400</td>
</tr>
<tr class="odd">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S</td>
<td>4.0</td>
<td>3.0</td>
<td>3.0</td>
</tr>
<tr class="odd">
<td>Remaining population R</td>
<td>36.0</td>
<td>27.0</td>
<td>27.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>97.0</td>
</tr>
<tr class="odd">
<td>Overall exit probability</td>
<td>0.0300</td>
<td>0.0400</td>
<td></td>
</tr>
<tr class="even">
<td>Selected populations</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S</td>
<td>1.0000</td>
<td>0.9700</td>
<td>0.9300</td>
</tr>
<tr class="even">
<td>Full population F</td>
<td>1.0000</td>
<td>0.9700</td>
<td>0.9300</td>
</tr>
<tr class="odd">
<td>Number of populations</td>
<td>2.000</td>
<td>2.000</td>
<td>2.000</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="simulation-results-enrichment---rates" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-enrichment---rates">Simulation results enrichment - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"large"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb31-2"></span>
<span id="cb31-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb31-4"></span>
<span id="cb31-5">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>)</span>
<span id="cb31-6">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb31-7">pi2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb31-8">piTreatments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb31-9">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb31-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb31-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> pi2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(piTreatments, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb31-12">)</span>
<span id="cb31-13"></span>
<span id="cb31-14">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentRates</span>(</span>
<span id="cb31-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb31-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb31-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>,</span>
<span id="cb31-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb31-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb31-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb31-22">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a binary endpoint (enrichment design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 5%. The results were simulated for a population enrichment comparisons for rates (treatment vs.&nbsp;control, 2 populations), H0: pi(treatment) - pi(control) = 0, power directed towards larger values, H1: assumed pi(treatment) = c(0.4, 0.5), subgroups = c(S, R), prevalences = c(0.1, 0.9), control rates pi(control) = c(0.3, 0.4), planned cumulative sample size = c(40, 70, 100), intersection test = Simes, selection = r best, r = 2, effect measure based on effect estimate, success criterion: all, simulation runs = 100, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0255</td>
<td>0.0398</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0255</td>
<td>0.0255</td>
<td>0.0255</td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0255136</td>
<td>0.0038966</td>
<td>0.0007481</td>
</tr>
<tr class="odd">
<td>Reject at least one</td>
<td></td>
<td></td>
<td>0.1800</td>
</tr>
<tr class="even">
<td>Rejected populations per stage</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S</td>
<td>0.0200</td>
<td>0.0500</td>
<td>0.0400</td>
</tr>
<tr class="even">
<td>Full population F</td>
<td>0.0500</td>
<td>0.0400</td>
<td>0.0700</td>
</tr>
<tr class="odd">
<td>Success per stage</td>
<td>0.0200</td>
<td>0.0300</td>
<td>0.0400</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S</td>
<td>4.0</td>
<td>3.0</td>
<td>3.0</td>
</tr>
<tr class="even">
<td>Remaining population R</td>
<td>36.0</td>
<td>27.0</td>
<td>27.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>97.9</td>
</tr>
<tr class="even">
<td>Overall exit probability</td>
<td>0.0200</td>
<td>0.0300</td>
<td></td>
</tr>
<tr class="odd">
<td>Selected populations</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S</td>
<td>1.0000</td>
<td>0.9800</td>
<td>0.9500</td>
</tr>
<tr class="odd">
<td>Full population F</td>
<td>1.0000</td>
<td>0.9800</td>
<td>0.9500</td>
</tr>
<tr class="even">
<td>Number of populations</td>
<td>2.000</td>
<td>2.000</td>
<td>2.000</td>
</tr>
<tr class="odd">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.0689</td>
<td>0.0731</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="simulation-results-enrichment---survival" class="level3">
<h3 class="anchored" data-anchor-id="simulation-results-enrichment---survival">Simulation results enrichment - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.summary.output.size"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"medium"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># small, medium, large</span></span>
<span id="cb32-2"></span>
<span id="cb32-3">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb32-4"></span>
<span id="cb32-5">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>)</span>
<span id="cb32-6">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)</span>
<span id="cb32-7">hazardRatios <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb32-8">effectList <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb32-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb32-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatios =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(hazardRatios, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb32-11">)</span>
<span id="cb32-12"></span>
<span id="cb32-13">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentSurvival</span>(</span>
<span id="cb32-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb32-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> effectList,</span>
<span id="cb32-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb32-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb32-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb32-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb32-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234</span></span>
<span id="cb32-22">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Note: 'simulationType' = "testStatisticBased" simulates normally distributed log-rank test statistics instead of patient-wise survival data. To simulate patient-wise survival data, specify 'simulationType' = "patientWise" and the corresponding arguments.</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Simulation of a survival endpoint (enrichment design)</strong></p>
<p>Sequential analysis with a maximum of 3 looks (Fisher’s combination test design), one-sided overall significance level 5%. The results were simulated for a population enrichment logrank test (treatment vs.&nbsp;control, 3 populations), H0: hazard ratio = 1, power directed towards larger values, H1: hazard ratios as specified, subgroups = c(S1, S2, S12, R), prevalences = c(0.1, 0.3, 0.4, 0.2), planned cumulative events = c(40, 70, 100), intersection test = Simes, selection = best, effect measure based on effect estimate, success criterion: all, sample size reassessment: conditional power = 0.8, minimum events per stage = c(40, 20, 20), maximum events per stage = c(40, 100, 100), simulation runs = 100, seed = 1234.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
<col style="width: 3%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0255</td>
<td>0.0398</td>
<td>0.0500</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0255</td>
<td>0.0255</td>
<td>0.0255</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.0255136</td>
<td>0.0038966</td>
<td>0.0007481</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Reject at least one, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td></td>
<td></td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Reject at least one, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td></td>
<td></td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Success per stage, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Success per stage, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Single number of events, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S1 only</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="odd">
<td>Subset S2 only</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="even">
<td>Subset S12</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="odd">
<td>Remaining population R</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="even">
<td>Single number of events, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S1 only</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="even">
<td>Subset S2 only</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="odd">
<td>Subset S12</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="even">
<td>Remaining population R</td>
<td>3.6</td>
<td>8.1</td>
<td>8.1</td>
<td>3.9</td>
<td>12.1</td>
<td>12.4</td>
<td>11.5</td>
<td>25.3</td>
<td>25.3</td>
<td>11.7</td>
<td>18.7</td>
<td>18.7</td>
<td>16.3</td>
<td>59.0</td>
<td>59.0</td>
<td>15.6</td>
<td>60.6</td>
<td>61.7</td>
<td>8.7</td>
<td>7.6</td>
<td>7.6</td>
<td>8.8</td>
<td>7.2</td>
<td>7.2</td>
</tr>
<tr class="odd">
<td>Expected number of events under H1, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td></td>
<td></td>
<td>240.0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Expected number of events under H1, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td></td>
<td></td>
<td>238.6</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall exit probability, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall exit probability, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td>0</td>
<td>0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected populations, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S1</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S2</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Full population F</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Selected populations, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Subset S1</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Subset S2</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Full population F</td>
<td>1.0000</td>
<td>0.2800</td>
<td>0.2800</td>
<td>1.0000</td>
<td>0.4600</td>
<td>0.4600</td>
<td>1.0000</td>
<td>0.3700</td>
<td>0.3700</td>
<td>1.0000</td>
<td>0.2100</td>
<td>0.2100</td>
<td>1.0000</td>
<td>0.3500</td>
<td>0.3500</td>
<td>1.0000</td>
<td>0.3300</td>
<td>0.3300</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Number of populations, hazard ratios = c(0.4, 0.5, 0.6, 0.7)</td>
<td>3.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Number of populations, hazard ratios = c(0.6, 0.6, 0.6, 0.8)</td>
<td>3.000</td>
<td>1.000</td>
<td>1.000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
</section>
<section id="analysis-results-summaries" class="level1">
<h1>Analysis results summaries</h1>
<section id="create-three-different-designs" class="level2">
<h2 class="anchored" data-anchor-id="create-three-different-designs">Create three different designs</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">design1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb34-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb34-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bindingFutility =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb34-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asKD"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gammaA =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb34-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb34-6">)</span>
<span id="cb34-7"></span>
<span id="cb34-8">design3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignConditionalDunnett</span>(</span>
<span id="cb34-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb34-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationAtInterim =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">secondStageConditioning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb34-11">)</span></code></pre></div></div>
</div>
</section>
<section id="analysis-results-base" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-base">Analysis results base</h2>
<section id="analysis-results-base---means" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-base---means">Analysis results base - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1">simpleDataExampleMeans1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb35-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>),</span>
<span id="cb35-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.51</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb35-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb35-5">)</span>
<span id="cb35-6"></span>
<span id="cb35-7">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb35-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleMeans1,</span>
<span id="cb35-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>,</span>
<span id="cb35-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>,</span>
<span id="cb35-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb35-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb35-14">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a one-sample t-test. H0: mu = 30 against H1: mu &gt; 30. The conditional power calculation with planned sample size is based on assumed effect = 60 and assumed standard deviation = 100.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>45.000</td>
<td>48.120</td>
<td>47.053</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative standard deviation</td>
<td>130.000</td>
<td>135.055</td>
<td>129.950</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic</td>
<td>1.264</td>
<td>1.710</td>
<td>1.425</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value</td>
<td>0.1044</td>
<td>0.0448</td>
<td>0.0783</td>
<td></td>
</tr>
<tr class="even">
<td>Inverse normal combination</td>
<td>1.257</td>
<td>2.112</td>
<td>2.524</td>
<td></td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject and stop</td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.0433</td>
<td>0.1706</td>
<td>0.3851</td>
<td></td>
</tr>
<tr class="odd">
<td>Planned sample size</td>
<td></td>
<td></td>
<td></td>
<td>130</td>
</tr>
<tr class="even">
<td>Conditional power</td>
<td></td>
<td></td>
<td></td>
<td>0.9991</td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval</td>
<td>10.269 - 79.731</td>
<td>25.952 - 70.719</td>
<td>30.900 - 63.004</td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>&gt;0.5</td>
<td>0.0662</td>
<td>0.0141</td>
<td></td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0108</td>
<td></td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>31.784 - 60.146</td>
<td></td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>46.183</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1">simpleDataExampleMeans2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb37-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>),</span>
<span id="cb37-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb37-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb37-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb37-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stds1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb37-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stds2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb37-8">)</span>
<span id="cb37-9"></span>
<span id="cb37-10">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb37-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design1,</span>
<span id="cb37-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleMeans2,</span>
<span id="cb37-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">equalVariances =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb37-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb37-16">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: Argument unknown in .getAnalysisResultsMeansInverseNormal(...):
'%param2%' = 'TrialDesignInverseNormal' will be ignored</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample t-test, equal variances option. H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>170.000</td>
<td>159.444</td>
<td>219.793</td>
<td>206.784</td>
</tr>
<tr class="odd">
<td>Cumulative (pooled) standard deviation</td>
<td>125.216</td>
<td>166.324</td>
<td>196.455</td>
<td>187.224</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic</td>
<td>4.553</td>
<td>1.479</td>
<td>4.935</td>
<td>2.817</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value</td>
<td>&lt;0.0001</td>
<td>0.0767</td>
<td>&lt;0.0001</td>
<td>0.0050</td>
</tr>
<tr class="even">
<td>Inverse normal combination</td>
<td>4.090</td>
<td>3.633</td>
<td>5.599</td>
<td>6.094</td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>reject and stop</td>
<td>reject and stop</td>
<td>reject and stop</td>
<td>reject</td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.5469</td>
<td>0.7525</td>
<td>1.0000</td>
<td></td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval</td>
<td>56.780 - 283.220</td>
<td>50.708 - 267.898</td>
<td>129.271 - 304.606</td>
<td>127.414 - 266.016</td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>0.0002</td>
<td>0.0006</td>
<td>&lt;0.0001</td>
<td>&lt;0.0001</td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td>&lt;0.0001</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td>90.913 - 249.087</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td>170.000</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="analysis-results-base---rates" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-base---rates">Analysis results base - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">simpleDataExampleRates1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb39-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb39-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb39-4">)</span>
<span id="cb39-5"></span>
<span id="cb39-6">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb39-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> simpleDataExampleRates1,</span>
<span id="cb39-9">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb39-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>,</span>
<span id="cb39-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb39-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb39-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span></span>
<span id="cb39-14">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a binary endpoint</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a one-sample test for rates, normal approximation test. H0: pi = 0.75 against H1: pi &lt; 0.75. The conditional power calculation with planned sample size is based on overall treatment rate = 0.519.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate</td>
<td>0.500</td>
<td>0.500</td>
<td>0.519</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic</td>
<td>-1.633</td>
<td>-1.826</td>
<td>-1.347</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value</td>
<td>0.0512</td>
<td>0.0339</td>
<td>0.0890</td>
<td></td>
</tr>
<tr class="odd">
<td>Inverse normal combination</td>
<td>1.633</td>
<td>2.443</td>
<td>2.729</td>
<td></td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject and stop</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.0669</td>
<td>0.2722</td>
<td>0.5084</td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td></td>
<td>10</td>
</tr>
<tr class="odd">
<td>Conditional power</td>
<td></td>
<td></td>
<td></td>
<td>0.9310</td>
</tr>
<tr class="even">
<td>96% repeated confidence interval</td>
<td>0.144 - 0.856</td>
<td>0.240 - 0.760</td>
<td>0.307 - 0.727</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>0.4992</td>
<td>0.0285</td>
<td>0.0079</td>
<td></td>
</tr>
<tr class="even">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0087</td>
<td></td>
</tr>
<tr class="odd">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>0.300 - 0.714</td>
<td></td>
</tr>
<tr class="even">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>0.502</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">simpleDataExampleRates2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb41-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb41-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb41-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>),</span>
<span id="cb41-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb41-6">)</span>
<span id="cb41-7"></span>
<span id="cb41-8">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb41-10">        simpleDataExampleRates2,</span>
<span id="cb41-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb41-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb41-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb41-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb41-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb41-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>,</span>
<span id="cb41-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb41-18">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Repeated confidence intervals will be calculated under the normal approximation</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a binary endpoint</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample test for rates, exact test of Fisher. H0: pi(1) - pi(2) = 0 against H1: pi(1) - pi(2) &gt; 0. The conditional power calculation with planned sample size is based on assumed treatment rate = 0.9 and assumed control rate = 0.3.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>0.369</td>
<td>0.180</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate</td>
<td>0.647</td>
<td>0.575</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.278</td>
<td>0.395</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value</td>
<td>0.0313</td>
<td>0.5648</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Inverse normal combination</td>
<td>1.862</td>
<td>1.011</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.0863</td>
<td>0.0213</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="odd">
<td>Conditional power</td>
<td></td>
<td></td>
<td>0.7257</td>
<td>0.9884</td>
</tr>
<tr class="even">
<td>96% repeated confidence interval</td>
<td>-0.111 - 0.711</td>
<td>-0.125 - 0.429</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>0.3048</td>
<td>&gt;0.5</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="analysis-results-base---survival" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-base---survival">Analysis results base - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb43-1">simpleDataExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb43-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb43-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallAllocationRatios =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb43-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">overallLogRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.52</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.38</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9</span>)</span>
<span id="cb43-5">)</span>
<span id="cb43-6"></span>
<span id="cb43-7">simpleDataExampleSurvival<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getNumberOfGroups</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2</code></pre>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb45-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb45-3">        simpleDataExampleSurvival,</span>
<span id="cb45-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb45-5">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb45-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Calculation of final confidence interval performed for kMax = 4 (for kMax &gt; 2, it is theoretically shown that it is valid only if no sample size change was performed)</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Analysis results for a survival endpoint</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample logrank test. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size</td>
<td>2.929</td>
<td>2.039</td>
<td>2.936</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic</td>
<td>1.520</td>
<td>0.395</td>
<td>2.745</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value</td>
<td>0.0643</td>
<td>0.3464</td>
<td>0.0030</td>
<td></td>
</tr>
<tr class="odd">
<td>Inverse normal combination</td>
<td>1.520</td>
<td>1.243</td>
<td>2.737</td>
<td></td>
</tr>
<tr class="even">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>reject and stop</td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability</td>
<td>0.0588</td>
<td>0.0350</td>
<td>0.5134</td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval</td>
<td>0.385 - 22.290</td>
<td>0.499 - 7.358</td>
<td>1.138 - 6.825</td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value</td>
<td>&gt;0.5</td>
<td>0.3740</td>
<td>0.0077</td>
<td></td>
</tr>
<tr class="even">
<td>Final p-value</td>
<td></td>
<td></td>
<td>0.0087</td>
<td></td>
</tr>
<tr class="odd">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td>1.160 - 5.900</td>
<td></td>
</tr>
<tr class="even">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td>2.686</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</section>
<section id="analysis-results-multi-arm" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-multi-arm">Analysis results multi-arm</h2>
<section id="analysis-results-multi-arm---means" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-multi-arm---means">Analysis results multi-arm - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1">dataExampleMeans <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb47-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb47-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb47-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>),</span>
<span id="cb47-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb47-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">242</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">222</span>),</span>
<span id="cb47-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">188</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb47-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">267</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">277</span>),</span>
<span id="cb47-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">92</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">122</span>),</span>
<span id="cb47-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">244</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">221</span>),</span>
<span id="cb47-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">212</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb47-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">232</span>),</span>
<span id="cb47-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">215</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">227</span>)</span>
<span id="cb47-14">)</span>
<span id="cb47-15"></span>
<span id="cb47-16">design3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb47-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb47-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleMeans,</span>
<span id="cb47-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stage =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb47-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>,</span>
<span id="cb47-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb47-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb47-23">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb47-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a continuous endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 2 looks (conditional Dunnett test design), one-sided overall significance level 2%. The results were calculated using a multi-arm t-test, normal approximation test, overall pooled variances option, conditional second stage p-values. H0: mu(i) - mu(control) = 120 against H1: mu(i) - mu(control) &gt; 120.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed information at interim</td>
<td>0.4</td>
<td></td>
</tr>
<tr class="even">
<td>Significance level</td>
<td>0.0200</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>150.000</td>
<td>115.623</td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>96.000</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>175.000</td>
<td>160.366</td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation</td>
<td>232.555</td>
<td>228.359</td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>0.322</td>
<td>-0.323</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>-0.266</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (3)</td>
<td>0.601</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Stage-wise p-value (1)</td>
<td>0.3736</td>
<td>0.6267</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (2)</td>
<td>0.6051</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (3)</td>
<td>0.2739</td>
<td>0.2820</td>
</tr>
<tr class="odd">
<td>Conditional error rate (1, 2, 3)</td>
<td>0.0062</td>
<td></td>
</tr>
<tr class="even">
<td>Second stage p-value (1, 2, 3)</td>
<td></td>
<td>0.3810</td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="even">
<td>96% overall confidence interval (1)</td>
<td></td>
<td>-2.619 - 238.304</td>
</tr>
<tr class="odd">
<td>96% overall confidence interval (2)</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% overall confidence interval (3)</td>
<td></td>
<td>43.962 - 280.286</td>
</tr>
<tr class="odd">
<td>Overall p-value (1)</td>
<td></td>
<td>&gt;0.5</td>
</tr>
<tr class="even">
<td>Overall p-value (2)</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall p-value (3)</td>
<td></td>
<td>0.3768</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
</section>
<section id="analysis-results-multi-arm---rates" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-multi-arm---rates">Analysis results multi-arm - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1">dataExampleRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb48-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>),</span>
<span id="cb48-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb48-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>),</span>
<span id="cb48-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb48-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb48-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb48-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb48-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events4 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span>
<span id="cb48-10">)</span>
<span id="cb48-11"></span>
<span id="cb48-12">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb48-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleRates,</span>
<span id="cb48-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bonferroni"</span>,</span>
<span id="cb48-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb48-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb48-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb48-19">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a binary endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a multi-arm test for rates, Bonferroni intersection test, normal approximation test. H0: pi(i) - pi(control) = 0 against H1: pi(i) - pi(control) &gt; 0. The conditional power calculation with planned sample size is based on assumed treatment rate: pi(1) = 0.4, pi(2) = 0.6, pi(3) = 0.5 and overall control rate = 0.49.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (1)</td>
<td>0.107</td>
<td>0.072</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (2)</td>
<td>0.215</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size (3)</td>
<td>0.205</td>
<td>0.294</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (1)</td>
<td>0.652</td>
<td>0.562</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate (2)</td>
<td>0.760</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate (3)</td>
<td>0.750</td>
<td>0.784</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate</td>
<td>0.545</td>
<td>0.490</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (1)</td>
<td>0.730</td>
<td>0.233</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (2)</td>
<td>1.549</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (3)</td>
<td>1.455</td>
<td>2.831</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (1)</td>
<td>0.2325</td>
<td>0.4078</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (2)</td>
<td>0.0607</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value (3)</td>
<td>0.0728</td>
<td>0.0023</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2, 3)</td>
<td>0.1821</td>
<td>0.0046</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2, 3)</td>
<td>0.907</td>
<td>2.612</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (1)</td>
<td>0.0227</td>
<td>0.0088</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability (2)</td>
<td>0.0283</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability (3)</td>
<td>0.0283</td>
<td>0.3346</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="even">
<td>Conditional power (1)</td>
<td></td>
<td></td>
<td>0.0004</td>
<td>0.0016</td>
</tr>
<tr class="odd">
<td>Conditional power (2)</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional power (3)</td>
<td></td>
<td></td>
<td>0.2769</td>
<td>0.3544</td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval (1)</td>
<td>-0.336 - 0.513</td>
<td>-0.236 - 0.356</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval (2)</td>
<td>-0.222 - 0.588</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval (3)</td>
<td>-0.237 - 0.583</td>
<td>-0.003 - 0.549</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (1)</td>
<td>&gt;0.5</td>
<td>&gt;0.5</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value (2)</td>
<td>&gt;0.5</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value (3)</td>
<td>&gt;0.5</td>
<td>0.0179</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
</section>
<section id="analysis-results-multi-arm---survival" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-multi-arm---survival">Analysis results multi-arm - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1">dataExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb49-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>),</span>
<span id="cb49-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb49-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>),</span>
<span id="cb49-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>),</span>
<span id="cb49-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.99</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb49-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks3 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.32</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.11</span>)</span>
<span id="cb49-8">)</span>
<span id="cb49-9"></span>
<span id="cb49-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignConditionalDunnett</span>(</span>
<span id="cb49-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb49-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationAtInterim =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb49-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">secondStageConditioning =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb49-14">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb49-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb49-16">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleSurvival,</span>
<span id="cb49-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dunnett"</span>,</span>
<span id="cb49-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb49-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb49-20">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb49-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Multi-arm analysis results for a survival endpoint (3 active arms vs.&nbsp;control)</strong></p>
<p>Sequential analysis with 2 looks (conditional Dunnett test design), one-sided overall significance level 2%. The results were calculated using a multi-arm logrank test, conditional second stage p-values. H0: hazard ratio(i) = 2 against H1: hazard ratio(i) &gt; 2.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed information at interim</td>
<td>0.4</td>
<td></td>
</tr>
<tr class="even">
<td>Significance level</td>
<td>0.0200</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (1)</td>
<td>2.411</td>
<td>2.103</td>
</tr>
<tr class="even">
<td>Cumulative effect size (2)</td>
<td>2.555</td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size (3)</td>
<td>2.689</td>
<td>2.252</td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (1)</td>
<td>0.467</td>
<td>-0.161</td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic (2)</td>
<td>0.520</td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic (3)</td>
<td>0.694</td>
<td>0.031</td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (1)</td>
<td>0.3202</td>
<td>0.5638</td>
</tr>
<tr class="even">
<td>Stage-wise p-value (2)</td>
<td>0.3017</td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value (3)</td>
<td>0.2437</td>
<td>0.4878</td>
</tr>
<tr class="even">
<td>Conditional error rate (1, 2, 3)</td>
<td>0.0103</td>
<td></td>
</tr>
<tr class="odd">
<td>Second stage p-value (1, 2, 3)</td>
<td></td>
<td>0.6188</td>
</tr>
<tr class="even">
<td>Test action: reject (1)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>Test action: reject (2)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="even">
<td>Test action: reject (3)</td>
<td>FALSE</td>
<td>FALSE</td>
</tr>
<tr class="odd">
<td>96% overall confidence interval (1)</td>
<td></td>
<td>1.134 - 3.876</td>
</tr>
<tr class="even">
<td>96% overall confidence interval (2)</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>96% overall confidence interval (3)</td>
<td></td>
<td>1.231 - 4.163</td>
</tr>
<tr class="even">
<td>Overall p-value (1)</td>
<td></td>
<td>0.4913</td>
</tr>
<tr class="odd">
<td>Overall p-value (2)</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall p-value (3)</td>
<td></td>
<td>0.4913</td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(i)</em>: results of treatment arm i vs.&nbsp;control arm</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
</section>
</section>
<section id="analysis-results-enrichment" class="level2">
<h2 class="anchored" data-anchor-id="analysis-results-enrichment">Analysis results enrichment</h2>
<section id="analysis-results-enrichment---means" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-enrichment---means">Analysis results enrichment - means</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1">dataS1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb50-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.8</span>),</span>
<span id="cb50-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.8</span>),</span>
<span id="cb50-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3</span>),</span>
<span id="cb50-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>),</span>
<span id="cb50-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>),</span>
<span id="cb50-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>)</span>
<span id="cb50-8">)</span>
<span id="cb50-9">dataNotS1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb50-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.8</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb50-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.5</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb50-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb50-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.7</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb50-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb50-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>)</span>
<span id="cb50-16">)</span>
<span id="cb50-17">dataExampleMeans <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> dataS1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R =</span> dataNotS1)</span>
<span id="cb50-18"></span>
<span id="cb50-19">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb50-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleMeans,</span>
<span id="cb50-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">varianceOption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooledFromFull"</span>,</span>
<span id="cb50-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SpiessensDebois"</span>,</span>
<span id="cb50-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb50-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb50-26">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">assumedStDevs =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb50-27">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Enrichment analysis results for a continuous endpoint (2 populations)</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample t-test, Spiessens and Debois intersection test, pooled from full population variances option, stratified analysis. H0: mu(treatment) - mu(control) = 0 against H1: mu(treatment) - mu(control) &gt; 0. The conditional power calculation with planned sample size is based on overall effect: thetaH1(S1) = 2.05, thetaH1(F) = NA and assumed standard deviation = 5.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size S1</td>
<td>2.100</td>
<td>2.053</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size F</td>
<td>1.354</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation S1</td>
<td>3.173</td>
<td>3.256</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative (pooled) standard deviation F</td>
<td>3.186</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic S1</td>
<td>2.079</td>
<td>1.929</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic F</td>
<td>1.755</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value S1</td>
<td>0.0222</td>
<td>0.0304</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value F</td>
<td>0.0421</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0334</td>
<td>0.0304</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 2)</td>
<td>1.833</td>
<td>2.605</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability S1</td>
<td>0.0835</td>
<td>0.3318</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability F</td>
<td>0.0743</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="odd">
<td>Conditional power S1</td>
<td></td>
<td></td>
<td>0.6080</td>
<td>0.7684</td>
</tr>
<tr class="even">
<td>Conditional power F</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval S1</td>
<td>-1.101 - 5.301</td>
<td>0.025 - 4.066</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval F</td>
<td>-1.097 - 3.817</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value S1</td>
<td>0.3255</td>
<td>0.0182</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td>0.4097</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
</section>
<section id="analysis-results-enrichment---rates" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-enrichment---rates">Analysis results enrichment - rates</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb51-1">S1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb51-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb51-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>),</span>
<span id="cb51-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb51-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">35</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>)</span>
<span id="cb51-6">)</span>
<span id="cb51-7">S2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb51-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>),</span>
<span id="cb51-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>),</span>
<span id="cb51-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>),</span>
<span id="cb51-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">39</span>)</span>
<span id="cb51-12">)</span>
<span id="cb51-13">F <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb51-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">54</span>),</span>
<span id="cb51-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">83</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">84</span>),</span>
<span id="cb51-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">66</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">59</span>),</span>
<span id="cb51-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sampleSizes1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">85</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">82</span>)</span>
<span id="cb51-18">)</span>
<span id="cb51-19"></span>
<span id="cb51-20">dataExampleRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataSet</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S2 =</span> S2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">F =</span> F)</span>
<span id="cb51-21"></span>
<span id="cb51-22">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb51-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb51-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleRates,</span>
<span id="cb51-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stratifiedAnalysis =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb51-26">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb51-27">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb51-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControls =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>),</span>
<span id="cb51-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb51-30">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb51-31">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Enrichment analysis results for a binary endpoint (3 populations)</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample test for rates, Simes intersection test, normal approximation test, non-stratified analysis. H0: pi(treatment) - pi(control) = 0 against H1: pi(treatment) - pi(control) &gt; 0. The conditional power calculation with planned sample size is based on overall treatment rate: pi(S1) = 0.82, pi(S2) = 0.66, pi(F) = 0.75 and assumed control rate: pi(S1) = 0.6, pi(S2) = 0.2, pi(F) = 0.3.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size S1</td>
<td>0.258</td>
<td>0.299</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size S2</td>
<td>0.376</td>
<td>0.254</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size F</td>
<td>-0.007</td>
<td>0.036</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate S1</td>
<td>0.743</td>
<td>0.821</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative treatment rate S2</td>
<td>0.710</td>
<td>0.657</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative treatment rate F</td>
<td>0.776</td>
<td>0.749</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate S1</td>
<td>0.485</td>
<td>0.522</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative control rate S2</td>
<td>0.333</td>
<td>0.403</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative control rate F</td>
<td>0.783</td>
<td>0.713</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic S1</td>
<td>2.188</td>
<td>3.167</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic S2</td>
<td>3.072</td>
<td>1.100</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic F</td>
<td>-0.104</td>
<td>1.059</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value S1</td>
<td>0.0143</td>
<td>0.0008</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value S2</td>
<td>0.0011</td>
<td>0.1356</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value F</td>
<td>0.5415</td>
<td>0.1448</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Adjusted stage-wise p-value (1, 2, 3)</td>
<td>0.0032</td>
<td>0.0023</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Overall adjusted test statistic (1, 2, 3)</td>
<td>2.728</td>
<td>3.910</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject S2</td>
<td>FALSE</td>
<td>TRUE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability S1</td>
<td>0.0900</td>
<td>0.7054</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability S2</td>
<td>0.2063</td>
<td>0.3252</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability F</td>
<td>0.0076</td>
<td>0.0123</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="even">
<td>Conditional power S1</td>
<td></td>
<td></td>
<td>0.9368</td>
<td>0.9735</td>
</tr>
<tr class="odd">
<td>Conditional power S2</td>
<td></td>
<td></td>
<td>0.9478</td>
<td>0.9948</td>
</tr>
<tr class="even">
<td>Conditional power F</td>
<td></td>
<td></td>
<td>0.2417</td>
<td>0.7339</td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval S1</td>
<td>-0.118 - 0.573</td>
<td>0.052 - 0.533</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval S2</td>
<td>-0.016 - 0.667</td>
<td>-0.046 - 0.491</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval F</td>
<td>-0.214 - 0.202</td>
<td>-0.120 - 0.197</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value S1</td>
<td>0.2793</td>
<td>0.0010</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value S2</td>
<td>0.0310</td>
<td>0.0191</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td>&gt;0.5</td>
<td>&gt;0.5</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
</section>
<section id="analysis-results-enrichment---survival" class="level3">
<h3 class="anchored" data-anchor-id="analysis-results-enrichment---survival">Analysis results enrichment - survival</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1">S <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb52-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>),</span>
<span id="cb52-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>)</span>
<span id="cb52-4">)</span>
<span id="cb52-5"></span>
<span id="cb52-6">R <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb52-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">events =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>),</span>
<span id="cb52-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">logRanks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>)</span>
<span id="cb52-9">)</span>
<span id="cb52-10">dataExampleSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">S1 =</span> S, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">F =</span> R)</span>
<span id="cb52-11"></span>
<span id="cb52-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb52-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleSurvival,</span>
<span id="cb52-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb52-15">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Test statistics from full (and sub-populations) need to be stratified log-rank tests</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Enrichment analysis results for a survival endpoint (2 populations)</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample logrank test, Simes intersection test, stratified analysis. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1. The conditional power calculation with planned sample size is based on overall effect: thetaH1(S1) = 1.95, thetaH1(F) = 1.78.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size S1</td>
<td>2.117</td>
<td>1.948</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size F</td>
<td>2.117</td>
<td>1.782</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic S1</td>
<td>1.500</td>
<td>1.300</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic F</td>
<td>1.500</td>
<td>1.300</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value S1</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value F</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 2)</td>
<td>1.500</td>
<td>1.946</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability S1</td>
<td>0.0574</td>
<td>0.1312</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability F</td>
<td>0.0574</td>
<td>0.1312</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="odd">
<td>Conditional power S1</td>
<td></td>
<td></td>
<td>0.5342</td>
<td>0.8076</td>
</tr>
<tr class="even">
<td>Conditional power F</td>
<td></td>
<td></td>
<td>0.4551</td>
<td>0.7248</td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval S1</td>
<td>0.453 - 9.887</td>
<td>0.703 - 5.334</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval F</td>
<td>0.453 - 9.887</td>
<td>0.734 - 4.381</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value S1</td>
<td>&gt;0.5</td>
<td>0.0970</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td>&gt;0.5</td>
<td>0.0970</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1">design1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb54-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb54-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataInput =</span> dataExampleSurvival,</span>
<span id="cb54-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb54-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nPlanned =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb54-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb54-7">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb54-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Test statistics from full (and sub-populations) need to be stratified log-rank tests</code></pre>
</div>
<div class="cell-output-display">
<p><strong>Enrichment analysis results for a survival endpoint (2 populations)</strong></p>
<p>Sequential analysis with 4 looks (inverse normal combination test design), one-sided overall significance level 2%. The results were calculated using a two-sample logrank test, Simes intersection test, stratified analysis. H0: hazard ratio = 1 against H1: hazard ratio &gt; 1. The conditional power calculation with planned sample size is based on overall effect: thetaH1(S1) = 1.95, thetaH1(F) = 1.78.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.387</td>
<td>0.5</td>
<td>0.548</td>
<td>0.548</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0021</td>
<td>0.0067</td>
<td>0.0130</td>
<td>0.0200</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0021</td>
<td>0.0050</td>
<td>0.0084</td>
<td>0.0116</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>2.870</td>
<td>2.572</td>
<td>2.391</td>
<td>2.272</td>
</tr>
<tr class="odd">
<td>Futility boundary (z-value scale)</td>
<td>-0.500</td>
<td>0.000</td>
<td>0.500</td>
<td></td>
</tr>
<tr class="even">
<td>Cumulative effect size S1</td>
<td>2.117</td>
<td>1.948</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Cumulative effect size F</td>
<td>2.117</td>
<td>1.782</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise test statistic S1</td>
<td>1.500</td>
<td>1.300</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise test statistic F</td>
<td>1.500</td>
<td>1.300</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Stage-wise p-value S1</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Stage-wise p-value F</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Adjusted stage-wise p-value (1, 2)</td>
<td>0.0668</td>
<td>0.0968</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Overall adjusted test statistic (1, 2)</td>
<td>1.500</td>
<td>1.946</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Test action: reject S1</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Test action: reject F</td>
<td>FALSE</td>
<td>FALSE</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Conditional rejection probability S1</td>
<td>0.0574</td>
<td>0.1312</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Conditional rejection probability F</td>
<td>0.0574</td>
<td>0.1312</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Planned sample size</td>
<td></td>
<td></td>
<td>20</td>
<td>20</td>
</tr>
<tr class="odd">
<td>Conditional power S1</td>
<td></td>
<td></td>
<td>0.5342</td>
<td>0.8076</td>
</tr>
<tr class="even">
<td>Conditional power F</td>
<td></td>
<td></td>
<td>0.4551</td>
<td>0.7248</td>
</tr>
<tr class="odd">
<td>96% repeated confidence interval S1</td>
<td>0.453 - 9.887</td>
<td>0.703 - 5.334</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>96% repeated confidence interval F</td>
<td>0.453 - 9.887</td>
<td>0.734 - 4.381</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>Repeated p-value S1</td>
<td>&gt;0.5</td>
<td>0.0970</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>Repeated p-value F</td>
<td>&gt;0.5</td>
<td>0.0970</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>F</em>: full population</li>
<li><em>S[i]</em>: population i</li>
<li><em>(i, j, …)</em>: comparison of treatment arms ‘i, j, …’ vs.&nbsp;control arm</li>
</ul>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>
</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_summary_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_22.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>How to use R Generics with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_generic_functions/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="creating-examples-of-selected-rpact-result-objects" class="level1">
<h1>Creating examples of selected rpact result objects</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
<p>In the following, we define different (typical) examples of <a href="https://cran.r-project.org/package=rpact">rpact</a> applications. The results are <a href="https://cran.r-project.org/package=rpact">rpact</a> objects which refer to examples for design specifications, power and sample size calculations, simulation results and the results of a data analysis with defined design and datasets.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">designGroupSequential <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>, </span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb3-7">)</span>
<span id="cb3-8"></span>
<span id="cb3-9">designFisher <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb3-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), </span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha0Vec =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb3-14">)</span>
<span id="cb3-15"></span>
<span id="cb3-16">designCharacteristics <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignCharacteristics</span>(</span>
<span id="cb3-17">    designGroupSequential</span>
<span id="cb3-18">)</span>
<span id="cb3-19"></span>
<span id="cb3-20">powerAndASN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerAndAverageSampleNumber</span>(</span>
<span id="cb3-21">    designGroupSequential, </span>
<span id="cb3-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, </span>
<span id="cb3-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb3-24">)</span>
<span id="cb3-25"></span>
<span id="cb3-26">sampleSizeResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>(</span>
<span id="cb3-27">  designGroupSequential</span>
<span id="cb3-28">)</span>
<span id="cb3-29"></span>
<span id="cb3-30">powerResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb3-31">    designGroupSequential, </span>
<span id="cb3-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb3-33">)</span>
<span id="cb3-34"></span>
<span id="cb3-35">designSet <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignSet</span>(</span>
<span id="cb3-36">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> designGroupSequential, </span>
<span id="cb3-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb3-38">)</span>
<span id="cb3-39"></span>
<span id="cb3-40">dataset <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDataset</span>(</span>
<span id="cb3-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>),</span>
<span id="cb3-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>),</span>
<span id="cb3-43">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb3-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">means2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>),</span>
<span id="cb3-45">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>),</span>
<span id="cb3-46">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>)</span>
<span id="cb3-47">)</span>
<span id="cb3-48"></span>
<span id="cb3-49">analysisResults <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAnalysisResults</span>(</span>
<span id="cb3-50">  designGroupSequential, </span>
<span id="cb3-51">  dataset</span>
<span id="cb3-52">)</span></code></pre></div></div>
</div>
</section>
<section id="how-to-use-r-generic-functions-with-rpact-objects" class="level1">
<h1>How to use R generic functions with rpact objects</h1>
<p>This section describes how the defined objects can be used and displayed. It is important to understand this is the way how R objects can typically be handled. Particularly, we tried to make the <code>summary()</code> output (except for the technical developer summaries) “ready to use”, e.g., for a design report.</p>
<section id="get-field-names-of-the-object" class="level2">
<h2 class="anchored" data-anchor-id="get-field-names-of-the-object">Get field names of the object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">designGroupSequential <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] "kMax"                   "alpha"                  "stages"                
 [4] "informationRates"       "userAlphaSpending"      "criticalValues"        
 [7] "stageLevels"            "alphaSpent"             "bindingFutility"       
[10] "directionUpper"         "tolerance"              "typeOfDesign"          
[13] "beta"                   "deltaWT"                "deltaPT1"              
[16] "deltaPT0"               "futilityBounds"         "gammaA"                
[19] "gammaB"                 "optimizationCriterion"  "sided"                 
[22] "betaSpent"              "typeBetaSpending"       "userBetaSpending"      
[25] "efficacyStops"          "futilityStops"          "power"                 
[28] "twoSidedPower"          "constantBoundsHP"       "betaAdjustment"        
[31] "delayedInformation"     "decisionCriticalValues" "reversalProbabilities" </code></pre>
</div>
</div>
<section id="access-data-of-a-field" class="level3">
<h3 class="anchored" data-anchor-id="access-data-of-a-field">Access data of a field</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">designGroupSequential<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>criticalValues</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 3.069028 2.325888 1.977663 1.762694</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">designGroupSequential[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"criticalValues"</span>]]</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 3.069028 2.325888 1.977663 1.762694</code></pre>
</div>
</div>
</section>
</section>
<section id="print-object" class="level2">
<h2 class="anchored" data-anchor-id="print-object">Print object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">designGroupSequential <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Stage levels (one-sided)</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">designSet <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Trial design set with 3 designs</strong></p>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Stage levels (one-sided)</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
</ul>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.3</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.006916, 0.020169, 0.035108, 0.050000</li>
<li><em>Critical values</em>: 2.462, 2.143, 1.976, 1.866</li>
<li><em>Stage levels (one-sided)</em>: 0.006916, 0.016059, 0.024076, 0.031052</li>
</ul>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.4</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.01250, 0.02626, 0.03879, 0.05000</li>
<li><em>Critical values</em>: 2.241, 2.091, 2.008, 1.951</li>
<li><em>Stage levels (one-sided)</em>: 0.01250, 0.01826, 0.02232, 0.02552</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">sampleSizeResults <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Local one-sided significance levels</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 0.2, 0.4, 0.6, 0.8, 1.0</li>
<li><em>Standard deviation</em>: 1</li>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE, TRUE, TRUE, TRUE, TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 649.6, 163.5, 73.5, 42, 27.5</li>
<li><em>Maximum number of subjects (1)</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Maximum number of subjects (2)</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Number of subjects [1]</em>: 162.4, 40.9, 18.4, 10.5, 6.9</li>
<li><em>Number of subjects [2]</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Number of subjects [3]</em>: 487.2, 122.6, 55.1, 31.5, 20.6</li>
<li><em>Number of subjects [4]</em>: 649.6, 163.5, 73.5, 42, 27.5</li>
<li><em>Expected number of subjects under H0</em>: 643.2, 161.9, 72.8, 41.6, 27.2</li>
<li><em>Expected number of subjects under H0/H1</em>: 602.5, 151.6, 68.2, 39, 25.5</li>
<li><em>Expected number of subjects under H1</em>: 496.6, 125, 56.2, 32.1, 21</li>
<li><em>Reject per stage [1]</em>: 0.03625</li>
<li><em>Reject per stage [2]</em>: 0.26640</li>
<li><em>Reject per stage [3]</em>: 0.30072</li>
<li><em>Reject per stage [4]</em>: 0.19663</li>
<li><em>Early stop</em>: 0.6034</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.490, 1.029, 1.697, 2.678, 4.519</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.259, 0.525, 0.804, 1.108, 1.452</li>
<li><em>Critical values (treatment effect scale) [3]</em>: 0.180, 0.361, 0.545, 0.735, 0.933</li>
<li><em>Critical values (treatment effect scale) [4]</em>: 0.139, 0.277, 0.417, 0.558, 0.701</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">dataset <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Dataset of means</strong></p>
<ul>
<li><em>Stages</em>: 1, 1, 2, 2, 3, 3, 4, 4</li>
<li><em>Treatment groups</em>: 1, 2, 1, 2, 1, 2, 1, 2</li>
<li><em>Sample sizes</em>: 22, 22, 11, 13, 22, 22, 11, 13</li>
<li><em>Means</em>: 1.0, 1.4, 1.1, 1.5, 1.0, 3.0, 1.0, 2.5</li>
<li><em>Standard deviations</em>: 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 1.3, 1.3</li>
</ul>
<p><strong>Calculated data</strong></p>
<ul>
<li><em>Cumulative sample sizes</em>: 22, 22, 33, 35, 55, 57, 66, 70</li>
<li><em>Cumulative means</em>: 1.000, 1.400, 1.033, 1.437, 1.020, 2.040, 1.017, 2.126</li>
<li><em>Cumulative standard deviations</em>: 1.000, 1.000, 1.381, 1.425, 1.639, 1.823, 1.579, 1.739</li>
</ul>
</div>
</div>
</section>
<section id="print-object-kable-version" class="level2">
<h2 class="anchored" data-anchor-id="print-object-kable-version">Print object (kable version)</h2>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">designGroupSequential</span></code></pre></div></div>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Stage levels (one-sided)</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">designSet</span></code></pre></div></div>
<p><strong>Trial design set with 3 designs</strong></p>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.1</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Stage levels (one-sided)</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
</ul>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.3</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.006916, 0.020169, 0.035108, 0.050000</li>
<li><em>Critical values</em>: 2.462, 2.143, 1.976, 1.866</li>
<li><em>Stage levels (one-sided)</em>: 0.006916, 0.016059, 0.024076, 0.031052</li>
</ul>
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Type of design</em>: Wang &amp; Tsiatis Delta class</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Delta for Wang &amp; Tsiatis Delta class</em>: 0.4</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Maximum number of stages</em>: 4</li>
<li><em>Stages</em>: 1, 2, 3, 4</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.01250, 0.02626, 0.03879, 0.05000</li>
<li><em>Critical values</em>: 2.241, 2.091, 2.008, 1.951</li>
<li><em>Stage levels (one-sided)</em>: 0.01250, 0.01826, 0.02232, 0.02552</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">sampleSizeResults</span></code></pre></div></div>
<p><strong>Design plan parameters and output for means</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Information rates</em>: 0.250, 0.500, 0.750, 1.000</li>
<li><em>Critical values</em>: 3.069, 2.326, 1.978, 1.763</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf, -Inf</li>
<li><em>Cumulative alpha spending</em>: 0.001074, 0.010527, 0.028206, 0.050000</li>
<li><em>Local one-sided significance levels</em>: 0.001074, 0.010012, 0.023983, 0.038976</li>
<li><em>Significance level</em>: 0.0500</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Alternatives</em>: 0.2, 0.4, 0.6, 0.8, 1.0</li>
<li><em>Standard deviation</em>: 1</li>
<li><em>Normal approximation</em>: FALSE</li>
<li><em>Mean ratio</em>: FALSE</li>
<li><em>Treatment groups</em>: 2</li>
<li><em>Theta H0</em>: 0</li>
<li><em>Planned allocation ratio</em>: 1</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>Direction upper</em>: TRUE, TRUE, TRUE, TRUE, TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 649.6, 163.5, 73.5, 42, 27.5</li>
<li><em>Maximum number of subjects (1)</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Maximum number of subjects (2)</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Number of subjects [1]</em>: 162.4, 40.9, 18.4, 10.5, 6.9</li>
<li><em>Number of subjects [2]</em>: 324.8, 81.7, 36.7, 21, 13.7</li>
<li><em>Number of subjects [3]</em>: 487.2, 122.6, 55.1, 31.5, 20.6</li>
<li><em>Number of subjects [4]</em>: 649.6, 163.5, 73.5, 42, 27.5</li>
<li><em>Expected number of subjects under H0</em>: 643.2, 161.9, 72.8, 41.6, 27.2</li>
<li><em>Expected number of subjects under H0/H1</em>: 602.5, 151.6, 68.2, 39, 25.5</li>
<li><em>Expected number of subjects under H1</em>: 496.6, 125, 56.2, 32.1, 21</li>
<li><em>Reject per stage [1]</em>: 0.03625</li>
<li><em>Reject per stage [2]</em>: 0.26640</li>
<li><em>Reject per stage [3]</em>: 0.30072</li>
<li><em>Reject per stage [4]</em>: 0.19663</li>
<li><em>Early stop</em>: 0.6034</li>
<li><em>Critical values (treatment effect scale) [1]</em>: 0.490, 1.029, 1.697, 2.678, 4.519</li>
<li><em>Critical values (treatment effect scale) [2]</em>: 0.259, 0.525, 0.804, 1.108, 1.452</li>
<li><em>Critical values (treatment effect scale) [3]</em>: 0.180, 0.361, 0.545, 0.735, 0.933</li>
<li><em>Critical values (treatment effect scale) [4]</em>: 0.139, 0.277, 0.417, 0.558, 0.701</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
<li><em>[k]</em>: values at stage k</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">dataset</span></code></pre></div></div>
<p><strong>Dataset of means</strong></p>
<ul>
<li><em>Stages</em>: 1, 1, 2, 2, 3, 3, 4, 4</li>
<li><em>Treatment groups</em>: 1, 2, 1, 2, 1, 2, 1, 2</li>
<li><em>Sample sizes</em>: 22, 22, 11, 13, 22, 22, 11, 13</li>
<li><em>Means</em>: 1.0, 1.4, 1.1, 1.5, 1.0, 3.0, 1.0, 2.5</li>
<li><em>Standard deviations</em>: 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 1.3, 1.3</li>
</ul>
<p><strong>Calculated data</strong></p>
<ul>
<li><em>Cumulative sample sizes</em>: 22, 22, 33, 35, 55, 57, 66, 70</li>
<li><em>Cumulative means</em>: 1.000, 1.400, 1.033, 1.437, 1.020, 2.040, 1.017, 2.126</li>
<li><em>Cumulative standard deviations</em>: 1.000, 1.000, 1.381, 1.425, 1.639, 1.823, 1.579, 1.739</li>
</ul>
</section>
<section id="show-a-summary-of-the-object" class="level2">
<h2 class="anchored" data-anchor-id="show-a-summary-of-the-object">Show a summary of the object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">designFisher <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Sequential analysis with a maximum of 4 looks (Fisher’s combination test design)</strong></p>
<p>Constant levels design, binding futility, one-sided overall significance level 2.5%, undefined endpoint.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>1</td>
<td>1.225</td>
<td>1.225</td>
<td>1</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0137</td>
<td>0.0206</td>
<td>0.0237</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0137</td>
<td>0.0137</td>
<td>0.0137</td>
<td>0.0137</td>
</tr>
<tr class="even">
<td>Efficacy boundary (p product scale)</td>
<td>0.01366638</td>
<td>0.00089215</td>
<td>0.00009643</td>
<td>0.00002151</td>
</tr>
<tr class="odd">
<td>Futility boundary (separate p-value scale)</td>
<td>0.4000</td>
<td>0.4000</td>
<td>0.4000</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">powerResults <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Power calculation for a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 4 looks (group sequential design), one-sided overall significance level 5%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect as specified, standard deviation = 1, maximum number of subjects = 100.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>25%</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0011</td>
<td>0.0105</td>
<td>0.0282</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0011</td>
<td>0.0100</td>
<td>0.0240</td>
<td>0.0390</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.069</td>
<td>2.326</td>
<td>1.978</td>
<td>1.763</td>
</tr>
<tr class="odd">
<td>Efficacy boundary (t)</td>
<td>1.382</td>
<td>0.681</td>
<td>0.465</td>
<td>0.356</td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0</td>
<td>0.0011</td>
<td>0.0105</td>
<td>0.0282</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Cumulative power, alt. = 0.2</td>
<td>0.0050</td>
<td>0.0537</td>
<td>0.1431</td>
<td>0.2471</td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0.4</td>
<td>0.0189</td>
<td>0.1810</td>
<td>0.4137</td>
<td>0.6140</td>
</tr>
<tr class="odd">
<td>Cumulative power, alt. = 0.6</td>
<td>0.0571</td>
<td>0.4163</td>
<td>0.7370</td>
<td>0.8979</td>
</tr>
<tr class="even">
<td>Cumulative power, alt. = 0.8</td>
<td>0.1394</td>
<td>0.6877</td>
<td>0.9317</td>
<td>0.9879</td>
</tr>
<tr class="odd">
<td>Cumulative power, alt. = 1</td>
<td>0.2788</td>
<td>0.8831</td>
<td>0.9905</td>
<td>0.9994</td>
</tr>
<tr class="even">
<td>Number of subjects</td>
<td>25.0</td>
<td>50.0</td>
<td>75.0</td>
<td>100.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0</td>
<td></td>
<td></td>
<td></td>
<td>99.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.2</td>
<td></td>
<td></td>
<td></td>
<td>95.0</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.4</td>
<td></td>
<td></td>
<td></td>
<td>84.7</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 0.6</td>
<td></td>
<td></td>
<td></td>
<td>69.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1, alt. = 0.8</td>
<td></td>
<td></td>
<td></td>
<td>56.0</td>
</tr>
<tr class="even">
<td>Expected number of subjects under H1, alt. = 1</td>
<td></td>
<td></td>
<td></td>
<td>46.2</td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H0)</td>
<td>0.0011</td>
<td>0.0095</td>
<td>0.0177</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1), alt. = 0</td>
<td>0.0011</td>
<td>0.0095</td>
<td>0.0177</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1), alt. = 0.2</td>
<td>0.0050</td>
<td>0.0486</td>
<td>0.0894</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1), alt. = 0.4</td>
<td>0.0189</td>
<td>0.1621</td>
<td>0.2326</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1), alt. = 0.6</td>
<td>0.0571</td>
<td>0.3592</td>
<td>0.3207</td>
<td></td>
</tr>
<tr class="even">
<td>Exit probability for efficacy (under H1), alt. = 0.8</td>
<td>0.1394</td>
<td>0.5483</td>
<td>0.2440</td>
<td></td>
</tr>
<tr class="odd">
<td>Exit probability for efficacy (under H1), alt. = 1</td>
<td>0.2788</td>
<td>0.6043</td>
<td>0.1074</td>
<td></td>
</tr>
</tbody>
</table>
<p>Legend:</p>
<ul>
<li><em>(t)</em>: treatment effect scale</li>
<li><em>alt.</em>: alternative</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">analysisResults <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Analysis results for a continuous endpoint</strong></p>
<p>Sequential analysis with 4 looks (group sequential design), one-sided overall significance level 5%. The results were calculated using a two-sample t-test, equal variances option. H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) &gt; 0.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>25%</td>
<td>50%</td>
<td>75%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0011</td>
<td>0.0105</td>
<td>0.0282</td>
<td>0.0500</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0011</td>
<td>0.0100</td>
<td>0.0240</td>
<td>0.0390</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.069</td>
<td>2.326</td>
<td>1.978</td>
<td>1.763</td>
</tr>
<tr class="odd">
<td>Cumulative effect size</td>
<td>-0.400</td>
<td>-0.404</td>
<td>-1.020</td>
<td>-1.109</td>
</tr>
<tr class="even">
<td>Cumulative (pooled) standard deviation</td>
<td>1.000</td>
<td>1.404</td>
<td>1.735</td>
<td>1.663</td>
</tr>
<tr class="odd">
<td>Overall test statistic</td>
<td>-1.327</td>
<td>-1.185</td>
<td>-3.111</td>
<td>-3.887</td>
</tr>
<tr class="even">
<td>Overall p-value</td>
<td>0.9041</td>
<td>0.8799</td>
<td>0.9988</td>
<td>0.9999</td>
</tr>
<tr class="odd">
<td>Test action</td>
<td>continue</td>
<td>continue</td>
<td>continue</td>
<td>accept</td>
</tr>
<tr class="even">
<td>Conditional rejection probability</td>
<td>0.0028</td>
<td>0.0001</td>
<td>0</td>
<td></td>
</tr>
<tr class="odd">
<td>90% repeated confidence interval</td>
<td>[-1.386; 0.586]</td>
<td>[-1.216; 0.408]</td>
<td>[-1.676; -0.364]</td>
<td>[-1.616; -0.602]</td>
</tr>
<tr class="even">
<td>Repeated p-value</td>
<td>&gt;0.5</td>
<td>&gt;0.5</td>
<td>&gt;0.5</td>
<td>&gt;0.5</td>
</tr>
<tr class="odd">
<td>Final p-value</td>
<td></td>
<td></td>
<td></td>
<td>0.9999</td>
</tr>
<tr class="even">
<td>Final confidence interval</td>
<td></td>
<td></td>
<td></td>
<td>[-1.547; -0.608]</td>
</tr>
<tr class="odd">
<td>Median unbiased estimate</td>
<td></td>
<td></td>
<td></td>
<td>-1.078</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="coerce-object-to-data.frame-as.data.frame" class="level2">
<h2 class="anchored" data-anchor-id="coerce-object-to-data.frame-as.data.frame">Coerce object to data.frame: as.data.frame</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">designGroupSequential <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  typeOfDesign kMax stages informationRates alpha beta deltaWT futilityBounds
1           WT    4      1             0.25  0.05  0.2     0.1           -Inf
2           WT    4      2             0.50  0.05  0.2     0.1           -Inf
3           WT    4      3             0.75  0.05  0.2     0.1           -Inf
4           WT    4      4             1.00  0.05  0.2     0.1             NA
  bindingFutility sided  tolerance  alphaSpent criticalValues stageLevels
1           FALSE     1 0.00000001 0.001073781       3.069028 0.001073781
2           FALSE     1 0.00000001 0.010526914       2.325888 0.010012250
3           FALSE     1 0.00000001 0.028205994       1.977663 0.023983344
4           FALSE     1 0.00000001 0.050000000       1.762694 0.038976069</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">dataset <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  stages groups sampleSizes means stDevs overallSampleSizes overallMeans
1      1      1          22   1.0    1.0                 22     1.000000
2      1      2          22   1.4    1.0                 22     1.400000
3      2      1          11   1.1    2.0                 33     1.033333
4      2      2          13   1.5    2.0                 35     1.437143
5      3      1          22   1.0    2.0                 55     1.020000
6      3      2          22   3.0    2.0                 57     2.040351
7      4      1          11   1.0    1.3                 66     1.016667
8      4      2          13   2.5    1.3                 70     2.125714
  overallStDevs
1      1.000000
2      1.000000
3      1.381500
4      1.425418
5      1.639151
6      1.822857
7      1.578664
8      1.738706</code></pre>
</div>
</div>
</section>
<section id="coerce-object-to-data.frame-as.data.frame-with-argument-nicecolumnnamesenabled-true" class="level2">
<h2 class="anchored" data-anchor-id="coerce-object-to-data.frame-as.data.frame-with-argument-nicecolumnnamesenabled-true">Coerce object to data.frame: as.data.frame with argument ‘niceColumnNamesEnabled = TRUE’</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">designFisher <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">niceColumnNamesEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>      Method Maximum # stages Stage Information rate Significance level Alpha_0
1 equalAlpha                4     1              0.2              0.025     0.4
2 equalAlpha                4     2              0.5              0.025     0.4
3 equalAlpha                4     3              0.8              0.025     0.4
4 equalAlpha                4     4              1.0              0.025      NA
  Binding futility Test        Tolerance Cumulative alpha spending
1             TRUE    1 0.00000000000001                0.01366638
2             TRUE    1 0.00000000000001                0.02055086
3             TRUE    1 0.00000000000001                0.02372061
4             TRUE    1 0.00000000000001                0.02500000
  Critical value Stage level Non stochastic curtailment
1  0.01366637982  0.01366638                      FALSE
2  0.00089215382  0.01366638                      FALSE
3  0.00009643023  0.01366638                      FALSE
4  0.00002151406  0.01366638                      FALSE</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">designCharacteristics <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">niceColumnNamesEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  Inflation factor Stage Information      Power Rejection probability under H1
1          1.04846     1    1.620541 0.03624538                     0.03624538
2          1.04846     2    3.241081 0.30264612                     0.26640074
3          1.04846     3    4.861622 0.60337036                     0.30072424
4          1.04846     4    6.482163 0.80000000                     0.19662964
  Futility probability under H1 Ratio expected vs fixed sample size under H1
1                             0                                    0.8014789
2                             0                                    0.8014789
3                             0                                    0.8014789
4                            NA                                    0.8014789
  Ratio expected vs fixed sample size under a value between H0 and H1
1                                                           0.9724133
2                                                           0.9724133
3                                                           0.9724133
4                                                           0.9724133
  Ratio expected vs fixed sample size under H0
1                                     1.038026
2                                     1.038026
3                                     1.038026
4                                     1.038026</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">powerAndASN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">niceColumnNamesEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  Stage Effect Average sample size (ASN)     Power Early stop Overall reject
1     1    0.5                   26.7863 0.9266075 0.06839003      0.9266075
2     2    0.5                   26.7863 0.9266075 0.39887080      0.9266075
3     3    0.5                   26.7863 0.9266075 0.31845861      0.9266075
4     4    0.5                   26.7863 0.9266075         NA      0.9266075
  Reject per stage  Overall futility Futility stop per stage
1       0.06839003 0.000000002898419      0.0000000009865876
2       0.39887080 0.000000002898419      0.0000000009758407
3       0.31845861 0.000000002898419      0.0000000009359906
4       0.14088808 0.000000002898419                      NA</code></pre>
</div>
</div>
</section>
<section id="coerce-object-to-matrix-as.matrix" class="level2">
<h2 class="anchored" data-anchor-id="coerce-object-to-matrix-as.matrix">Coerce object to matrix: as.matrix</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">designGroupSequential <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.matrix</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> Stage Type of design Maximum # stages Information rate Significance level
 "1"   "WT"           "4"              "0.25"           "0.05"            
 "2"   "WT"           "4"              "0.50"           "0.05"            
 "3"   "WT"           "4"              "0.75"           "0.05"            
 "4"   "WT"           "4"              "1.00"           "0.05"            
 Type II error rate Delta (Wang &amp; Tsiatis) Futility bound (non-binding)
 "0.2"              "0.1"                  "-Inf"                      
 "0.2"              "0.1"                  "-Inf"                      
 "0.2"              "0.1"                  "-Inf"                      
 "0.2"              "0.1"                  NA                          
 Binding futility Test Tolerance    Cumulative alpha spending Critical value
 "FALSE"          "1"  "0.00000001" "0.001073781"             "3.069028"    
 "FALSE"          "1"  "0.00000001" "0.010526914"             "2.325888"    
 "FALSE"          "1"  "0.00000001" "0.028205994"             "1.977663"    
 "FALSE"          "1"  "0.00000001" "0.050000000"             "1.762694"    
 Stage level  
 "0.001073781"
 "0.010012250"
 "0.023983344"
 "0.038976069"</code></pre>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_generic_functions/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_12.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Installation Qualification of rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_installation_qualification/</link>
  <description><![CDATA[ 




<section id="introduction" class="level2">
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>As part of the regulatory requirements in GxP environments, the <strong>Installation Qualification (IQ)</strong> of software is a critical process to ensure that a system is installed correctly and works as intended in the target environment. In the case of the <a href="https://cran.r-project.org/package=rpact">rpact</a> package, the Installation Qualification is performed through the <code>testPackage()</code> function, which provides an essential validation mechanism for ensuring the package meets the required standards. When you run this function, more than 37,000 unit tests are performed and the overall test result is presented in a small report.</p>
<p>From release version 4.1.1 of <code>rpact</code>, a significant change has been introduced regarding the execution of unit tests. Only a single test case remains in the package, which informs users that the unit tests have been moved and are no longer included by default. Full access to all unit tests is restricted to paying customers who possess the necessary credentials (<code>token</code> and <code>secret</code>). These credentials are included in the user-specific <strong>rpact validation documentation</strong>, provided to all members of the <strong>RPACT User Group</strong> for each release.</p>
<p>This vignette explains how to perform the Installation Qualification for <code>rpact</code> and highlights the recent changes to the testing process.</p>
</section>
<section id="important-update-on-unit-tests-in-the-latest-rpact-release" class="level2">
<h2 class="anchored" data-anchor-id="important-update-on-unit-tests-in-the-latest-rpact-release">Important Update on Unit Tests in the Latest rpact Release</h2>
<p>From release version 4.1.1 of <code>rpact</code>, we have streamlined the testing process by moving the full set of unit tests to a private repository. This ensures that testing is both efficient and compliant with CRAN requirements, while maintaining strict adherence to GxP standards. Only paying customers have access to the complete unit test suite, as part of the installation qualification (IQ). The tests are executed automatically through the <code>testPackage()</code> function, and a local or server-based execution of these tests is a crucial step to validate <code>rpact</code> for use in regulated environments.</p>
<p>If you have already conducted your installation qualification using the <code>testPackage()</code> function, nothing changes for you. However, if your IQ was done without using <code>testPackage()</code>, we recommend using the <code>setupPackageTests()</code> function to ensure that the full set of tests is integrated into your local <code>rpact</code> installation. This approach provides you with the flexibility to run the tests using your own testing pipeline, ensuring that the package is fully qualified for use in regulated environments (see section Setup Complete Test Suite of rpact below).</p>
</section>
<section id="using-testpackage-for-installation-qualification" class="level2">
<h2 class="anchored" data-anchor-id="using-testpackage-for-installation-qualification">Using <code>testPackage()</code> for Installation Qualification</h2>
<p>The <code>testPackage()</code> function is designed to run all the necessary unit tests for validating the installation of <code>rpact</code>. It can download and execute a full set of tests or a subset, depending on the user’s needs and access credentials.</p>
<section id="example-usage" class="level3">
<h3 class="anchored" data-anchor-id="example-usage">Example Usage</h3>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb1-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outDir =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/path/to/output"</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># absolute path to the output directory</span></span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">completeUnitTestSetEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">types =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tests"</span>, </span>
<span id="cb1-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">connection =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb1-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">token =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_token"</span>, </span>
<span id="cb1-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">secret =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_secret"</span></span>
<span id="cb1-8">  )</span>
<span id="cb1-9">)</span></code></pre></div></div>
<p>Note that the <code>outDir</code> parameter must be an absolute path or <code>"."</code> (current working directory). By default, the current working directory is used.</p>
<p>Alternatively, you can run the following code to execute the installation qualification:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setwd</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/path/to/output"</span>) </span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb2-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">completeUnitTestSetEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb2-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">types =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tests"</span>, </span>
<span id="cb2-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">connection =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb2-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">token =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_token"</span>, </span>
<span id="cb2-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">secret =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_secret"</span></span>
<span id="cb2-8">  )</span>
<span id="cb2-9">)</span></code></pre></div></div>
</section>
<section id="parameters" class="level3">
<h3 class="anchored" data-anchor-id="parameters">Parameters</h3>
<ul>
<li><strong>outDir</strong>: The absolute path to the directory where all test results will be saved. By default, the current working directory is used.</li>
<li><strong>completeUnitTestSetEnabled</strong>: If <code>TRUE</code>, all existing unit tests will be executed. If <code>FALSE</code>, only a subset of the tests will run.</li>
<li><strong>types</strong>: The type(s) of tests to run, which can include <code>"tests"</code>, <code>"examples"</code>, and <code>"vignettes"</code>. By default, only the unit tests are run.</li>
<li><strong>connection</strong>: A list containing the user-specific <code>token</code> and <code>secret</code>. These credentials provide access to the full set of unit tests and are necessary to fulfill regulatory requirements. Credentials change for every <code>rpact</code> release and are provided in the appendix of the user-specific validation documentation (see Fig. 1).</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_installation_qualification/validation_documentation.png" class="img-fluid figure-img"></p>
<figcaption>Figure 1: Appendix of the rpact validation documentation</figcaption>
</figure>
</div>
</section>
<section id="how-it-works" class="level3">
<h3 class="anchored" data-anchor-id="how-it-works">How it Works</h3>
<p>When you execute <code>testPackage()</code>, the function creates a subdirectory named <code>rpact-tests</code> in the specified output directory. It then downloads all unit test files from a private repository and copies them to this newly created directory. The full set of tests (or a subset, depending on the parameters) is executed using the built-in <code>testInstalledPackage()</code> function from the <code>tools</code> package. All test results are saved in the file <code>testthat.Rout</code>, located in the <code>rpact-tests</code> directory.</p>
</section>
</section>
<section id="setup-tests" class="level2">
<h2 class="anchored" data-anchor-id="setup-tests">Setup Complete Test Suite of rpact</h2>
<p>In most environments, the recommended approach is to let <code>testPackage()</code> download and execute the complete unit test suite in one step. In some company environments, however, direct access to the private test repository is blocked by internal network restrictions, proxy settings, firewall rules, or limitations of the validated execution environment. In such cases, the complete test suite can be downloaded in a separate environment and then transferred manually to the system where the Installation Qualification (IQ) must be performed.</p>
<p>This process is especially useful if the validated system cannot download the test files directly, but another company-approved computer, for example a local laptop, can access the test repository using the release-specific credentials.</p>
<p>The process consists of three steps:</p>
<ol type="1">
<li><strong>Download the complete test suite in an environment with repository access.</strong></li>
<li><strong>Copy the downloaded <code>rpact-tests</code> directory to the target validation environment, e.g., <code>/home/user/project/rpact-tests</code>.</strong></li>
<li><strong>Execute the tests from this local directory.</strong></li>
</ol>
<blockquote class="blockquote">
<p>Note that in the target directory you should see at least the file <code>testthat.R</code> and a sub-folder <code>testthat</code> containing the different test R files.</p>
</blockquote>
<p>The same <code>rpact</code> release must be used for downloading and executing the tests. The credentials (<code>token</code> and <code>secret</code>) are release-specific and must match the installed <code>rpact</code> version. For example, credentials provided for <code>rpact</code> 4.4.0 must be used with <code>rpact</code> 4.4.0.</p>
<section id="step-1-download-the-complete-test-suite-only" class="level3">
<h3 class="anchored" data-anchor-id="step-1-download-the-complete-test-suite-only">Step 1: Download the Complete Test Suite Only</h3>
<p>On a computer that can access the private test repository, install and load the required <code>rpact</code> version and run <code>testPackage()</code> with <code>downloadTestsOnly = TRUE</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb3-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outDir =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/path/to/download/location"</span>,</span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">completeUnitTestSetEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">downloadTestsOnly =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb3-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">connection =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">token =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_token"</span>,</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">secret =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_secret"</span></span>
<span id="cb3-8">  )</span>
<span id="cb3-9">)</span></code></pre></div></div>
<p>This command downloads the complete unit test suite but does not execute the tests. It creates a directory named <code>rpact-tests</code> in the specified <code>outDir</code>. This directory contains the test files that need to be transferred to the target validation environment.</p>
<p>Using <code>testPackage(..., downloadTestsOnly = TRUE)</code> is appropriate for this purpose. It is often more convenient than using <code>setupPackageTests()</code> when the objective is to download the test files into a defined working directory and then move them to another system.</p>
</section>
<section id="step-2-transfer-the-test-directory-to-the-target-environment" class="level3">
<h3 class="anchored" data-anchor-id="step-2-transfer-the-test-directory-to-the-target-environment">Step 2: Transfer the Test Directory to the Target Environment</h3>
<p>Copy the complete <code>rpact-tests</code> directory to the environment in which the IQ shall be performed, for example to a project directory on Posit Workbench, RStudio Server, or another validated Linux environment.</p>
<p>Do not copy individual files selectively. The complete directory structure must be preserved. After the transfer, the target environment should contain a directory such as:</p>
<pre class="text"><code>/home/user/project/rpact-tests</code></pre>
<p>The <code>testFileDirectory</code> argument must point to this directory.</p>
</section>
<section id="step-3-execute-the-tests-from-the-local-test-directory" class="level3">
<h3 class="anchored" data-anchor-id="step-3-execute-the-tests-from-the-local-test-directory">Step 3: Execute the Tests from the Local Test Directory</h3>
<p>In the target validation environment, install and load the same <code>rpact</code> version that was used for downloading the tests. Then execute:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb5-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outDir =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/project"</span>,</span>
<span id="cb5-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">completeUnitTestSetEnabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb5-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">testFileDirectory =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/project/rpact-tests"</span></span>
<span id="cb5-5">)</span></code></pre></div></div>
<p>We recommend using an absolute path for <code>testFileDirectory</code>. In addition, the path should be specified without a trailing slash. For example, use:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">testFileDirectory <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/project/rpact-tests"</span></span></code></pre></div></div>
<p>instead of:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">testFileDirectory <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/home/user/project/rpact-tests/"</span></span></code></pre></div></div>
<p>This avoids possible path handling issues in restrictive or platform-specific environments.</p>
</section>
<section id="verifying-that-the-complete-test-suite-was-executed" class="level3">
<h3 class="anchored" data-anchor-id="verifying-that-the-complete-test-suite-was-executed">Verifying That the Complete Test Suite Was Executed</h3>
<p>The console output (see <code>testthat.Rout</code> or <code>testthat.Rout.fail</code> in the specified folder) alone is not sufficient for reviewing all details of the IQ run. After execution, check the generated report file in the test result directory:</p>
<pre class="text"><code>rpact_test_result_report.md</code></pre>
<blockquote class="blockquote">
<p>Note that in case of successful rendering only the html and pdf version of this document will be available.</p>
</blockquote>
<p>This file contains the detailed results of the test execution, including the details of failed tests if any failures occurred. The console output usually only shows a compact summary, for example the number of passed and failed tests.</p>
<p>A successful complete IQ run should execute the full test suite. If only a very small number of tests is executed, for example approximately 100 tests instead of the complete suite, the complete unit test set was most likely not available to the test runner. In that case, check the following points:</p>
<ul>
<li>The installed <code>rpact</code> version matches the version for which the credentials were issued.</li>
<li>The <code>rpact-tests</code> directory was copied completely, including all subdirectories and test files.</li>
<li><code>testFileDirectory</code> points to the transferred <code>rpact-tests</code> directory.</li>
<li>An absolute path is used for <code>testFileDirectory</code>.</li>
<li>The path does not end with a trailing slash.</li>
<li>The test report <code>rpact_test_result_report.md</code> (or rendered html or pdf version) is reviewed for detailed diagnostic information.</li>
</ul>
<p>Running <code>testthat::test_check()</code> directly is not recommended for the complete rpact IQ unless the complete test suite has first been installed or made available in exactly the location expected by the test runner. If the complete test files are missing, <code>testthat::test_check()</code> may fail with messages such as <code>No test files found</code> or may execute only the small basic test subset that is included in the public package installation. In that case, the package has not yet been qualified for GxP use.</p>
<p>The <code>setupPackageTests()</code> function ensures that the required test files are securely downloaded and integrated into the local <code>rpact</code> installation. By doing so, users can use their own test pipeline instead of relying on the <code>testPackage()</code> function to execute the tests.</p>
</section>
<section id="function-overview" class="level3">
<h3 class="anchored" data-anchor-id="function-overview">Function Overview</h3>
<p>The <code>setupPackageTests()</code> function performs the following operations:</p>
<ol type="1">
<li><strong>Validation of Directories</strong>: It verifies the existence of the <code>rpact</code> package directory and its necessary subdirectories (<code>tests</code> and <code>testthat</code>).</li>
<li><strong>Download and Installation of Tests</strong>: Using user-provided credentials (<code>token</code> and <code>secret</code>), the function downloads the complete test suite to a temporary directory. It then copies the tests into the appropriate subdirectories of the local <code>rpact</code> installation.</li>
</ol>
</section>
<section id="parameters-1" class="level3">
<h3 class="anchored" data-anchor-id="parameters-1">Parameters</h3>
<ul>
<li><code>token</code>: A string used for authentication during the download of the test suite.</li>
<li><code>secret</code>: A string used for secure authentication alongside the <code>token</code>.</li>
</ul>
</section>
<section id="process-benefits" class="level3">
<h3 class="anchored" data-anchor-id="process-benefits">Process Benefits</h3>
<p>By leveraging the <code>setupPackageTests()</code> function, users gain access to the following benefits:</p>
<ul>
<li><strong>Automated Compliance</strong>: The function ensures the seamless integration of up-to-date test files into the <code>rpact</code> environment, supporting regulatory compliance.</li>
<li><strong>Enhanced Flexibility</strong>: Once the test suite is installed, users can execute it using their preferred testing pipelines, providing adaptability to different operational setups.</li>
</ul>
</section>
<section id="practical-guidance" class="level3">
<h3 class="anchored" data-anchor-id="practical-guidance">Practical Guidance</h3>
<p>To execute the <code>setupPackageTests()</code> function, ensure you have valid credentials (<code>token</code> and <code>secret</code>) obtained as part of the <code>rpact</code> release. These credentials are unique for every release and are provided in the accompanying <code>rpact</code> validation documentation (see Fig. 1), which is shared with members of the RPACT User Group.</p>
<p>Once the test suite is installed using <code>setupPackageTests()</code>, you can use your custom pipelines to perform the installation qualification. If you encounter any issues, we recommend reaching out to the RPACT support team for assistance.</p>
</section>
</section>
<section id="importance-of-installation-qualification" class="level2">
<h2 class="anchored" data-anchor-id="importance-of-installation-qualification">Importance of Installation Qualification</h2>
<p>For GxP-compliant environments, running the installation qualification is a mandatory step to ensure that <code>rpact</code> is functioning correctly. The IQ process verifies that the software is installed in a validated state and can be trusted for use in clinical and other regulated research settings.</p>
<p>The <strong>rpact validation documentation</strong> is over 7,000 pages long and details the formal validation of the package. This documentation, together with the IQ performed using <code>testPackage()</code>, forms the basis for ensuring that <code>rpact</code> is fully validated for use in regulated environments.</p>
<section id="installation-qualification-reminder-message" class="level3">
<h3 class="anchored" data-anchor-id="installation-qualification-reminder-message">Installation Qualification Reminder Message</h3>
<p>When loading the <code>rpact</code> package in R, the following message will be displayed by default if the installation qualification (IQ) process has not yet been performed:</p>
<div class="cell" data-print="true">
<div class="cell-output cell-output-stderr">
<pre><code>Installation qualification for rpact 4.5.0.9315 has not yet been performed.</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Please run testPackage() before using the package in GxP relevant environments.</code></pre>
</div>
</div>
<p>This message serves as a reminder to ensure that the <code>rpact</code> package has undergone the necessary validation steps before being used in GxP-relevant environments. The message will continue to appear every time the package is loaded until the <code>testPackage()</code> function has been successfully executed.</p>
<section id="suppressing-the-message" class="level4">
<h4 class="anchored" data-anchor-id="suppressing-the-message">Suppressing the Message</h4>
<p>If desired, the reminder message can be suppressed using one of the following methods:</p>
<p><strong>Suppress Startup Messages</strong>: Load the package using <code>suppressPackageStartupMessages()</code> to prevent the message from being displayed:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">suppressPackageStartupMessages</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact))</span></code></pre></div></div>
</div>
<p><strong>Disable centrally for all users / sessions</strong>: The package also provides a dedicated command to disable the startup reminder centrally:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">?rpact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>disableStartupMessages</span>
<span id="cb12-2">rpact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">disableStartupMessages</span>()</span></code></pre></div></div>
</div>
<p>This function sets the option</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.startup.message.enabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span></code></pre></div></div>
</div>
<p>and stores this option persistently.</p>
<p>As an alternative, the same option can be configured globally in R startup files before users load or use the package. In particular, system administrators can add</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rpact.startup.message.enabled =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span></code></pre></div></div>
</div>
<p>to the site-wide R startup profile <code>Rprofile.site</code>. This file is located in</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">R.home</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"etc"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rprofile.site"</span>)</span></code></pre></div></div>
</div>
<p>and is evaluated when R starts. Therefore, defining the option there ensures that the startup reminder is disabled automatically for all users and sessions using that R installation, for example in centrally managed server or Docker environments.</p>
<p>User-specific startup files such as <code>~/.Rprofile</code> can also be used, but these settings apply only to the respective user.</p>
</section>
</section>
</section>
<section id="installation-qualification-report" class="level2">
<h2 class="anchored" data-anchor-id="installation-qualification-report">Installation Qualification Report</h2>
<p>As part of the <code>testPackage()</code> function execution, a detailed Installation Qualification (IQ) report is automatically generated to document the testing process and its results. This report is a key deliverable in the validation workflow, ensuring that the <code>rpact</code> package meets the necessary requirements for GxP-compliant environments.</p>
<section id="report-overview" class="level3">
<h3 class="anchored" data-anchor-id="report-overview">Report Overview</h3>
<p>The IQ report provides the following key sections:</p>
<ol type="1">
<li><strong>Introduction</strong>: Outlines the purpose and scope of the IQ process, including its importance for verifying the installation and functionality of <code>rpact</code> in regulated environments.</li>
<li><strong>System Information</strong>: Captures details about the system and environment where the IQ process was performed, including:
<ul>
<li><code>rpact</code> package version and release date</li>
<li>R version and platform information</li>
<li>Operating system and locale settings</li>
</ul></li>
<li><strong>Test Results</strong>: Summarizes the outcomes of all executed tests, categorizing them as passed, failed, or passed with warnings. This section highlights any discrepancies that may require resolution to ensure compliance.</li>
</ol>
</section>
<section id="output-formats" class="level3">
<h3 class="anchored" data-anchor-id="output-formats">Output Formats</h3>
<p>The report is automatically generated in two formats:</p>
<ul>
<li><strong>HTML</strong>: Suitable for easy viewing in web browsers.</li>
<li><strong>PDF</strong>: Provides a static, printable format ideal for documentation and archiving purposes.</li>
</ul>
<p>Both formats are saved to the directory specified by the user argument <code>outDir</code> after running <code>testPackage()</code>.</p>
<section id="download-example-report" class="level4">
<h4 class="anchored" data-anchor-id="download-example-report">Download Example Report</h4>
<ul>
<li><a href="rpact_test_result_report.html">Download HTML Report</a></li>
<li><a href="rpact_test_result_report.pdf">Download PDF Report</a></li>
</ul>
</section>
</section>
<section id="report-customization" class="level3">
<h3 class="anchored" data-anchor-id="report-customization">Report Customization</h3>
<p>The Installation Qualification report is intentionally designed to be <strong>audit-friendly</strong> and easy to align with company-specific documentation conventions. Two areas are commonly customized:</p>
<ol type="1">
<li><strong>Report file names</strong> (e.g., adding a timestamp or qualification ID)</li>
<li><strong>Additional metadata</strong> (tag–value pairs) shown in the section <em>“System Information and Environment details for Qualification”</em>.</li>
</ol>
<blockquote class="blockquote">
<p><strong>Note</strong><br>
The functionality described in this section is available in rpact versions newer than 4.3.0. Please ensure that you are using an up-to-date rpact release when relying on report customization and metadata persistence.</p>
</blockquote>
<section id="customizing-the-report-file-names-with-reportfilebasename" class="level4">
<h4 class="anchored" data-anchor-id="customizing-the-report-file-names-with-reportfilebasename">Customizing the report file names with <code>reportFileBaseName</code></h4>
<p>Use <code>reportFileBaseName</code> to control the base name of all generated report files (without path and without extension). The report files are still written to <code>outDir</code>.</p>
<p>Typical outputs (depending on <code>reportType</code>) are:</p>
<ul>
<li><code>&lt;reportFileBaseName&gt;.html</code></li>
<li><code>&lt;reportFileBaseName&gt;.pdf</code></li>
</ul>
<p><strong>Example: add an ISO-like timestamp suffix</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb16-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reportFileBaseName =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb16-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact_test_result_report_"</span>,</span>
<span id="cb16-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.time</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%Y-%m-%d_%H-%M-%S"</span>)</span>
<span id="cb16-5">  )</span>
<span id="cb16-6">)</span></code></pre></div></div>
</div>
<p>This will generate, for example:</p>
<ul>
<li><code>rpact_test_result_report_2026-02-04_10-50-21.html</code></li>
<li><code>rpact_test_result_report_2026-02-04_10-50-21.pdf</code></li>
</ul>
</section>
<section id="adding-metadata-via-metadata" class="level4">
<h4 class="anchored" data-anchor-id="adding-metadata-via-metadata">Adding metadata via <code>metaData</code></h4>
<p>Use <code>metaData</code> to add <strong>arbitrary tag–value pairs</strong> to the report. This is useful to capture organization-specific information (e.g., container name, host name, ticket IDs, or qualification purpose) without having to post-process the report.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(</span>
<span id="cb17-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">testFileDirectory =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getwd</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tests"</span>),</span>
<span id="cb17-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">metaData =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb17-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Purpose</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-release check"</span>,</span>
<span id="cb17-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Company</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RPACT GmbH, Germany"</span>,</span>
<span id="cb17-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Container Name</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026_Container"</span>,</span>
<span id="cb17-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Hostname</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.info</span>()[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nodename"</span>]],</span>
<span id="cb17-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Qualification ID</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"IQ-2026-0007"</span>,</span>
<span id="cb17-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Executed By</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.info</span>()[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"user"</span>]],</span>
<span id="cb17-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Git Commit</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.getenv</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GITHUB_SHA"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unset =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb17-11">  ),</span>
<span id="cb17-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reportFileBaseName =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb17-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact_test_result_report_"</span>,</span>
<span id="cb17-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.time</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%Y-%m-%d_%H-%M-%S"</span>)</span>
<span id="cb17-15">  )</span>
<span id="cb17-16">)</span></code></pre></div></div>
</div>
<p>Notes:</p>
<ul>
<li>Keys are printed as provided (including spaces). If you prefer a strict naming convention, use keys such as <code>OS</code>, <code>HOSTNAME</code>, <code>CONTAINER_NAME</code>, etc.</li>
<li>Values should be scalar character strings.</li>
</ul>
</section>
<section id="providing-metadata-from-a-file-via-metadatafile" class="level4">
<h4 class="anchored" data-anchor-id="providing-metadata-from-a-file-via-metadatafile">Providing metadata from a file via <code>metaDataFile</code></h4>
<p>If you want to keep metadata under configuration management (e.g., in a repository or validated document set), you can provide it via a simple text file using <code>metaDataFile</code>.</p>
<p>The expected format is <strong>one entry per line</strong>:</p>
<pre><code>KEY=VALUE</code></pre>
<p>Example file <code>qualification_metadata.txt</code>:</p>
<pre><code>Container name=2026_Container
Host name=my_host
Purpose="Pre-release check"</code></pre>
<p>You can create such a file programmatically using <code>writeKeyValueFile()</code> and read it back with <code>readKeyValueFile()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">metaDataFile <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getwd</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qualification_metadata.txt"</span>)</span>
<span id="cb20-2"></span>
<span id="cb20-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">writeKeyValueFile</span>(</span>
<span id="cb20-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">keyValueList =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb20-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Container name</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026_Container"</span>,</span>
<span id="cb20-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Host name</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"my_host"</span>,</span>
<span id="cb20-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Purpose</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-release check"</span></span>
<span id="cb20-8">  ),</span>
<span id="cb20-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">filePath =</span> metaDataFile,</span>
<span id="cb20-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">safeKeyCheck =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># allow keys with spaces</span></span>
<span id="cb20-11">)</span></code></pre></div></div>
</div>
<p>The content of <code>qualification_metadata.txt</code> will look like this:</p>
<pre><code># Generated by rpact::writeKeyValueFile() on 2026-02-18 09:33:43 +0100
# Format: KEY=VALUE (comments start with # or ;)

Container name=2026_Container
Host name=my_host
Purpose="Pre-release check"</code></pre>
<p>Then you can pass the file path to <code>testPackage()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">testPackage</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">metaDataFile =</span> metaDataFile)</span></code></pre></div></div>
</div>
<p>If you provide both <code>metaData</code> <em>and</em> <code>metaDataFile</code>, <code>testPackage()</code> will write the entries from <code>metaData</code> to the file specified by <code>metaDataFile</code>. This allows you to persist the metadata and reuse it in subsequent runs by passing only <code>metaDataFile</code> (and omitting <code>metaData</code>).</p>
<p>In other words: use <code>metaData</code> to <em>define</em> metadata programmatically, and <code>metaDataFile</code> to <em>store and reuse</em> it across qualification runs.</p>
<p><em>Typical workflow:</em></p>
<ol type="1">
<li>First run (create/update the metadata file):
<ul>
<li>provide <code>metaData</code> and <code>metaDataFile</code></li>
</ul></li>
<li>Subsequent runs (reuse the same metadata):
<ul>
<li>provide only <code>metaDataFile</code></li>
</ul></li>
</ol>
</section>
</section>
<section id="using-the-report" class="level3">
<h3 class="anchored" data-anchor-id="using-the-report">Using the Report</h3>
<p>The IQ report serves as a comprehensive record of the validation process. It should be reviewed carefully to ensure all tests have passed successfully. Any failed tests or warnings should be addressed promptly, as these could indicate potential issues with the <code>rpact</code> installation or its compatibility with the system environment.</p>
<p>For more information on resolving issues or interpreting the results, consult the official <a href="https://rpact-com.github.io/rpact/reference/index.html">rpact documentation</a> or reach out to the support team at <script type="text/javascript">
<!--
h='&#114;&#112;&#x61;&#x63;&#116;&#46;&#x63;&#x6f;&#x6d;';a='&#64;';n='&#x73;&#x75;&#112;&#112;&#x6f;&#114;&#116;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>support at rpact dot com</noscript>.</p>
</section>
<section id="importance-of-the-report" class="level3">
<h3 class="anchored" data-anchor-id="importance-of-the-report">Importance of the Report</h3>
<p>Maintaining an up-to-date IQ report is essential for compliance with GxP regulatory standards. It demonstrates that the software has been installed and validated correctly, providing confidence in its reliability and suitability for critical applications.</p>
</section>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>Performing the installation qualification using the <code>testPackage()</code> function is essential for validating <code>rpact</code> in GxP environments. Access to the full set of unit tests is restricted to members of the <strong>RPACT User Group</strong>, who receive user-specific credentials with each release. These credentials, combined with the validation documentation, ensure that the package can be securely and compliantly used in regulated settings. For more information, please visit: <a href="https://www.rpact.com/services/sla">www.rpact.com/services/sla</a>.</p>
<p>If you have any questions or need further assistance, please reach out to us at <a href="http://www.rpact.com">www.rpact.com</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_installation_qualification/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_28.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Supplementing and Enhancing rpact’s Graphical Capabilities with ggplot2</title>
  <dc:creator>[[](#)]{.author-row} [[Yannic Schmidt](# &quot;Yannic Schmidt&quot;) [](#)]{.author-row} [[Stefan Englert](https://www.linkedin.com/in/stefan-englert-a540435b &quot;Visit Stefan Englert&#39;s LinkedIn Profile&quot;){.author-linkedin} [](#)]{.author-row} [[Martina Kron](# &quot;Martina Kron&quot;) [](#)]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>We will illustrate the generation of the plots by assessing the simulated Type I error rate of a group sequential and adaptive inverse normal design in a sample size recalculation setting. It is well known that the adaptive inverse normal designs in contrast to group sequential designs controls the overall Type I error rate even in a setting of sample size recalculation. The goal of this exercise is to present this fact in a single comprehensive output.</p>
<p>With <a href="https://cran.r-project.org/package=rpact">rpact</a>, the necessary components can be conveniently calculated: We will analyze both design choices by <a href="https://cran.r-project.org/package=rpact">rpact</a>, retrieve the results and arrange them by the means of <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a>.</p>
<p><strong>Loading the packages</strong></p>
<p>We start by loading the required two packages.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>)</span></code></pre></div></div>
</div>
<p>The automatic markdown feature of <a href="https://cran.r-project.org/package=rpact">rpact</a> must be disabled for plots (otherwise, combining <a href="https://cran.r-project.org/package=rpact">rpact</a> plot objects with ggplot2 commands will fail):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">options</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact.auto.markdown.plot"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="initialize-the-group-sequential-and-adaptive-inverse-normal-design" class="level1">
<h1>Initialize the group sequential and adaptive inverse normal design</h1>
<p>After the two packages were loaded, the group sequential (<code>dGS</code>) and adaptive inverse normal (<code>dIN</code>) design can be generated. Throughout this document, we will use the default parameter settings from <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">dGS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>()</span>
<span id="cb4-2">dIN <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>()</span></code></pre></div></div>
</div>
<p>We can now take a look into both designs and inspect their default values. These are identical outputs although the way of calculating the test statistics over the stages differ.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">dGS</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design parameters and output of group sequential design</strong></p>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of design</em>: O’Brien &amp; Fleming</li>
<li><em>Maximum number of stages</em>: 3</li>
<li><em>Stages</em>: 1, 2, 3</li>
<li><em>Information rates</em>: 0.333, 0.667, 1.000</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.0002592, 0.0071601, 0.0250000</li>
<li><em>Critical values</em>: 3.471, 2.454, 2.004</li>
<li><em>Stage levels (one-sided)</em>: 0.0002592, 0.0070554, 0.0225331</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">dIN</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design parameters and output of inverse normal combination test design</strong></p>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of design</em>: O’Brien &amp; Fleming</li>
<li><em>Maximum number of stages</em>: 3</li>
<li><em>Stages</em>: 1, 2, 3</li>
<li><em>Information rates</em>: 0.333, 0.667, 1.000</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Futility bounds (non-binding)</em>: -Inf, -Inf</li>
<li><em>Binding futility</em>: FALSE</li>
<li><em>Test</em>: one-sided</li>
<li><em>Tolerance</em>: 0.00000001</li>
</ul>
<p><strong>Output</strong></p>
<ul>
<li><em>Cumulative alpha spending</em>: 0.0002592, 0.0071601, 0.0250000</li>
<li><em>Critical values</em>: 3.471, 2.454, 2.004</li>
<li><em>Stage levels (one-sided)</em>: 0.0002592, 0.0070554, 0.0225331</li>
</ul>
</div>
</div>
<p>In the output, we see some important characteristics like the type of design (OF = O’Brien and Fleming), the maximum number of stages (3), the information rates (0.333, 0.667, 1.000), the significance level (0.025) and the stage level information (0.0002592, 0.0070554, 0.0225331).</p>
<p>We can also easily plot the stage level information by means of <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">dGS <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-6-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">dIN <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-6-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>With these commands, <a href="https://cran.r-project.org/package=rpact">rpact</a> creates the plots that shows the three stage levels (0.0025, 0.0070554, 0.0225331) visually together with the corresponding information rates (0.333, 0.667, 1.000) and the significance level (0.025, dashed line).</p>
</section>
<section id="modification-of-the-rpact-base-plots-with-ggplot2-aesthetic-commands" class="level1">
<h1>Modification of the rpact base plots with ggplot2 (aesthetic) commands</h1>
<p>We note that the plots for the two designs are identical. This is expected as the same boundary type (O’Brien and Fleming) was used for both designs. So, we might want to restrict ourselves to present only one stage level plot. Instead, we can include this information in a custom title. This is achieved by combining the <a href="https://cran.r-project.org/package=rpact">rpact</a> “base” plot with <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a> aesthetics commands as follows:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage level plot of the adaptive and group sequential design"</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>All <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a> aesthetic commands which modify an existing plot are initiated by a plus sign “+”. Thereafter, we can add the particular command in the <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a> language to specify how we want to modify the plot. Luckily, all <a href="https://cran.r-project.org/package=rpact">rpact</a> graphics are compatible with <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a>.</p>
<p>Modifications are not restricted to additions to existing plots, as demonstrated by adding a new title, but they can also re-model the initial plot. For example, we can change the limits of the x- and y-axis post-hoc.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Or do both:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage level plot of the adaptive and group sequential design"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>To make the plot more self-explanatory, we might want to further add</p>
<ul>
<li>a visual highlight for the significance level of a single stage design by using the <code>geom_point</code> and <code>annotate</code> commands</li>
<li>a better visual illustration of the local stage levels by adding horizontal reference lines by using <code>geom_hline</code> commands</li>
<li>color to the three different stages in the plot by using the aesthetic command <code>geom_point</code></li>
<li>the numerical values of the stage levels to plot by using appropriate <code>annotate</code> commands</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage level plot of the adaptive and group sequential design"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb12-6">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Final significance level of single-stage design"</span>,</span>
<span id="cb12-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-8">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes_</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb12-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb12-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes_</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb12-14">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb12-15">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb12-17">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb12-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-19">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb12-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb12-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb12-23">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb12-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb12-26">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span></span>
<span id="cb12-27">    )</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Note that the commands pull the required information directly from the design object and thus would automatically adjust to design changes like, for example, a switch to Pocock boundaries.</p>
</section>
<section id="illustrating-type-i-error-control-of-adaptive-designs-with-rpact-and-ggplot2" class="level1">
<h1>Illustrating Type I error control of adaptive designs with rpact and ggplot2</h1>
<p>In the last part of this document, we investigate the Type I error rate of the chosen group sequential and adaptive inverse normal design in a sample size recalculation setting and present the simulation results visually in a plot.</p>
<section id="simulating-the-type-i-error-rate" class="level2">
<h2 class="anchored" data-anchor-id="simulating-the-type-i-error-rate">Simulating the Type I error rate</h2>
<p>Using <code>getSimulationMeans()</code>, we can easily simulate the operating characteristics of designs. To simulate the Type I error rate, we specify the null hypothesis as an alternative hypothesis with zero therapy effect (<code>alternative = 0</code>). The simulated overall rejection rate of the designs then corresponds to the Type I error rate.</p>
<p>We assume a scenario with two interim analyses after 20 and 40 subjects and a final analysis after 60 subjects. We allow for a recalculation of the sample size for the next stage based on a conditional power of 80%. The recalculated sample size per stage is limited to be between 20 and 80. We perform a total of 100’000 simulations to get sufficient precision for the simulated Type I error rate. The seed (<code>seed = 12345</code>) ensures that the simulated values can be reproduced, e.g., for documentation purposes. This is done for both the group sequential and the inverse normal design specification.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">dGSsim <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMeans</span>(dGS,</span>
<span id="cb13-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb13-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>),</span>
<span id="cb13-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100000</span>,</span>
<span id="cb13-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb13-8">)</span>
<span id="cb13-9">dGSsim <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (group sequential design), one-sided overall significance level 2.5%. The results were simulated for a two-sample t-test (normal approximation), H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect = 0, standard deviation = 1, planned cumulative sample size = c(20, 40, 60), sample size reassessment: conditional power = 0.8, minimum subjects per stage = c(20, 20, 20), maximum subjects per stage = c(20, 80, 80), simulation runs = 100000, seed = 12345.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Planned information rate</td>
<td>33.3%</td>
<td>66.7%</td>
<td>100%</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0002</td>
<td>0.0090</td>
<td>0.0319</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects</td>
<td>20.0</td>
<td>77.2</td>
<td>78.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>175.1</td>
</tr>
<tr class="even">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.1282</td>
<td>0.0848</td>
</tr>
</tbody>
</table>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">dINsim <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMeans</span>(dIN,</span>
<span id="cb14-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>),</span>
<span id="cb14-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb14-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>),</span>
<span id="cb14-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>),</span>
<span id="cb14-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100000</span>,</span>
<span id="cb14-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb14-8">)</span>
<span id="cb14-9">dINsim <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Simulation of a continuous endpoint</strong></p>
<p>Sequential analysis with a maximum of 3 looks (inverse normal combination test design), one-sided overall significance level 2.5%. The results were simulated for a two-sample t-test (normal approximation), H0: mu(1) - mu(2) = 0, power directed towards larger values, H1: effect = 0, standard deviation = 1, planned cumulative sample size = c(20, 40, 60), sample size reassessment: conditional power = 0.8, minimum subjects per stage = c(20, 20, 20), maximum subjects per stage = c(20, 80, 80), simulation runs = 100000, seed = 12345.</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Stage</th>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fixed weight</td>
<td>0.577</td>
<td>0.577</td>
<td>0.577</td>
</tr>
<tr class="even">
<td>Cumulative alpha spent</td>
<td>0.0003</td>
<td>0.0072</td>
<td>0.0250</td>
</tr>
<tr class="odd">
<td>Stage levels (one-sided)</td>
<td>0.0003</td>
<td>0.0071</td>
<td>0.0225</td>
</tr>
<tr class="even">
<td>Efficacy boundary (z-value scale)</td>
<td>3.471</td>
<td>2.454</td>
<td>2.004</td>
</tr>
<tr class="odd">
<td>Cumulative power</td>
<td>0.0003</td>
<td>0.0070</td>
<td>0.0251</td>
</tr>
<tr class="even">
<td>Stage-wise number of subjects</td>
<td>20.0</td>
<td>77.1</td>
<td>78.7</td>
</tr>
<tr class="odd">
<td>Expected number of subjects under H1</td>
<td></td>
<td></td>
<td>175.3</td>
</tr>
<tr class="even">
<td>Conditional power (achieved)</td>
<td></td>
<td>0.1280</td>
<td>0.0806</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="extraction-of-the-simulated-type-i-error-rate-of-both-designs" class="level2">
<h2 class="anchored" data-anchor-id="extraction-of-the-simulated-type-i-error-rate-of-both-designs">Extraction of the simulated Type I error rate of both designs</h2>
<p>We can easily extract the simulated Type I error rate or overall rejection rates under the null hypothesis. This value is stored in the <code>overallReject</code> parameter of the simulation outputs.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">dGSalpha <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dGSsim<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span>
<span id="cb15-2">dGSalpha</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.03193</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">dINalpha <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dINsim<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>overallReject</span>
<span id="cb17-2">dINalpha</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.02507</code></pre>
</div>
</div>
<p>The results of the simulation show that, in a setting of sample size recalculation, the group sequential design does not control the nominal significance level. The overall rejection rate of the group sequential design (0.03193) is larger than the significance level (0.025). The inverse normal design controls the Type I error rate as the overall rejection rate (0.02507) is close to the significance level of 0.025.</p>
</section>
<section id="final-plot" class="level2">
<h2 class="anchored" data-anchor-id="final-plot">Final Plot</h2>
<p>In the final plot of this example, we try to present the core learning of the previous section in a single overarching plot. The final plot should be <em>management ready</em>, meaning include all relevant information, be visually appealing and self-explanatory. The intention of the plot is to transfer the information that a group sequential design and adaptive inverse normal design with same parameters will feature the same stage levels at the corresponding information rates, the same overall significance level, but different overall rejection rates in a setting of sample size recalculation.</p>
<p>For the final plot, we start with all (plot and aesthetic) commands, which we used in the chapter <em>Modification of the rpact base chart with ggplot2 (aesthetic) commands</em>. Additional information from the simulation results are subsequently added in.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># create base ggplot object</span></span>
<span id="cb19-2">createdPlot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(dGS, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb19-3"></span>
<span id="cb19-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># modify the rpact base plot as described above</span></span>
<span id="cb19-5">createdPlot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> createdPlot <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggtitle</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stage level plot of the adaptive and group sequential design"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylim</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb19-10">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Final significance level of single-stage design"</span>,</span>
<span id="cb19-11">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>alpha, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb19-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes_</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb19-15">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb19-16">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes_</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb19-18">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb19-19">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb19-21">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb19-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb19-23">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb19-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb19-26">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb19-27">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(</span>
<span id="cb19-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geom =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb19-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>informationRates[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> dGS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stageLevels[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">vjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span></span>
<span id="cb19-31">    )</span>
<span id="cb19-32"></span>
<span id="cb19-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># add additional annotations</span></span>
<span id="cb19-34">createdPlot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> createdPlot <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>,</span>
<span id="cb19-36">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.016</span>,</span>
<span id="cb19-37">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Group sequential design:"</span>, dGSalpha), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb19-38">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-39">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>,</span>
<span id="cb19-40">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.014</span>,</span>
<span id="cb19-41">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Adaptive inverse normal design:"</span>, dINalpha), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb19-42">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-43">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>,</span>
<span id="cb19-44">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.010</span>,</span>
<span id="cb19-45">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Based on"</span>, dGSsim<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>maxNumberOfIterations, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"simulations."</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb19-46">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb19-47">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>,</span>
<span id="cb19-48">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.020</span>,</span>
<span id="cb19-49">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simulated overall Type I error rate with sample size recalculation:"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb19-50">    )</span>
<span id="cb19-51"></span>
<span id="cb19-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># generate and show plot</span></span>
<span id="cb19-53">createdPlot</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/index_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="summary" class="level1">
<h1>Summary</h1>
<p>It was shown that <a href="https://cran.r-project.org/package=rpact">rpact</a> “base” charts can be modified with standard <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a> commands. The implementation is very easy and intuitive as it follows the normal <a href="https://CRAN.R-project.org/package=ggplot2">ggplot2</a> syntax. The authors hope that this information is helpful for everyone who wants to further modify graphical outputs from <a href="https://cran.r-project.org/package=rpact">rpact</a>.</p>
</section>
<section id="references" class="level1">
<h1>References</h1>
<ol type="1">
<li><p>Gernot Wassmer and Werner Brannath, <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, Springer 2016, ISBN 978-3319325606</p></li>
<li><p>R-Studio, <em>Data Visualization with ggplot2 - Cheat Sheet</em>, version 2.1, 2016, https://www.rstudio.com/wp-content/uploads/2016/11/ggplot2-cheatsheet-2.1.pdf</p></li>
</ol>
</section>
<section id="disclaimer" class="level1">
<h1>Disclaimer</h1>
<p>Yannic Schmidt, Stefan Englert and Martina Kron are employees of AbbVie Inc. Gernot Wassmer and Friedrich Pahlke are employees of RPACT (R Programming for Adaptive Clinical Trials). All opinions and information in this presentation are from the authors and do not necessarily reflect the views of their employers.</p>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <category>Means</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_ggplot_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_13.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>How to Create One- and Multi-Arm Simulation Result Plots with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="preparation" class="level1">
<h1>Preparation</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="simulation-results-base" class="level1">
<h1>Simulation results base</h1>
<section id="simulation-results-base---means" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-base---means">Simulation results base - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">maxNumberOfSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span></span>
<span id="cb3-2">informationRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-3">plannedSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(informationRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects)</span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb3-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb3-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> informationRates</span>
<span id="cb3-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMeans</span>(</span>
<span id="cb3-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb3-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">meanRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb3-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, </span>
<span id="cb3-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> plannedSubjects,</span>
<span id="cb3-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb3-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb3-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, </span>
<span id="cb3-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb3-18">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-4-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-base---rates" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-base---rates">Simulation results base - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">maxNumberOfSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span></span>
<span id="cb4-2">informationRates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb4-3">plannedSubjects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(informationRates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> maxNumberOfSubjects)</span>
<span id="cb4-4"></span>
<span id="cb4-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> informationRates</span>
<span id="cb4-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(</span>
<span id="cb4-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb4-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">riskRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb4-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, </span>
<span id="cb4-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> plannedSubjects,</span>
<span id="cb4-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb4-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb4-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb4-17">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-5-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-base---survival" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-base---survival">Simulation results base - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">kMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(</span>
<span id="cb5-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> kMax, </span>
<span id="cb5-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha0Vec =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb5-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb5-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), </span>
<span id="cb5-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb5-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb5-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>kMax) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>,</span>
<span id="cb5-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocation1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocation2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb5-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb5-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), </span>
<span id="cb5-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb5-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb5-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb5-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb5-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb5-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>),</span>
<span id="cb5-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb5-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb5-24">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-10.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-7-11.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb6-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb6-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb6-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb6-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb6-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb6-7">)</span>
<span id="cb6-8"></span>
<span id="cb6-9">kMax <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb6-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> kMax, </span>
<span id="cb6-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WT"</span>, </span>
<span id="cb6-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deltaWT =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span></span>
<span id="cb6-14">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb6-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, </span>
<span id="cb6-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb6-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>kMax) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, </span>
<span id="cb6-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocation1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb6-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocation2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb6-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>),</span>
<span id="cb6-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime, </span>
<span id="cb6-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>,</span>
<span id="cb6-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), </span>
<span id="cb6-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate1 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb6-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutRate2 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb6-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dropoutTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, </span>
<span id="cb6-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb6-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb6-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>),</span>
<span id="cb6-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb6-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb6-33">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-8-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="simulation-results-multi-arm" class="level1">
<h1>Simulation results multi-arm</h1>
<section id="simulation-results-multi-arm---means" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-multi-arm---means">Simulation results multi-arm - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb7-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb7-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb7-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmMeans</span>(</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>), </span>
<span id="cb7-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb7-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">muMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), </span>
<span id="cb7-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adaptations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb7-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, </span>
<span id="cb7-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb7-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb7-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb7-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb7-17">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-9-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-multi-arm---rates" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-multi-arm---rates">Simulation results multi-arm - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb8-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb8-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb8-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmRates</span>(</span>
<span id="cb8-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfShape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>,</span>
<span id="cb8-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb8-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb8-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb8-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb8-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adaptations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), </span>
<span id="cb8-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb8-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb8-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb8-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb8-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb8-17">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-10-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-multi-arm---survival" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-multi-arm---survival">Simulation results multi-arm - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb9-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMultiArmSurvival</span>(</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">activeArms =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rBest"</span>, </span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb9-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb9-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">omegaMaxVector =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), </span>
<span id="cb9-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adaptations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb9-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, </span>
<span id="cb9-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb9-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEventsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb9-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, </span>
<span id="cb9-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb9-17">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-11-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="simulation-results-enrichment" class="level1">
<h1>Simulation results enrichment</h1>
<section id="simulation-results-enrichment---means" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-enrichment---means">Simulation results enrichment - means</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb10-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb10-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb10-4">)</span>
<span id="cb10-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define subgroups and their prevalences</span></span>
<span id="cb10-6">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fixed names!</span></span>
<span id="cb10-7">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb10-8"></span>
<span id="cb10-9">effectR <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb10-10">effectS12 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb10-11">m <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb10-12"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (effectS1 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)) {</span>
<span id="cb10-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (effectS2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)) {</span>
<span id="cb10-14">        m <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(m, effectS1, effectS12, effectS2, effectR)</span>
<span id="cb10-15">    }</span>
<span id="cb10-16">}</span>
<span id="cb10-17">effects <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(m, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb10-18">stDev <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span></span>
<span id="cb10-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define effect list</span></span>
<span id="cb10-20">el <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb10-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb10-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDevs =</span> stDev, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effects =</span> effects</span>
<span id="cb10-23">)</span>
<span id="cb10-24"></span>
<span id="cb10-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform simulation</span></span>
<span id="cb10-26">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb10-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentMeans</span>(</span>
<span id="cb10-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb10-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> el,</span>
<span id="cb10-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adaptations =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb10-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conditionalPower =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb10-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">minNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb10-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjectsPerStage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb10-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb10-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb10-36">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-12-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-enrichment---rates" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-enrichment---rates">Simulation results enrichment - rates</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb11-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">informationRates =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb11-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb11-4">)</span>
<span id="cb11-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define effect list</span></span>
<span id="cb11-6">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>)</span>
<span id="cb11-7">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb11-8">piControl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb11-9">range1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> piControl[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb11-10">range2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> piControl[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb11-11">piTreatments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb11-12"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (x1 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> range1) {</span>
<span id="cb11-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (x2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> range2) {</span>
<span id="cb11-14">        piTreatments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(piTreatments, x1, x2)</span>
<span id="cb11-15">    }</span>
<span id="cb11-16">}</span>
<span id="cb11-17">el <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb11-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups,</span>
<span id="cb11-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb11-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControl =</span> piControl,</span>
<span id="cb11-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piTreatments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(piTreatments,</span>
<span id="cb11-22">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb11-23">    )</span>
<span id="cb11-24">)</span>
<span id="cb11-25"></span>
<span id="cb11-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform simulation</span></span>
<span id="cb11-27">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb11-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentRates</span>(</span>
<span id="cb11-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>),</span>
<span id="cb11-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> el,</span>
<span id="cb11-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb11-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1234567890</span></span>
<span id="cb11-33">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-13-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-results-enrichment---survival" class="level2">
<h2 class="anchored" data-anchor-id="simulation-results-enrichment---survival">Simulation results enrichment - survival</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define subgroups and their prevalences</span></span>
<span id="cb12-2">subGroups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fixed names!</span></span>
<span id="cb12-3">prevalences <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb12-4"></span>
<span id="cb12-5">piControls <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb12-6">effect <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>)</span>
<span id="cb12-7">piTreatments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> piControls <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> effect</span>
<span id="cb12-8"></span>
<span id="cb12-9">hr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> piTreatments) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> piControls)</span>
<span id="cb12-10"></span>
<span id="cb12-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define effect list</span></span>
<span id="cb12-12">el <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb12-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">subGroups =</span> subGroups, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prevalences =</span> prevalences,</span>
<span id="cb12-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piControls =</span> piControls, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatios =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(hr, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb12-15">)</span>
<span id="cb12-16"></span>
<span id="cb12-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Perform simulation</span></span>
<span id="cb12-18"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignInverseNormal</span>(</span>
<span id="cb12-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noEarlyEfficacy"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationEnrichmentSurvival</span>(</span>
<span id="cb12-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">effectList =</span> el,</span>
<span id="cb12-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfSelection =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rbest"</span>,</span>
<span id="cb12-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rValue =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb12-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intersectionTest =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simes"</span>,</span>
<span id="cb12-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>),</span>
<span id="cb12-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb12-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directionUpper =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb12-28">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/index_files/figure-html/unnamed-chunk-14-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <category>Power simulation</category>
  <category>Multi-arm</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_plot_simulation_results_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_19.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>How to Create Admirable Plots with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_plot_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="preparation" class="level1">
<h1>Preparation</h1>
<p><strong>First, load the rpact package</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="design-plots" class="level1">
<h1>Design plots</h1>
<section id="one-sided-design-with-futility-bounds" class="level2">
<h2 class="anchored" data-anchor-id="one-sided-design-with-futility-bounds">One-sided design with futility bounds</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb3-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb3-6">)</span>
<span id="cb3-7"></span>
<span id="cb3-8">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-4-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-4-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="two-sided-design" class="level2">
<h2 class="anchored" data-anchor-id="two-sided-design">Two-sided design</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb6-6">)</span>
<span id="cb6-7"></span>
<span id="cb6-8">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-5-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-5-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="two-sided-design-with-futility-bound" class="level2">
<h2 class="anchored" data-anchor-id="two-sided-design-with-futility-bound">Two-sided design with futility bound</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb9-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">beta =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb9-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, </span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asOF"</span>,</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeBetaSpending =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsOF"</span>, </span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb9-7">)</span>
<span id="cb9-8"></span>
<span id="cb9-9">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-6-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-6-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">design <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-6-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="sample-size-plots" class="level1">
<h1>Sample size plots</h1>
<section id="sample-size-means-continuous-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-means-continuous-endpoint">Sample size means (continuous endpoint)</h2>
<section id="sample-size-means-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-means-for-a-one-sided-design-with-futility-bounds">Sample size means for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">sampleSizeMeans1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb12-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb12-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>()</span>
<span id="cb12-5"></span>
<span id="cb12-6">sampleSizeMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-7-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">sampleSizeMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-7-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-size-means-for-a-two-sided-design" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-means-for-a-two-sided-design">Sample size means for a two-sided design</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">sampleSizeMeans2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeMeans</span>()</span>
<span id="cb14-3"></span>
<span id="cb14-4">sampleSizeMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-8-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">sampleSizeMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-8-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="sample-size-rates-binary-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-rates-binary-endpoint">Sample size rates (binary endpoint)</h2>
<section id="sample-size-rates-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-rates-for-a-one-sided-design-with-futility-bounds">Sample size rates for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">sampleSizeRates1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb16-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb16-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>()</span>
<span id="cb16-5"></span>
<span id="cb16-6">sampleSizeRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">sampleSizeRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-9-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-size-rates-for-a-two-sided-design" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-rates-for-a-two-sided-design">Sample size rates for a two-sided design</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">sampleSizeRates2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeRates</span>()</span>
<span id="cb18-3"></span>
<span id="cb18-4">sampleSizeRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-10-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">sampleSizeRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-10-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="sample-size-survival-survival-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="sample-size-survival-survival-endpoint">Sample size survival (survival endpoint)</h2>
<section id="sample-size-survival-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-survival-for-a-one-sided-design-with-futility-bounds">Sample size survival for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb20-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb20-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb20-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb20-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb20-6">)</span>
<span id="cb20-7"></span>
<span id="cb20-8">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb20-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb20-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb20-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb20-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb20-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb20-14">)</span>
<span id="cb20-15"></span>
<span id="cb20-16">sampleSizeSurvival1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb20-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb20-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>,</span>
<span id="cb20-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb20-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb20-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb20-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb20-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb20-24">)</span>
<span id="cb20-25"></span>
<span id="cb20-26">sampleSizeSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">sampleSizeSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-11-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">sampleSizeSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-11-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">sampleSizeSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-11-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="sample-size-survival-for-a-two-sided-design" class="level3">
<h3 class="anchored" data-anchor-id="sample-size-survival-for-a-two-sided-design">Sample size survival for a two-sided design</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">design <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb24-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb24-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb24-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb24-6">)</span>
<span id="cb24-7"></span>
<span id="cb24-8">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb24-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0  - &lt;14"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb24-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14 - &lt;24"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb24-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"24 - &lt;44"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>,</span>
<span id="cb24-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 44"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0025</span></span>
<span id="cb24-13">)</span>
<span id="cb24-14">sampleSizeSurvival2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb24-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> design,</span>
<span id="cb24-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>,</span>
<span id="cb24-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb24-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb24-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb24-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb24-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb24-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb24-23">)</span>
<span id="cb24-24"></span>
<span id="cb24-25">sampleSizeSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">sampleSizeSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-12-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">sampleSizeSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-12-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">sampleSizeSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-12-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
</section>
<section id="power-plots" class="level1">
<h1>Power plots</h1>
<section id="power-means-continuous-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="power-means-continuous-endpoint">Power means (continuous endpoint)</h2>
<section id="power-means-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="power-means-for-a-one-sided-design-with-futility-bounds">Power means for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">powerMeans1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb28-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb28-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb28-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(</span>
<span id="cb28-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb28-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">meanRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb28-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, </span>
<span id="cb28-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alternative =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb28-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stDev =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb28-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">normalApproximation =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb28-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb28-13">)</span>
<span id="cb28-14"></span>
<span id="cb28-15">powerMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">powerMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-13-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">powerMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-13-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">powerMeans1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-13-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-means-for-a-two-sided-design" class="level3">
<h3 class="anchored" data-anchor-id="power-means-for-a-two-sided-design">Power means for a two-sided design</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">powerMeans2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb32-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb32-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerMeans</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>)</span>
<span id="cb32-6"></span>
<span id="cb32-7">powerMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-14-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1">powerMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-14-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">powerMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-14-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1">powerMeans2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-14-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="power-rates-binary-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="power-rates-binary-endpoint">Power rates (binary endpoint)</h2>
<section id="power-rates-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="power-rates-for-a-one-sided-design-with-futility-bounds">Power rates for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1">powerRates1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb36-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb36-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb36-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb36-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb36-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(</span>
<span id="cb36-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">groups =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb36-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">riskRatio =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb36-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb36-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb36-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>), </span>
<span id="cb36-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>,</span>
<span id="cb36-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span></span>
<span id="cb36-14">)</span>
<span id="cb36-15"></span>
<span id="cb36-16">powerRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-15-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1">powerRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-15-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1">powerRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-15-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">powerRates1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-15-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-rates-for-a-two-sided-design" class="level3">
<h3 class="anchored" data-anchor-id="power-rates-for-a-two-sided-design">Power rates for a two-sided design</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1">powerRates2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb40-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb40-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb40-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerRates</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>)</span>
<span id="cb40-6"></span>
<span id="cb40-7">powerRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-16-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">powerRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-16-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1">powerRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-16-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb43-1">powerRates2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-16-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="power-survival-survival-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="power-survival-survival-endpoint">Power survival (survival endpoint)</h2>
<section id="power-survival-for-a-one-sided-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="power-survival-for-a-one-sided-design-with-futility-bounds">Power survival for a one-sided design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1">powerSurvival <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb44-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb44-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb44-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb44-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb44-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>, </span>
<span id="cb44-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb44-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb44-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb44-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2480</span>,</span>
<span id="cb44-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span></span>
<span id="cb44-13">)</span>
<span id="cb44-14"></span>
<span id="cb44-15">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1">powerSurvival <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-17-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-for-a-piecewise-exponential-survival-distribution" class="level3">
<h3 class="anchored" data-anchor-id="power-for-a-piecewise-exponential-survival-distribution">Power for a piecewise exponential survival distribution</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb50-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;5"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb50-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5 - &lt;10"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb50-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 10"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.008</span></span>
<span id="cb50-5">)</span>
<span id="cb50-6"></span>
<span id="cb50-7">powerSurvival1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb50-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, </span>
<span id="cb50-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>,</span>
<span id="cb50-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb50-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">twoSidedPower =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb50-12">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb50-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>, </span>
<span id="cb50-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb50-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb50-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb50-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb50-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2480</span>, </span>
<span id="cb50-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>,</span>
<span id="cb50-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb50-22">)</span>
<span id="cb50-23"></span>
<span id="cb50-24">powerSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-18-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb51-1">powerSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-18-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1">powerSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-18-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb53-1">powerSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-18-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1">powerSurvival1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-18-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-for-a-piecewise-exponential-survival-distribution-and-a-design-with-futility-bounds" class="level3">
<h3 class="anchored" data-anchor-id="power-for-a-piecewise-exponential-survival-distribution-and-a-design-with-futility-bounds">Power for a piecewise exponential survival distribution and a design with futility bounds</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb55-1">piecewiseSurvivalTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb55-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,</span>
<span id="cb55-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;9"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb55-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9 - &lt;15"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>,</span>
<span id="cb55-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15 - &lt;21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb55-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;= 21"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span></span>
<span id="cb55-7">)</span>
<span id="cb55-8"></span>
<span id="cb55-9">powerSurvival2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb55-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb55-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb55-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb55-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb55-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>, </span>
<span id="cb55-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb55-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb55-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb55-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> piecewiseSurvivalTime,</span>
<span id="cb55-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2480</span>, </span>
<span id="cb55-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>,</span>
<span id="cb55-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span></span>
<span id="cb55-22">)</span>
<span id="cb55-23"></span>
<span id="cb55-24">powerSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-19-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb56-1">powerSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-19-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb57-1">powerSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-19-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb58-1">powerSurvival2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-19-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb59" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb59-1">powerSurvival3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignGroupSequential</span>(</span>
<span id="cb59-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfDesign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"OF"</span>, </span>
<span id="cb59-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sided =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb59-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">futilityBounds =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb59-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb59-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">typeOfComputation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Schoenfeld"</span>, </span>
<span id="cb59-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">thetaH0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb59-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">allocationRatioPlanned =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, </span>
<span id="cb59-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kappa =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb59-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">piecewiseSurvivalTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>),</span>
<span id="cb59-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>),</span>
<span id="cb59-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda1 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.032</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.012</span>),</span>
<span id="cb59-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2480</span>, </span>
<span id="cb59-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span></span>
<span id="cb59-15">)</span>
<span id="cb59-16"></span>
<span id="cb59-17">powerSurvival3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-20-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1">powerSurvival3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-20-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb61" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb61-1">powerSurvival3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-20-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb62-1">powerSurvival3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-20-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-survival-for-one-lambda" class="level3">
<h3 class="anchored" data-anchor-id="power-survival-for-one-lambda">Power survival for one lambda</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb63" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb63-1">powerSurvival4 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb63-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb63-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.04</span>,</span>
<span id="cb63-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb63-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>,</span>
<span id="cb63-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span></span>
<span id="cb63-7">)</span>
<span id="cb63-8"></span>
<span id="cb63-9">powerSurvival4 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1">powerSurvival4 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-21-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="power-survival-for-default-pi1-and-pi2" class="level3">
<h3 class="anchored" data-anchor-id="power-survival-for-default-pi1-and-pi2">Power survival for default pi1 and pi2</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb65" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb65-1">powerSurvival5 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getPowerSurvival</span>(</span>
<span id="cb65-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>,</span>
<span id="cb65-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span></span>
<span id="cb65-4">)</span>
<span id="cb65-5"></span>
<span id="cb65-6">powerSurvival5 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-22-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb66" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb66-1">powerSurvival5 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legendPosition =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-22-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
</section>
<section id="simulation-plots" class="level1">
<h1>Simulation plots</h1>
<section id="simulation-means-continuous-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="simulation-means-continuous-endpoint">Simulation means (continuous endpoint)</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb67" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb67-1">simulationResults1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationMeans</span>(</span>
<span id="cb67-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb67-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>), </span>
<span id="cb67-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb67-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb67-6">)</span>
<span id="cb67-7"></span>
<span id="cb67-8">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb68" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb68-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb69" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb69-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb70" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb70-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-23-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-rates-binary-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="simulation-rates-binary-endpoint">Simulation rates (binary endpoint)</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb71" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb71-1">simulationResults1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationRates</span>(</span>
<span id="cb71-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">design =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDesignFisher</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">kMax =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb71-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedSubjects =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb71-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb71-5">)</span>
<span id="cb71-6"></span>
<span id="cb71-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(simulationResults1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-24-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb72" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb72-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(simulationResults1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-24-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb73" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb73-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(simulationResults1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-24-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="simulation-plots-survival-survival-endpoint" class="level2">
<h2 class="anchored" data-anchor-id="simulation-plots-survival-survival-endpoint">Simulation plots survival (survival endpoint)</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb74" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb74-1">simulationResults1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb74-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb74-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1405</span>,</span>
<span id="cb74-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, </span>
<span id="cb74-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb74-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span></span>
<span id="cb74-7">)</span>
<span id="cb74-8"></span>
<span id="cb74-9">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb75" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb75-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb76" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb76-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-3.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb77" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb77-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-4.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb78" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb78-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-5.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb79" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb79-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-6.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb80" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb80-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-7.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb81" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb81-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-8.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb82" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb82-1">simulationResults1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-25-9.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb83" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb83-1">simulationResults2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSimulationSurvival</span>(</span>
<span id="cb83-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>,</span>
<span id="cb83-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>,</span>
<span id="cb83-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>,</span>
<span id="cb83-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1405</span>,</span>
<span id="cb83-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plannedEvents =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, </span>
<span id="cb83-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfIterations =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb83-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23456</span></span>
<span id="cb83-9">)</span>
<span id="cb83-10"></span>
<span id="cb83-11">simulationResults2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-26-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb84" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb84-1">simulationResults2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.rpact.org/vignettes/utilities/rpact_plot_examples/index_files/figure-html/unnamed-chunk-26-2.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <category>Sample size</category>
  <category>Power simulation</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_plot_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_18.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Defining Accrual Time and Accrual Intensity with rpact</title>
  <dc:creator>[[](#)]{.author-row} [[Friedrich Pahlke](https://www.linkedin.com/in/pahlke &quot;Visit Friedrich Pahlke&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0003-2105-2582 &quot;Visit Friedrich Pahlke&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row} [[Gernot Wassmer](https://www.linkedin.com/in/gernot-wassmer-10321561 &quot;Visit Gernot Wassmer&#39;s LinkedIn Profile&quot;){.author-linkedin} [&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;16&quot; width=&quot;16&quot; viewBox=&quot;0 0 512 512&quot;&gt;&lt;path fill=&quot;#a6ce39&quot; d=&quot;M294.8 188.2h-45.9V342h47.5c67.6 0 83.1-51.3 83.1-76.9 0-41.6-26.5-76.9-84.7-76.9zM256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-80.8 360.8h-29.8v-207.5h29.8zm-14.9-231.1a19.6 19.6 0 1 1 19.6-19.6 19.6 19.6 0 0 1 -19.6 19.6zM300 369h-81V161.3h80.6c76.7 0 110.4 54.8 110.4 103.9C410 318.4 368.4 369 300 369z&quot;/&gt;&lt;/svg&gt;](https://orcid.org/0000-0001-9397-1794 &quot;Visit Gernot Wassmer&#39;s ORCID Profile&quot;){.author-orcid}]{.author-row}</dc:creator>
  <link>https://www.rpact.org/vignettes/utilities/rpact_accrual_time_examples/</link>
  <description><![CDATA[ 




<!--
Author: see above
File version: $Revision: 6853 $
Last changed: $Date: 2023-03-08 08:06:59 +0100 (Mi, 08 Mrz 2023) $
Last changed by: $Author: pahlke $
License: This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
-->
<section id="load-the-rpact-package" class="level1 unnumbered">
<h1 class="unnumbered">Load the rpact package</h1>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(rpact)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">packageVersion</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rpact"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># version should be version 3.0 or later</span></span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>[1] '4.5.0.9315'</code></pre>
</div>
</div>
</section>
<section id="case-1" class="level1">
<h1>Case 1</h1>
<p>End of accrual, absolute accrual intensity and <code>maxNumberOfSubjects</code> are given, <code>followUpTime</code> shall be calculated. From 0 time units (which is always the start of accrual) to 6 time units, 22 subjects are recruited per time unit and from 6 to 30 time units, 33 subjects are recruited per time unit, yielding 924 total subjects.</p>
<section id="example-vector-based-definition" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb3-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>),</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>), </span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">924</span></span>
<span id="cb3-5">)</span>
<span id="cb3-6">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 22</li>
<li><em>6 - &lt;=30</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 924 = 6 * 22 + 24 * 33</li>
</ul>
<p><strong>Case (#1)</strong></p>
<ul>
<li>End of accrual, absolute accrual intensity and ‘maxNumberOfSubjects’ are given, ‘followUpTime’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(22, 33), maxNumberOfSubjects = 924)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 924</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb4-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb4-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>,</span>
<span id="cb4-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;= 30"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span></span>
<span id="cb4-5">    ),</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">924</span></span>
<span id="cb4-7">)</span>
<span id="cb4-8">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 22</li>
<li><em>6 - &lt;=30</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 924 = 6 * 22 + 24 * 33</li>
</ul>
<p><strong>Case (#1)</strong></p>
<ul>
<li>End of accrual, absolute accrual intensity and ‘maxNumberOfSubjects’ are given, ‘followUpTime’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(22, 33), maxNumberOfSubjects = 924)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 924</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb5-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, </span>
<span id="cb5-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, </span>
<span id="cb5-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb5-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.230</li>
<li><em>Assumed control rate</em>: 0.300</li>
<li><em>Accrual time</em>: 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 924</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0218</li>
<li><em>lambda(2)</em>: 0.0297</li>
<li><em>median(1)</em>: 31.8</li>
<li><em>median(2)</em>: 23.3</li>
<li><em>Hazard ratio</em>: 0.733</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Follow up time</em>: 3.66</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Number of events</em>: 324.8</li>
<li><em>Analysis time</em>: 33.66</li>
<li><em>Study duration</em>: 33.66</li>
<li><em>Critical values (treatment effect scale)</em>: 0.805</li>
<li><em>Number of events fixed</em>: 324.8</li>
<li><em>Number of subjects fixed</em>: 924</li>
<li><em>Number of subjects fixed (1)</em>: 462</li>
<li><em>Number of subjects fixed (2)</em>: 462</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-2" class="level1">
<h1>Case 2</h1>
<p>End of accrual, relative accrual intensity and <code>maxNumberOfSubjects</code> are given, <em>absolute accrual intensity</em> and <code>followUpTime</code> shall be calculated. The use of relative accrual intensities is indicated by all entries of the vector <code>accrualIntensity</code> being smaller than 1. In this example, the accrual intensity from 6 to 30 time units should be 50% greater than the intensity from 0 to 6 time units given a maximum number of subjects of 1000.</p>
<section id="example-vector-based-definition-1" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-1">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb6-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>),</span>
<span id="cb6-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>), </span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb6-5">)</span>
<span id="cb6-6">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 23.80952</li>
<li><em>6 - &lt;=30</em>: 35.71429</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 1000 = 6 * 23.8095 + 24 * 35.7143</li>
</ul>
<p><strong>Case (#2)</strong></p>
<ul>
<li>End of accrual, relative accrual intensity and ‘maxNumberOfSubjects’ are given, absolute accrual intensity* and ‘followUpTime’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(0.22, 0.33), maxNumberOfSubjects = 1000)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity (relative)</em>: 0.22, 0.33</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Accrual intensity</em>: 23.8, 35.7</li>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
<li><em>Remaining time</em>: 24.00</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-1" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-1">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb7-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb7-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>,</span>
<span id="cb7-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;= 30"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span></span>
<span id="cb7-5">    ),</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb7-7">)</span>
<span id="cb7-8">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 23.80952</li>
<li><em>6 - &lt;=30</em>: 35.71429</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 1000 = 6 * 23.8095 + 24 * 35.7143</li>
</ul>
<p><strong>Case (#2)</strong></p>
<ul>
<li>End of accrual, relative accrual intensity and ‘maxNumberOfSubjects’ are given, absolute accrual intensity* and ‘followUpTime’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(0.22, 0.33), maxNumberOfSubjects = 1000)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity (relative)</em>: 0.22, 0.33</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Accrual intensity</em>: 23.8, 35.7</li>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
<li><em>Remaining time</em>: 24.00</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-1" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-1">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb8-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, </span>
<span id="cb8-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, </span>
<span id="cb8-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb8-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.230</li>
<li><em>Assumed control rate</em>: 0.300</li>
<li><em>Accrual time</em>: 6.00, 30.00</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0218</li>
<li><em>lambda(2)</em>: 0.0297</li>
<li><em>median(1)</em>: 31.8</li>
<li><em>median(2)</em>: 23.3</li>
<li><em>Hazard ratio</em>: 0.733</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual intensity</em>: 23.8, 35.7</li>
<li><em>Follow up time</em>: 2.07</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Number of events</em>: 324.8</li>
<li><em>Analysis time</em>: 32.07</li>
<li><em>Study duration</em>: 32.07</li>
<li><em>Critical values (treatment effect scale)</em>: 0.805</li>
<li><em>Number of events fixed</em>: 324.8</li>
<li><em>Number of subjects fixed</em>: 1000</li>
<li><em>Number of subjects fixed (1)</em>: 500</li>
<li><em>Number of subjects fixed (2)</em>: 500</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-3" class="level1">
<h1>Case 3</h1>
<p>End of accrual and absolute accrual intensity are given, <code>maxNumberOfSubjects</code> and <code>followUpTime</code> shall be calculated. From 0 to 6 time units, 22 subjects are to be recruited per time unit and from 6 to 30 time units, 33 subjects are to be recruited per time unit.</p>
<section id="example-vector-based-definition-2" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-2">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb9-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>), </span>
<span id="cb9-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>)</span>
<span id="cb9-4">)</span></code></pre></div></div>
</div>
</section>
<section id="example-list-based-definition-2" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-2">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb10-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>,</span>
<span id="cb10-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;= 30"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span></span>
<span id="cb10-4">))</span>
<span id="cb10-5">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 22</li>
<li><em>6 - &lt;=30</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 924 = 6 * 22 + 24 * 33</li>
</ul>
<p><strong>Case (#3)</strong></p>
<ul>
<li>End of accrual and absolute accrual intensity are given, ‘maxNumberOfSubjects’* and ‘followUpTime’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(22, 33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Maximum number of subjects</em>: 924</li>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
<li><em>Remaining time</em>: 24.00</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-2" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-2">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb11-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, </span>
<span id="cb11-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, </span>
<span id="cb11-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb11-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.230</li>
<li><em>Assumed control rate</em>: 0.300</li>
<li><em>Accrual time</em>: 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0218</li>
<li><em>lambda(2)</em>: 0.0297</li>
<li><em>median(1)</em>: 31.8</li>
<li><em>median(2)</em>: 23.3</li>
<li><em>Hazard ratio</em>: 0.733</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Follow up time</em>: 3.66</li>
<li><em>Maximum number of subjects</em>: 924</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Number of events</em>: 324.8</li>
<li><em>Analysis time</em>: 33.66</li>
<li><em>Study duration</em>: 33.66</li>
<li><em>Critical values (treatment effect scale)</em>: 0.805</li>
<li><em>Number of events fixed</em>: 324.8</li>
<li><em>Number of subjects fixed</em>: 924</li>
<li><em>Number of subjects fixed (1)</em>: 462</li>
<li><em>Number of subjects fixed (2)</em>: 462</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-4" class="level1">
<h1>Case 4</h1>
<p>End of accrual, relative accrual intensity and <code>followUpTime</code> are given, absolute accrual intensity and <code>maxNumberOfSubjects</code> shall be calculated. As for case 2, the accrual intensity from 6 to 30 time units shall be 50% greater than the accrual intensity from time units 0 to 6, but now, no maximum number of subjects is provided. Note that <code>followUpTime</code> is not provided to the accrual time object, but is specified when calling <code>getSampleSizeSurvival()</code>.</p>
<section id="example-vector-based-definition-3" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-3">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb12-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>), </span>
<span id="cb12-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>)</span>
<span id="cb12-4">)</span>
<span id="cb12-5">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 0.22</li>
<li><em>6 - &lt;=30</em>: 0.33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 0.22 * c + 24 * 0.33 * c , where ‘c’ is a constant factor</li>
</ul>
<p><strong>Case (#4)</strong></p>
<ul>
<li>End of accrual, relative accrual intensity and ‘followUpTime’ are given, absolute accrual intensity** and ‘maxNumberOfSubjects’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(0.22, 0.33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 0.22, 0.33</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-3" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-3">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb13-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>,</span>
<span id="cb13-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6 - &lt;= 30"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span></span>
<span id="cb13-4">))</span>
<span id="cb13-5">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt; 6</em>: 0.22</li>
<li><em>6 - &lt;=30</em>: 0.33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 0.22 * c + 24 * 0.33 * c , where ‘c’ is a constant factor</li>
</ul>
<p><strong>Case (#4)</strong></p>
<ul>
<li>End of accrual, relative accrual intensity and ‘followUpTime’ are given, absolute accrual intensity** and ‘maxNumberOfSubjects’** shall be calculated.</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6, 30), accrualIntensity = c(0.22, 0.33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 30.00</li>
<li><em>Accrual intensity</em>: 0.22, 0.33</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: TRUE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-3" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-3">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb14-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, </span>
<span id="cb14-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, </span>
<span id="cb14-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, </span>
<span id="cb14-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb14-6">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.230</li>
<li><em>Assumed control rate</em>: 0.300</li>
<li><em>Accrual time</em>: 6.00, 30.00</li>
<li><em>Accrual intensity (relative)</em>: 0.22, 0.33</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Follow up time</em>: 6.00</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0218</li>
<li><em>lambda(2)</em>: 0.0297</li>
<li><em>median(1)</em>: 31.8</li>
<li><em>median(2)</em>: 23.3</li>
<li><em>Hazard ratio</em>: 0.733</li>
<li><em>Direction upper</em>: FALSE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Accrual intensity</em>: 19.9, 29.8</li>
<li><em>Number of events</em>: 324.8</li>
<li><em>Analysis time</em>: 36.00</li>
<li><em>Study duration</em>: 36.00</li>
<li><em>Critical values (treatment effect scale)</em>: 0.805</li>
<li><em>Number of events fixed</em>: 324.8</li>
<li><em>Number of subjects fixed</em>: 834.7</li>
<li><em>Number of subjects fixed (1)</em>: 417.4</li>
<li><em>Number of subjects fixed (2)</em>: 417.4</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-5" class="level1">
<h1>Case 5</h1>
<p><code>maxNumberOfSubjects</code> and absolute accrual intensity are given, end of accrual and <code>followUpTime</code> shall be calculated. The calculation of the end of accrual is performed whenever the vectors <code>accrualTime</code> and (absolute) <code>accrualIntensity</code> are of the same length, i.e., the end point of the final accrual interval is not specified. The end of accrual is calculated such that <code>maxNumberOfSubjects</code> is achieved.</p>
<section id="example-vector-based-definition-4" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-4">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb15-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb15-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>), </span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb15-5">)</span>
<span id="cb15-6">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0.00000 - &lt; 6.00000</em>: 22</li>
<li><em>6.00000 - &lt;=32.30303</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 1000 = 6 * 22 + 26.303 * 33</li>
</ul>
<p><strong>Case (#5)</strong></p>
<ul>
<li>‘maxNumberOfSubjects’ and absolute accrual intensity are given, end of accrual* and ‘followUpTime’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(22, 33), maxNumberOfSubjects = 1000)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 32.30</li>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
<li><em>Remaining time</em>: 26.30</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-4" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-4">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb16-2">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb16-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>,</span>
<span id="cb16-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span></span>
<span id="cb16-5">    ),</span>
<span id="cb16-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb16-7">)</span>
<span id="cb16-8">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0.00000 - &lt; 6.00000</em>: 22</li>
<li><em>6.00000 - &lt;=32.30303</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 1000 = 6 * 22 + 26.303 * 33</li>
</ul>
<p><strong>Case (#5)</strong></p>
<ul>
<li>‘maxNumberOfSubjects’ and absolute accrual intensity are given, end of accrual* and ‘followUpTime’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(22, 33), maxNumberOfSubjects = 1000)</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00, 32.30</li>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
<li><em>Remaining time</em>: 26.30</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-4" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-4">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb17-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, </span>
<span id="cb17-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, </span>
<span id="cb17-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb17-5">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.230</li>
<li><em>Assumed control rate</em>: 0.300</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0218</li>
<li><em>lambda(2)</em>: 0.0297</li>
<li><em>median(1)</em>: 31.8</li>
<li><em>median(2)</em>: 23.3</li>
<li><em>Hazard ratio</em>: 0.733</li>
<li><em>Direction upper</em>: FALSE</li>
<li><em>Accrual time</em>: 6.00, 32.30</li>
<li><em>Follow up time</em>: 1.08</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Number of events</em>: 324.8</li>
<li><em>Analysis time</em>: 33.38</li>
<li><em>Study duration</em>: 33.38</li>
<li><em>Critical values (treatment effect scale)</em>: 0.805</li>
<li><em>Number of events fixed</em>: 324.8</li>
<li><em>Number of subjects fixed</em>: 1000</li>
<li><em>Number of subjects fixed (1)</em>: 500</li>
<li><em>Number of subjects fixed (2)</em>: 500</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-6-not-possible" class="level1">
<h1>Case 6 (not possible)</h1>
<p><code>maxNumberOfSubjects</code> and relative accrual intensity are given, absolute accrual intensity[x], end of accrual and <code>followUpTime</code> shall be calculated.</p>
<section id="example-vector-based-definition-5" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-5">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb18-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb18-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>),</span>
<span id="cb18-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">maxNumberOfSubjects =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb18-5">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: The specified accrual time and intensity cannot be supplemented
automatically with the missing information; therefore further calculations are
not possible</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 0.22</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 1000 = 6 * 0.22 * c + (x - 6) * 0.33 * c , where ‘x’ is the unknown last accrual time and ‘c’ a constant factor</li>
</ul>
<p><strong>Case (#6)</strong></p>
<ul>
<li>‘maxNumberOfSubjects’ and relative accrual intensity are given, absolute accrual intensity@, end of accrual* and ‘followUpTime’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(0.22, 0.33), maxNumberOfSubjects = 1000)</li>
<li><ol class="example" type="1">
<li>Cannot be calculated.</li>
</ol></li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 0.22, 0.33</li>
<li><em>Maximum number of subjects</em>: 1000</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: FALSE</li>
<li><em>Max number of subjects is user defined</em>: TRUE</li>
<li><em>Max number of subjects can be calculated directly</em>: TRUE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-5" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-5">Example: list-based definition</h2>
<pre class="{r'}"><code>accrualTime &lt;- getAccrualTime(
    list(
        "0 - &lt;6" = 0.22,
        "6" = 0.33
    ),
    maxNumberOfSubjects = 1000
)
accrualTime</code></pre>
</section>
<section id="example-how-to-use-accrual-time-object-5" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-5">Example: how to use accrual time object</h2>
<p>Case 6 is not allowed and therefore an error will be shown:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb22-2">    {</span>
<span id="cb22-3">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb22-4">    },</span>
<span id="cb22-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(e) {</span>
<span id="cb22-6">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>message)</span>
<span id="cb22-7">    }</span>
<span id="cb22-8">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Illegal argument: the calculation of 'followUpTime' for given 'maxNumberOfSubjects' and relative accrual intensities (&lt; 1) can only be done if end of accrual is defined"</code></pre>
</div>
</div>
</section>
</section>
<section id="case-7" class="level1">
<h1>Case 7</h1>
<p><code>followUpTime</code> and absolute accrual intensity are given,<br>
end of accrual and <code>maxNumberOfSubjects</code> shall be calculated. From 0 to 6 time units, 22 subjects are to be recruited per time unit and afterwards, 33 subjects are to be recruited per time unit.</p>
<section id="example-vector-based-definition-6" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-6">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb24-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), </span>
<span id="cb24-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span>)</span>
<span id="cb24-4">)</span>
<span id="cb24-5">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 22</li>
<li><em>6 - &lt;=[?]</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 22 + (x - 6) * 33, where ‘x’ is the unknown last accrual time</li>
</ul>
<p><strong>Case (#7)</strong></p>
<ul>
<li>‘followUpTime’ and absolute accrual intensity are given, end of accrual** and ‘maxNumberOfSubjects’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(22, 33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: TRUE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-6" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-6">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb25-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>,</span>
<span id="cb25-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">33</span></span>
<span id="cb25-4">))</span>
<span id="cb25-5">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 22</li>
<li><em>6 - &lt;=[?]</em>: 33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 22 + (x - 6) * 33, where ‘x’ is the unknown last accrual time</li>
</ul>
<p><strong>Case (#7)</strong></p>
<ul>
<li>‘followUpTime’ and absolute accrual intensity are given, end of accrual** and ‘maxNumberOfSubjects’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(22, 33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: TRUE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-6" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-6">Example: how to use accrual time object</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb26-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime,</span>
<span id="cb26-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, </span>
<span id="cb26-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, </span>
<span id="cb26-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb26-6">)</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Assumed treatment rate</em>: 0.400</li>
<li><em>Hazard ratio</em>: 2.289</li>
<li><em>Accrual intensity</em>: 22.0, 33.0</li>
<li><em>Follow up time</em>: 6.00</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Assumed control rate</em>: 0.200</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>Event time</em>: 12</li>
<li><em>kappa</em>: 1</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.0426</li>
<li><em>lambda(2)</em>: 0.0186</li>
<li><em>median(1)</em>: 16.3</li>
<li><em>median(2)</em>: 37.3</li>
<li><em>Direction upper</em>: TRUE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Accrual time</em>: 6.00, 7.64</li>
<li><em>Number of events</em>: 45.8</li>
<li><em>Maximum number of subjects</em>: 186.1</li>
<li><em>Analysis time</em>: 13.64</li>
<li><em>Study duration</em>: 13.64</li>
<li><em>Critical values (treatment effect scale)</em>: 1.785</li>
<li><em>Number of events fixed</em>: 45.8</li>
<li><em>Number of subjects fixed</em>: 186.1</li>
<li><em>Number of subjects fixed (1)</em>: 93</li>
<li><em>Number of subjects fixed (2)</em>: 93</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
</div>
</section>
</section>
<section id="case-8-not-possible" class="level1">
<h1>Case 8 (not possible)</h1>
<p><code>followUpTime</code> and relative accrual intensity are given,<br>
absolute accrual intensity[x], end of accrual and <code>maxNumberOfSubjects</code> shall be calculated.</p>
<section id="example-vector-based-definition-7" class="level2">
<h2 class="anchored" data-anchor-id="example-vector-based-definition-7">Example: vector-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(</span>
<span id="cb27-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), </span>
<span id="cb27-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>)</span>
<span id="cb27-4">)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: The specified accrual time and intensity cannot be supplemented
automatically with the missing information; therefore further calculations are
not possible</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 0.22</li>
<li><em>6 - &lt;=[?]</em>: 0.33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 0.22 * c + (x - 6) * 0.33 * c , where ‘x’ is the unknown last accrual time and ‘c’ a constant factor</li>
</ul>
<p><strong>Case (#8)</strong></p>
<ul>
<li>‘followUpTime’ and relative accrual intensity are given, absolute accrual intensity@, end of accrual and ‘maxNumberOfSubjects’ shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(0.22, 0.33))</li>
<li><ol start="2" class="example" type="1">
<li>Cannot be calculated.</li>
</ol></li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 0.22, 0.33</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: TRUE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
</ul>
</div>
</div>
</section>
<section id="example-list-based-definition-7" class="level2">
<h2 class="anchored" data-anchor-id="example-list-based-definition-7">Example: list-based definition</h2>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb30-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 - &lt;6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>,</span>
<span id="cb30-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span></span>
<span id="cb30-4">))</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: The specified accrual time and intensity cannot be supplemented
automatically with the missing information; therefore further calculations are
not possible</code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 0.22</li>
<li><em>6 - &lt;=[?]</em>: 0.33</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 0.22 * c + (x - 6) * 0.33 * c , where ‘x’ is the unknown last accrual time and ‘c’ a constant factor</li>
</ul>
<p><strong>Case (#8)</strong></p>
<ul>
<li>‘followUpTime’ and relative accrual intensity are given, absolute accrual intensity@, end of accrual and ‘maxNumberOfSubjects’ shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(0.22, 0.33))</li>
<li><ol start="3" class="example" type="1">
<li>Cannot be calculated.</li>
</ol></li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 0.22, 0.33</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: TRUE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: FALSE</li>
</ul>
</div>
</div>
</section>
<section id="example-how-to-use-accrual-time-object-7" class="level2">
<h2 class="anchored" data-anchor-id="example-how-to-use-accrual-time-object-7">Example: how to use accrual time object</h2>
<p>Case 8 is not allowed and therefore an error will be shown:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb33-2">    {</span>
<span id="cb33-3">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> accrualTime, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi1 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pi2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb33-4">    },</span>
<span id="cb33-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(e) {</span>
<span id="cb33-6">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>message)</span>
<span id="cb33-7">    }</span>
<span id="cb33-8">)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "Illegal argument: the calculation of 'maxNumberOfSubjects' for given 'followUpTime' and relative accrual intensities (&lt; 1) can only be done if end of accrual is defined"</code></pre>
</div>
</div>
</section>
</section>
<section id="how-to-show-accrual-time-details" class="level1">
<h1>How to show accrual time details</h1>
<p>You can use a sample size or power object as argument for function <code>getAccrualTime</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1">sampleSize <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getSampleSizeSurvival</span>(</span>
<span id="cb35-2">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualTime =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>), </span>
<span id="cb35-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accrualIntensity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">53</span>),</span>
<span id="cb35-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lambda2 =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, </span>
<span id="cb35-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hazardRatio =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, </span>
<span id="cb35-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">followUpTime =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb35-7">)</span>
<span id="cb35-8">sampleSize</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Design plan parameters and output for survival data</strong></p>
<p><strong>Design parameters</strong></p>
<ul>
<li><em>Critical values</em>: 1.960</li>
<li><em>Significance level</em>: 0.0250</li>
<li><em>Type II error rate</em>: 0.2000</li>
<li><em>Test</em>: one-sided</li>
</ul>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>lambda(2)</em>: 0.050</li>
<li><em>Hazard ratio</em>: 0.800</li>
<li><em>Accrual intensity</em>: 22.0, 53.0</li>
<li><em>Follow up time</em>: 6.00</li>
</ul>
<p><strong>Default parameters</strong></p>
<ul>
<li><em>Type of computation</em>: Schoenfeld</li>
<li><em>Theta H0</em>: 1</li>
<li><em>Planned allocation ratio</em>: 1</li>
<li><em>kappa</em>: 1</li>
<li><em>Piecewise survival times</em>: 0.00</li>
<li><em>Drop-out rate (1)</em>: 0.000</li>
<li><em>Drop-out rate (2)</em>: 0.000</li>
<li><em>Drop-out time</em>: 12.00</li>
</ul>
<p><strong>Derived parameters</strong></p>
<ul>
<li><em>lambda(1)</em>: 0.040</li>
<li><em>median(1)</em>: 17.3</li>
<li><em>median(2)</em>: 13.9</li>
<li><em>Direction upper</em>: FALSE</li>
</ul>
<p><strong>Sample size and output</strong></p>
<ul>
<li><em>Accrual time</em>: 6.00, 26.26</li>
<li><em>Number of events</em>: 630.5</li>
<li><em>Maximum number of subjects</em>: 1205.9</li>
<li><em>Analysis time</em>: 32.26</li>
<li><em>Study duration</em>: 32.26</li>
<li><em>Critical values (treatment effect scale)</em>: 0.855</li>
<li><em>Number of events fixed</em>: 630.5</li>
<li><em>Number of subjects fixed</em>: 1205.9</li>
<li><em>Number of subjects fixed (1)</em>: 602.9</li>
<li><em>Number of subjects fixed (2)</em>: 602.9</li>
</ul>
<p><strong>Legend</strong></p>
<ul>
<li><em>(i)</em>: values of treatment arm i</li>
</ul>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1">accrualTime <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getAccrualTime</span>(sampleSize)</span>
<span id="cb36-2">accrualTime</span></code></pre></div></div>
<div class="cell-output-display">
<p><strong>Accrual time and intensity</strong></p>
<ul>
<li><em>0 - &lt;=6</em>: 22</li>
<li><em>6 - &lt;=[?]</em>: 53</li>
</ul>
<p><strong>Formula</strong></p>
<ul>
<li>maxNumberOfSubjects = 6 * 22 + (x - 6) * 53, where ‘x’ is the unknown last accrual time</li>
</ul>
<p><strong>Case (#7)</strong></p>
<ul>
<li>‘followUpTime’ and absolute accrual intensity are given, end of accrual** and ‘maxNumberOfSubjects’** shall be calculated</li>
<li><em>Example</em>: getAccrualTime(accrualTime = c(0, 6), accrualIntensity = c(22, 33))</li>
<li>(*) Can be calculated directly.</li>
<li>(**) Cannot be calculated directly but with ‘getSampleSizeSurvival()’ or ‘getPowerSurvival()’.</li>
</ul>
<p><strong>Details</strong></p>
<p><strong>User defined parameters</strong></p>
<ul>
<li><em>Accrual time</em>: 0.00, 6.00</li>
<li><em>Accrual intensity</em>: 22.0, 53.0</li>
</ul>
<p><strong>Generated parameters</strong></p>
<ul>
<li><em>End of accrual is user defined</em>: FALSE</li>
<li><em>Follow-up time must be user defined</em>: TRUE</li>
<li><em>Max number of subjects is user defined</em>: FALSE</li>
<li><em>Max number of subjects can be calculated directly</em>: FALSE</li>
<li><em>Absolute accrual intensity is enabled</em>: TRUE</li>
</ul>
</div>
</div>
<hr>
<p>System: rpact 4.5.0.9315, R version 4.6.1 (2026-06-24), platform: x86_64-pc-linux-gnu</p>
<p>To cite R in publications use:</p>
<p>R Core Team (2026). <em>R: A Language and Environment for Statistical Computing</em>. R Foundation for Statistical Computing, Vienna, Austria. doi:10.32614/R.manuals <a href="https://doi.org/10.32614/R.manuals" class="uri">https://doi.org/10.32614/R.manuals</a>. <a href="https://www.R-project.org/" class="uri">https://www.R-project.org/</a>.</p>
<p>To cite package ‘rpact’ in publications use:</p>
<p>Wassmer G, Pahlke F (2026). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 4.5.0.9315. doi:10.32614/CRAN.package.rpact</p>
<p>Wassmer G, Brannath W (2025). <em>Group Sequential and Confirmatory Adaptive Designs in Clinical Trials</em>, 2nd edition. Springer, Cham, Switzerland. ISBN 978-3-031-89668-2. doi:10.1007/978-3-031-89669-9 <a href="https://doi.org/10.1007/978-3-031-89669-9" class="uri">https://doi.org/10.1007/978-3-031-89669-9</a>.</p>


</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">Reuse</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></div></div></section></div> ]]></description>
  <category>Utilities</category>
  <category>Survival</category>
  <guid>https://www.rpact.org/vignettes/utilities/rpact_accrual_time_examples/</guid>
  <pubDate>Mon, 24 Aug 2026 06:43:46 GMT</pubDate>
  <media:content url="https://www.rpact.org/photos/by_friedrich_pahlke_01.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
