Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion man/outstandR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 61 additions & 61 deletions scripts/exercises2.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
<pre><code>
SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.000114 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.14 seconds.
Chain 1: Gradient evaluation took 5.3e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.53 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Expand All @@ -327,15 +327,15 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 1: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.287 seconds (Warm-up)
Chain 1: 0.293 seconds (Sampling)
Chain 1: 0.58 seconds (Total)
Chain 1: Elapsed Time: 0.223 seconds (Warm-up)
Chain 1: 0.208 seconds (Sampling)
Chain 1: 0.431 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 2.1e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds.
Chain 2: Gradient evaluation took 1.8e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.18 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -346,9 +346,9 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 2: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.261 seconds (Warm-up)
Chain 2: 0.246 seconds (Sampling)
Chain 2: 0.507 seconds (Total)
Chain 2: Elapsed Time: 0.216 seconds (Warm-up)
Chain 2: 0.204 seconds (Sampling)
Chain 2: 0.42 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand All @@ -369,8 +369,8 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
<pre><code>
SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 2.6e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.26 seconds.
Chain 1: Gradient evaluation took 2.4e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.24 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Expand All @@ -387,15 +387,15 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.281 seconds (Warm-up)
Chain 1: 0.253 seconds (Sampling)
Chain 1: 0.534 seconds (Total)
Chain 1: Elapsed Time: 0.229 seconds (Warm-up)
Chain 1: 0.21 seconds (Sampling)
Chain 1: 0.439 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 2e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.2 seconds.
Chain 2: Gradient evaluation took 1.6e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.16 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -412,9 +412,9 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.261 seconds (Warm-up)
Chain 2: 0.258 seconds (Sampling)
Chain 2: 0.519 seconds (Total)
Chain 2: Elapsed Time: 0.211 seconds (Warm-up)
Chain 2: 0.216 seconds (Sampling)
Chain 2: 0.427 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand Down Expand Up @@ -570,8 +570,8 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
<pre><code>
SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 2.8e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.28 seconds.
Chain 1: Gradient evaluation took 2.5e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.25 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Expand All @@ -582,15 +582,15 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 1: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.269 seconds (Warm-up)
Chain 1: 0.252 seconds (Sampling)
Chain 1: 0.521 seconds (Total)
Chain 1: Elapsed Time: 0.225 seconds (Warm-up)
Chain 1: 0.205 seconds (Sampling)
Chain 1: 0.43 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 2.2e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.22 seconds.
Chain 2: Gradient evaluation took 1.7e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.17 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -601,9 +601,9 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 2: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.278 seconds (Warm-up)
Chain 2: 0.259 seconds (Sampling)
Chain 2: 0.537 seconds (Total)
Chain 2: Elapsed Time: 0.215 seconds (Warm-up)
Chain 2: 0.204 seconds (Sampling)
Chain 2: 0.419 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand Down Expand Up @@ -659,8 +659,8 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
<pre><code>
SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 2.6e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.26 seconds.
Chain 1: Gradient evaluation took 3.2e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.32 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Expand All @@ -677,15 +677,15 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.283 seconds (Warm-up)
Chain 1: 0.254 seconds (Sampling)
Chain 1: 0.537 seconds (Total)
Chain 1: Elapsed Time: 0.227 seconds (Warm-up)
Chain 1: 0.209 seconds (Sampling)
Chain 1: 0.436 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'bernoulli' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 2.2e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.22 seconds.
Chain 2: Gradient evaluation took 1.7e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.17 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -702,9 +702,9 @@ <h2 class="anchored" data-anchor-id="function-arguments">Function Arguments</h2>
Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.259 seconds (Warm-up)
Chain 2: 0.264 seconds (Sampling)
Chain 2: 0.523 seconds (Total)
Chain 2: Elapsed Time: 0.21 seconds (Warm-up)
Chain 2: 0.224 seconds (Sampling)
Chain 2: 0.434 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand Down Expand Up @@ -1029,8 +1029,8 @@ <h4 class="anchored" data-anchor-id="exercises-1">Exercises</h4>
<pre><code>
SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 4.8e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.48 seconds.
Chain 1: Gradient evaluation took 6.8e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.68 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Expand All @@ -1041,15 +1041,15 @@ <h4 class="anchored" data-anchor-id="exercises-1">Exercises</h4>
Chain 1: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.09 seconds (Warm-up)
Chain 1: 0.098 seconds (Sampling)
Chain 1: 0.188 seconds (Total)
Chain 1: Elapsed Time: 0.121 seconds (Warm-up)
Chain 1: 0.14 seconds (Sampling)
Chain 1: 0.261 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'continuous' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 3.4e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.34 seconds.
Chain 2: Gradient evaluation took 2.1e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -1060,9 +1060,9 @@ <h4 class="anchored" data-anchor-id="exercises-1">Exercises</h4>
Chain 2: Iteration: 1500 / 2000 [ 75%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.087 seconds (Warm-up)
Chain 2: 0.102 seconds (Sampling)
Chain 2: 0.189 seconds (Total)
Chain 2: Elapsed Time: 0.099 seconds (Warm-up)
Chain 2: 0.14 seconds (Sampling)
Chain 2: 0.239 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand Down Expand Up @@ -1102,15 +1102,15 @@ <h4 class="anchored" data-anchor-id="exercises-1">Exercises</h4>
Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 0.095 seconds (Warm-up)
Chain 1: 0.096 seconds (Sampling)
Chain 1: 0.191 seconds (Total)
Chain 1: Elapsed Time: 0.115 seconds (Warm-up)
Chain 1: 0.12 seconds (Sampling)
Chain 1: 0.235 seconds (Total)
Chain 1:

SAMPLING FOR MODEL 'continuous' NOW (CHAIN 2).
Chain 2:
Chain 2: Gradient evaluation took 1.2e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.12 seconds.
Chain 2: Gradient evaluation took 3.8e-05 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.38 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Expand All @@ -1127,9 +1127,9 @@ <h4 class="anchored" data-anchor-id="exercises-1">Exercises</h4>
Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 0.097 seconds (Warm-up)
Chain 2: 0.105 seconds (Sampling)
Chain 2: 0.202 seconds (Total)
Chain 2: Elapsed Time: 0.122 seconds (Warm-up)
Chain 2: 0.141 seconds (Sampling)
Chain 2: 0.263 seconds (Total)
Chain 2: </code></pre>
</div>
</details>
Expand Down Expand Up @@ -1359,15 +1359,15 @@ <h4 class="anchored" data-anchor-id="exercises-3">Exercises</h4>
</details>
</div>
<p>3.&nbsp;Calculate the unadjusted (naive) estimates for comparison.</p>
<p>To see exactly how much our PAIC methods moved the needle, we will calculate the naive estimators. Let <span class="math inline">\(p_A\)</span> and <span class="math inline">\(p_{C(AC)}\)</span> be the raw probabilities of the event in the IPD trial, and let <span class="math inline">\(p_B\)</span> and <span class="math inline">\(p_{C(BC)}\)</span> be the raw probabilities in the ALD trial.</p>
<p>To see exactly how much our PAIC methods moved the needle, we will calculate the naive estimators. Let <span class="math inline">\(p_{A(AC)}\)</span> and <span class="math inline">\(p_{C(AC)}\)</span> be the raw probabilities of the event in the IPD trial, and let <span class="math inline">\(p_{B(BC)}\)</span> and <span class="math inline">\(p_{C(BC)}\)</span> be the raw probabilities in the ALD trial.</p>
<ul>
<li><strong>Naive Anchored Risk Difference:</strong> This assumes the relative effect is transportable without adjustment (the classic Bucher indirect comparison).</li>
</ul>
<p><span class="math display">\[\hat{\Delta}_{AB}^{\text{naive\_anchored}} = (p_A - p_{C(AC)}) - (p_B - p_{C(BC)})\]</span></p>
<p><span class="math display">\[\hat{\Delta}_{AB}^{\text{naive\_anchored}} = (p_{A(AC)} - p_{C(AC)}) - (p_{B(BC)} - p_{C(BC)})\]</span></p>
<ul>
<li><strong>Naive Unanchored Risk Difference:</strong> This drops the common comparator entirely and assumes absolute exchangeability between the two isolated active arms.</li>
</ul>
<p><span class="math display">\[\hat{\Delta}_{AB}^{\text{naive\_unanchored}} = p_A - p_B\]</span></p>
<p><span class="math display">\[\hat{\Delta}_{AB}^{\text{naive\_unanchored}} = p_{A(AC)} - p_{B(BC)}\]</span></p>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
Expand Down
6 changes: 3 additions & 3 deletions scripts/exercises2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -605,16 +605,16 @@ cat("Unanchored Risk Difference (A vs B):", round(unanchored_rd, 3), "\n")

3.\ Calculate the unadjusted (naive) estimates for comparison.

To see exactly how much our PAIC methods moved the needle, we will calculate the naive estimators. Let $p_A$ and $p_{C(AC)}$ be the raw probabilities of the event in the IPD trial, and let $p_B$ and $p_{C(BC)}$ be the raw probabilities in the ALD trial.
To see exactly how much our PAIC methods moved the needle, we will calculate the naive estimators. Let $p_{A(AC)}$ and $p_{C(AC)}$ be the raw probabilities of the event in the IPD trial, and let $p_{B(BC)}$ and $p_{C(BC)}$ be the raw probabilities in the ALD trial.

* **Naive Anchored Risk Difference:** This assumes the relative effect is transportable without adjustment (the classic Bucher indirect comparison).

$$\hat{\Delta}_{AB}^{\text{naive\_anchored}} = (p_A - p_{C(AC)}) - (p_B - p_{C(BC)})$$
$$\hat{\Delta}_{AB}^{\text{naive\_anchored}} = (p_{A(AC)} - p_{C(AC)}) - (p_{B(BC)} - p_{C(BC)})$$


* **Naive Unanchored Risk Difference:** This drops the common comparator entirely and assumes absolute exchangeability between the two isolated active arms.

$$\hat{\Delta}_{AB}^{\text{naive\_unanchored}} = p_A - p_B$$
$$\hat{\Delta}_{AB}^{\text{naive\_unanchored}} = p_{A(AC)} - p_{B(BC)}$$


::: {.callout-warning}
Expand Down
Binary file modified scripts/practical_paic.pdf
Binary file not shown.
Loading