#' Interim analaysis predictive probability of success
#'
#' @param alpha prior alpha
#' @param beta prior beta
#' @param Nmax Final sample size
#' @param x Number of successes at iterim
#' @param Rx Final required number of successes
#' @param n sample size at interim
#'
#' @return the probability of observing Rx or more successes at Nmax if x successes are observed in the first n samples.
#' This is a helper function which translates pbetabinom into more meaningful paramiters for this application.
#' @export
#' @import tidyr
#' @import dplyr
#' @import stats
#'
#' @examples
BinSing_PPoS <- function(alpha, beta, Nmax, x,Rx, n) {
1-pbetabinom_c(Rx-x,Nmax-n,(alpha+x)/(alpha+beta+n),alpha+beta+n)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.