Calculates the conditional power within the exponential model with the original formulae of the Andersen paper.

1 2 3 | ```
ConPwrExpAndersen(data, cont.time, new.pat = c(0, 0),
theta.0 = 1, alpha = 0.05,
disp.data = FALSE, plot.km = FALSE)
``` |

`data` |
Data frame which consists of at least three columns with the group (two different expressions) in the first, status (1 = event, 0 = censored) in the second and event time in the third column. |

`cont.time` |
Period of time of continuing the trial. |

`new.pat` |
2-dimensional vector which consists of numbers of new patients who will be recruited each time unit (first component = group 1, second component = group 2) with default at (0, 0). |

`theta.0` |
Originally postulated clinically relevant difference (hazard ratio = hazard of group 2 / hazard of group 1) with default at 1. |

`alpha` |
Significance level for conditional power calculations with default at 0.05. |

`disp.data` |
Logical value indicating if all calculated data should be displayed with default at FALSE. |

`plot.km` |
Logical value indicating if Kaplan-Meier curves and estimated survival curves according to the exponential model should be plotted with default at FALSE. |

This function calculates the conditional power within the exponential model, i. e.

*S(t) = e^(- λ t)*

for all *t ≥ 0* and *λ > 0*,
and plots the conditional power curve.
The original formulae of the Andersen paper are used.

Optionally, further data will be displayed. This includes data from interim analysis, log-likelihoods, AICs, calculated estimators and further patient times.

Moreover, it is possible to plot the Kaplan-Meier curves and the estimated survival curves according to the exponential model.

See Details.

Returns a list which consists of the following components:

`lambda1.hat` |
estimated hazard of group 1 |

`lambda2.hat` |
estimated hazard of group 2 |

`theta.hat` |
estimated hazard ratio = estimated hazard of group 2 / estimated hazard of group 1 |

`gamma.theta.0` |
conditional power |

There are several mechanisms to ensure that no illegal operations will be done. That is why there should not be too less data in the data frame, for example one patient of each group and both being censored.

Andreas Kuehnapfel

Andersen, P. K. (1987). Conditional power calculations as an aid in the decision whether to continue a clinical trial. Controlled Clinical Trials 8, 67-74.

1 2 3 4 5 6 7 8 | ```
# data frame 'test' generated by 'GenerateDataFrame'
# conditional power calculations
# within the exponential model
# with the original formulae of the Andersen paper
ConPwrExpAndersen(data = test, cont.time = 12, new.pat = c(2.5, 2.5),
theta.0 = 0.75, alpha = 0.05,
disp.data = TRUE, plot.km = TRUE)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.