-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clean * clean * clean * clean lintr errors * .R: Auto stash before merge of "24_predprob.R" and "main" * clean * clean * clean * Update R/predprob.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * Update R/predprob.R Co-authored-by: Daniel Sabanes Bove <[email protected]> * clean --------- Co-authored-by: Daniel Sabanes Bove <[email protected]>
- Loading branch information
1 parent
6af999c
commit 06ae0a2
Showing
4 changed files
with
242 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,26 @@ | ||
## The original Lee and Liu (Table 1) example: | ||
## Nmax=40, x=16, n=23, beta(0.6,0.4) prior distribution, | ||
## thetaT=0.9. The control response rate is 60%: | ||
# The original Lee and Liu (Table 1) example: | ||
# Nmax = 40, x = 16, n = 23, beta(0.6,0.4) prior distribution, | ||
# thetaT = 0.9. The control response rate is 60%: | ||
predprob( | ||
x = 16, n = 23, Nmax = 40, p = 0.6, thetaT = 0.9, | ||
parE = c(0.6, 0.4) | ||
) | ||
## So the predictive probability is 56.6%. 12 responses | ||
## in the remaining 17 patients are required for success. | ||
|
||
## Lowering/Increasing the probability threshold thetaT of course increases | ||
## /decreases the predictive probability of success, respectively: | ||
# Lowering/Increasing the probability threshold thetaT of course increases | ||
# /decreases the predictive probability of success, respectively: | ||
predprob( | ||
x = 16, n = 23, Nmax = 40, p = 0.6, thetaT = 0.8, | ||
parE = c(0.6, 0.4) | ||
) | ||
## 70.8% | ||
|
||
predprob( | ||
x = 16, n = 23, Nmax = 40, p = 0.6, thetaT = 0.95, | ||
parE = c(0.6, 0.4) | ||
) | ||
## 40.7% | ||
|
||
## Instead of a fixed beta prior on the response rate, dynamic borrowing | ||
## from a previous data set is possible by using a beta-mixture prior. | ||
## For example, assume we have a previous trial where we saw 25 responses | ||
## in 40 patients. We would like to use information worth 10 patients in our | ||
## trial, but be robust against deviations from that response rate (maybe | ||
## because it was conducted in slightly different disease or patients). | ||
## Then we can use a beta mixture prior, with the informative component getting | ||
## weight of 1/4: | ||
# Mixed beta prior | ||
predprob( | ||
x = 20, n = 23, Nmax = 40, p = 0.6, thetaT = 0.9, | ||
parE = rbind(c(1, 1), c(25, 15)), | ||
weights = c(3, 1) | ||
) | ||
## Since the response rate in the historical dataset is lower (62.5% < 69.6%) | ||
## than in the trial, but similar, we notice that the predictive probability | ||
## of success is now lower. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.