R/PersMonExp.R

Defines functions PersMonExp

Documented in PersMonExp

PersMonExp <- function(d, o, n.alive, new.pat, cont.time) {

  ## Calculates the further person months
  ## in the exponential survival, i. e.
  ##   S(t) = exp( - lambda * t), lambda > 0, t >= 0,
  ## from the interim analysis until the end of time of continuation.
  ##
  ## Args:
  ##   d: Parameter.
  ##   o: Parameter.
  ##   n.alive: Number of patients still alive.
  ##   new.pat: Number of patients who will be recruited each time unit.
  ##   cont.time: Period of time of continuing the trial.
  ##
  ## Results:
  ##   Further person months.

  # calculation of further person months
  O.star <- (n.alive * (1 - exp(- d / o * cont.time)) / (d / o)
              + new.pat * cont.time / (d / o)
              - new.pat * (1 - exp(- d / o * cont.time)) / (d / o)^2)

  return(O.star)
}

Try the CP package in your browser

Any scripts or data that you put into this service are public.

CP documentation built on May 31, 2023, 7:48 p.m.