Plot the survival function and the HR for composite endpoint over time and the ARE (Assymptotic Relative Efficiency) and sample size size according to the correlation.The composite endpoint is assumed to be a time to event endpoint formed by a combination of two events (E1 and E2). We assume that the endpoint 1 is more relevant for the clinical question than endpoint 2. #'
plot_tte(
p0_e1,
p0_e2,
HR_e1,
HR_e2,
beta_e1 = 1,
beta_e2 = 1,
case,
copula = "Frank",
rho = 0.3,
rho_type = "Spearman",
followup_time = 1,
alpha = 0.05,
power = 0.8,
ss_formula = "schoenfeld",
summary = FALSE,
type = "survival"
)
Four plots related to composite endpoint are returned:
Survival curve for the composite endpoint over time
Hazard Ratio for the composite endpoint over time
ARE according to correlation (\(\rho\))
Sample size for the composite endpoint according to correlation (\(\rho\))
numeric parameter between 0 and 1, expected proportion of observed events for the endpoint E1
numeric parameter between 0 and 1, expected proportion of observed events for the endpoint E2
numeric parameter between 0 and 1, expected cause specific hazard Ratio the endpoint E1
numeric parameter between 0 and 1, expected cause specific hazard Ratio the endpoint E2
numeric positive parameter, shape parameter (\(\beta_1\)) for a Weibull distribution for the endpoint E1 in the control group. See details for more info.
numeric positive parameter, shape parameter (\(\beta_2\)) for a Weibull distribution for the endpoint E2 in the control group. See details for more info.
integer parameter in {1,2,3,4}: (1) none of the endpoints is death; (2) endpoint 2 is death; (3) endpoint 1 is death; (4) both endpoints are death by different causes.
character indicating the copula to be used: "Frank" (default), "Gumbel" or "Clayton". See details for more info.
numeric parameter between -1 and 1, Spearman's correlation coefficient o Kendall Tau between the marginal distribution of the times to the two events E1 and E2. See details for more info.
character indicating the type of correlation to be used: "Spearman" (default) or "Kendall". See details for more info.
numeric parameter indicating the maximum follow up time (in any unit). Default is 1.
numeric parameter. The probability of type I error. By default \(\alpha=0.05\)
numeric parameter. The power to detect the treatment effect. By default \(1-\beta=0.80\)
character indicating the formula to be used for the sample size calculation on the single components: 'schoenfeld' (default) or 'freedman'
logical. TRUE if you want all the relevant plots for the trial design
character indicating the type of plot: 'survival', 'effect', 'ARE', 'samplesize'
Some parameters might be difficult to anticipate, especially the shape parameters of Weibull distributions and those referred to the relationship between the marginal distributions. For the shape parameters (beta_e1, beta_e2) of the Weibull distribution, we recommend to use \(\beta_j=0.5\), \(\beta_j=1\) or \(\beta_j=2\) if a decreasing, constant or increasing rates over time are expected, respectively. For the correlation (rho) between both endpoints, generally a positive value is expected as it has no sense to design an study with two endpoints negatively correlated. We recommend to use \(\rho=0.1\), \(\rho=0.3\) or \(\rho=0.5\) for weak, mild and moderate correlations, respectively. For the type of correlation (rho_type), although two different type of correlations are implemented, we recommend the use of the Spearman's correlation. In any case, if no information is available on these parameters, we recommend to use the default values provided by the function.
library(ggplot2)
plot_tte(p0_e1 = .59, p0_e2 = .74,
HR_e1 = .91, HR_e2 = .77,
beta_e1 = 1, beta_e2 = 2,
case = 3, rho = .5,
copula = 'Frank', rho_type = 'Spearman',
summary = FALSE, type = 'effect',
followup_time=1) + theme_bw()
Run the code above in your browser using DataLab