# Expected number of events for a time-to-event study

### Description

`eEvents()`

is used to calculate the expected number of events for a population with a time-to-event endpoint.
It is based on calculations demonstrated in Lachin and Foulkes (1986) and is fundamental in computations for the sample size method they propose.
Piecewise exponential survival and dropout rates are supported as well as piecewise uniform enrollment.
A stratified population is allowed.
Output is the expected number of events observed given a trial duration and the above rate parameters.

### Usage

1 2 3 4 |

### Arguments

`lambda` |
scalar, vector or matrix of event hazard rates; rows represent time periods while columns represent strata; a vector implies a single stratum. |

`eta` |
scalar, vector or matrix of dropout hazard rates; rows represent time periods while columns represent strata; if entered as a scalar, rate is constant accross strata and time periods; if entered as a vector, rates are constant accross strata. |

`gamma` |
a scalar, vector or matrix of rates of entry by time period (rows) and strata (columns); if entered as a scalar, rate is constant accross strata and time periods; if entered as a vector, rates are constant accross strata. |

`R` |
a scalar or vector of durations of time periods for recruitment rates specified in rows of |

`S` |
a scalar or vector of durations of piecewise constant event rates specified in rows of |

`T` |
time of analysis; if |

`Tfinal` |
Study duration; if |

`minfup` |
time from end of planned enrollment ( |

`x` |
an object of class |

`digits` |
which controls number of digits for printing. |

`...` |
Other arguments that may be passed to the generic print function. |

### Details

`eEvents()`

produces an object of class `eEvents`

with the number of subjects and events for a set of pre-specified trial parameters, such as accrual duration and follow-up period. The underlying power calculation is based on Lachin and Foulkes (1986) method for proportional hazards assuming a fixed underlying hazard ratio between 2 treatment groups. The method has been extended here to enable designs to test non-inferiority. Piecewise constant enrollment and failure rates are assumed and a stratified population is allowed. See also `nSurvival`

for other Lachin and Foulkes (1986) methods assuming a constant hazard difference or exponential enrollment rate.

`print.eEvents()`

formats the output for an object of class `eEvents`

and returns the input value.

### Value

`eEvents()`

and `print.eEvents()`

return an object of class `eEvents`

which contains the following items:

`lambda` |
as input; converted to a matrix on output. |

`eta` |
as input; converted to a matrix on output. |

`gamma` |
as input. |

`R` |
as input. |

`S` |
as input. |

`T` |
as input. |

`Tfinal` |
lanned duration of study. |

`minfup` |
as input. |

`d` |
expected number of events. |

`n` |
expected sample size. |

`digits` |
as input. |

### Author(s)

Keaven Anderson keaven_anderson@merck.com

### References

Lachin JM and Foulkes MA (1986), Evaluation of Sample Size and Power for Analyses of Survival with Allowance for Nonuniform Patient Entry, Losses to Follow-Up,
Noncompliance, and Stratification. *Biometrics*, 42, 507-519.

Bernstein D and Lagakos S (1978), Sample size and power determination for stratified
clinical trials. *Journal of Statistical Computation and Simulation*, 8:65-73.

### See Also

gsDesign package overview, Plots for group sequential designs, `gsDesign`

, `gsHR`

, `nSurvival`

### Examples

1 2 3 4 5 6 7 8 | ```
# 3 enrollment periods, 3 piecewise exponential failure rates
eEvents(lambda=c(.05,.02,.01), eta=.01, gamma=c(5,10,20),
R=c(2,1,2), S=c(1,1), T=20)
# control group for example from Berstein and Lagakos (1978)
lamC<-c(1,.8,.5)
n<-eEvents(lambda=matrix(c(lamC,lamC*2/3),ncol=6), eta=0,
gamma=matrix(.5,ncol=6), R=2, T=4)
``` |