calc_expEvents: Calculates the expected number of events

Description Usage Arguments Details Value Examples

View source: R/calc_expEvents.R

Description

!!!!!!!!!!!!! shall not be exported !!!!!!!!!!!!!!!!!!! Calculates the expected number of events of a population given their respective recruiting timepoint, assumed survival time of the first group, the hazard ratio and ce censor rate. If the distributions are ....

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
calc_expEvents(
  N,
  theta,
  L = Inf,
  tn,
  lambda,
  sigma = 1,
  distS = "exponential",
  gamma,
  kappa = 1,
  distC = "exponential",
  col_Sums = TRUE
)

Arguments

N

a two column matrix containing the size of both recruitment groups per row, representing the number of recruited patients per group and timepoint (tn).

theta

a number greater 0 defining the assumed hazard ratio.

L

a number greater 0 defining the timepoint for administrative censoring. If no administrative censoring is planned L=Inf. Default is L=Inf.

tn

a numeric vector defining the recruitment timepoint. Default is 0:(NROW(N)-1).

lambda

a number greater 0 defining the hazard rate for the survival process of group1. For the parametrization see details.

sigma, kappa

a number greater 0 defining the shape parameter for the survival- and the censor process. Only needed if distS or distC is set to weibull. Default is 1 resulting in an exponential distribution.

distS, distC

a character string defining the distribution of the survival- and the censor process. Default is 'exponential'.

gamma

a number greater 0 defining the overall hazard rate for the censor process.

col_Sums

a boolen value. If set to FALSE, the function will return the expected number of events per recruitment batch at time T instead of the sums per group.

Details

With constant hazard rate λ and shape parameter σ the survival function for the weibull event process is given by

S ( t ) = exp{ λ t ^ σ },

with density function

f ( t ) = λ σ t ^ { σ - 1 } exp{ λ t ^ σ }.

Value

a vector containing the expected number of events per group at time L.

Examples

1
2
3
4
5
6
# with a recruitment time of 5 month and recruiting 30 Patients per month
# assuming a hazard ratio of .7 and a rate of two year survival of .7
# as well as a two year censor rate of .2 under exponential distribution
# and administrative censoring after 10 month.
N <- matrix(rep(50,10),ncol=2)
calc_expEvents(N=N ,theta = .7, L=10, lambda=-log(.7)/24, gamma=-log(.8)/24)

Knusprikus/BSSRed documentation built on July 6, 2020, 11:02 p.m.