# Getting started{-}
- Download the raw R quarto file [here]().
- Start up Rstudio. Then open the R quarto exercise file.
- Make sure that you have rpact version $\geq 3.5.1$ installed.
- Load the rpact package by executing the code below in R.
- Start answering the questions below by adding your own R code. Use the rpact vignettes [here](https://rpact.org/vignettes/planning/rpact_survival_planning_example/) and [here](https://rpact.org/vignettes/planning/rpact_survival_examples/) for guidance.
$\Rightarrow$ **Good Luck!**
# Load rpact package {-}
```{r, include=TRUE, echo=TRUE}
# Load rpact
library(rpact)
packageVersion("rpact")
library(knitr)
```
# Trial with time-to-event endpoint
## The trial
A phase III, randomized, multicenter, open-label, two-arm study designed to evaluate treatment A versus B.
The **general assumptions for the sample size assessment** are:
- Randomization in a 2:1 ratio.
- The dropout rate is 5% for arm A and 10% for arm B, both at 12 months.
- The recruitment of approximately 250 patients will take place over 5 months.
The following additional assumptions are made:
- Exponentially distributed PFS in the control arm with a median of 4 months.
- Median PFS improvement vs. control of 3.3 months (medians 7.3 vs. 4 months, i.e. a HR of approximately 0.55).
- Log-rank test at a two-sided significance level of 0.05, power 80%.
## Questions and solutions
*a) Based on these assumptions, compute the following quantities:*
- *Number of events required to reach the targeted power.*
- *The MDD.*
- *The clinical cutoff date for the primary analysis.*
**Solution:**
```{r, include=TRUE, echo=TRUE}
# add your R-code to answer the question here.
```
*b) How many events would be expected to occur until exactly 2 and 4 months, respectively, from first patient randomized? (Use function `getEventProbabilities`.)*
**Solution:**
```{r, include=TRUE, echo=TRUE}
# add your R-code to answer the question here.
```