Generating Survival Times Using Cox Proportional Hazards Models with Cyclic and Piecewise Time-Varying Covariates

Time-to-event outcomes with cyclic time-varying covariates are frequently encountered in biomedical studies that involve multiple or repeated administrations of an intervention. In this paper, we propose approaches to generating event times for Cox proportional hazards models with both time-invariant covariates and a continuous cyclic and piecewise time-varying covariate. Values of the latter covariate change over time through cycles of interventions and its relationship with hazard differs before and after a threshold within each cycle. The simulations of data are based on inverting the cumulative hazard function and a log link function for relating the hazard function to the covariates. We consider closed-form derivations with the baseline hazard following the exponential, Weibull, or Gompertz distribution. We propose two simulation approaches: one based on simulating survival data under a single-dose regimen first before data are aggregated over multiple-dosing cycles and another based on simulating survival data directly under a multiple-dose regimen. We consider both fixed intervals and varying intervals of the drug administration schedule. The method’s validity is assessed in simulation experiments. The results indicate that the proposed procedures perform well in generating data that conform to their cyclic nature and assumptions of the Cox proportional hazards model. Electronic supplementary material The online version of this article (10.1007/s12561-020-09266-3) contains supplementary material, which is available to authorized users.


Introduction
Time-to-event outcomes with cyclic time-varying covariates are frequently encountered in biomedical studies that involve multiple or repeated administrations of an intervention. For example, the plasma concentration of a drug taken orally daily to prevent a certain infection would usually fluctuate on a daily cycle, and it is often of interest to identify whether and how the cyclic drug concentration associates with the hazard of infection. In the two harmonized Antibody Mediated Prevention (AMP) Phase 2b efficacy trials (ClinicalTrials.gov #NCT02716675 & #NCT02568215), more than 4500 HIV-uninfected participants at high risk for acquiring HIV infection are randomized to receive 10 infusions every 8 weeks of either VRC01 or placebo and followed for 80 weeks for the study endpoint of HIV infection [1]. VRC01 is a monoclonal antibody that has been shown to neutralize most strains of the HIV virus in laboratory studies, and the AMP trials will test whether VRC01 reduces the rate of HIV infection compared to placebo. The concentration of VRC01 in participants' blood samples, which we refer to as "drug concentration," changes continuously and cyclically over time. As illustrated in Fig. 1, the drug concentration typically peaks 10 mg/kg VRC01 Every 8 Weeks E.g., 10 ug/ml could be an example of a "protective" threshold below which the drug has no effect on study outcome.

Fig. 1
Illustration-simulated VRC01 serum concentration over time following ten 8-weekly IV infusions at 10 mg/Kg and 30 mg/Kg dose levels with perfect study adherence, according to the pharmacokinetics model described in Huang et al. [2]. Solid lines are the medians; shaded areas are the 2.5% and 97.5% percentiles of the concentrations over 1000 simulated datasets. A body weight of 74.5 Kg is used in the simulations within hours after an infusion, followed by a decline over weeks of time and may reach below a clinically protective threshold, s [2][3][4].
In the context of drug concentration being a potential biomarker that predicts the risk of infection, s is referred to as the zero-protection threshold. This implies that, during periods when drug concentration is below s, the individual receives no protection from the drug. A simulation model was previously developed to address the same issue, for a different context of studying time-independent biomarkers as correlates of cumulative outcome risk [5]. The primary objective of the AMP trials is to evaluate the efficacy of VRC01 (vs. placebo) to prevent HIV infection at dose levels of 10 mg/Kg and 30 mg/Kg. A key secondary objective assesses the association of the current value of VRC01 serum concentration (or other anti-viral functional biomarker) with the instantaneous rate of HIV infection. Such time-dependent survival analysis is desirable to aid HIV vaccine development by setting a benchmark biomarker value for the required potency of a vaccine-induced immune response to putatively achieve a high level of protection against HIV infection. Findings from such analysis will thus help define study endpoints in phase 1 and 2 trials that vet candidate HIV vaccines for their potential efficacy [1].
For joint modeling of longitudinal biomarker data and time-to-event data (e.g., [6][7][8]), simulation studies are often needed in the method development for the analyses of such data. An essential starting point is to produce simulated survival times from a known data-generating process [9][10][11][12][13]. For continuous covariates, to our knowledge previous work has been limited to simulating event times that the timevarying covariates follow a simple linear relationship with time and/or log-transformed time [14][15][16], or the covariates change at integer-valued steps of the time scale [17] throughout the entire follow-up period. Such data-generating processes are only appropriate when individuals are uniformly exposed to risk of acquiring the survival outcome at each unit of time (e.g., oral daily dose of the same drug amount). Therefore, new or extensions of these methods are needed for settings like the AMP trials with a cyclic and piecewise time-varying covariate.
Cox proportional hazards (PH) regression models are the most common approach for evaluating the association of covariates, including time-varying covariates with survival outcomes. The objective of this paper is to develop methods for the generation of survival times that follow a Cox PH model with time-invariant covariates, as well as a cyclic and piecewise time-varying covariate. We generate time-to-event data based on inverting the cumulative hazard function and a log link function for relating the hazard function to the time-varying and time-invariant covariates. We provide closed-form derivations for simulating time-to-event data with the baseline hazard following three commonly used distributions: exponential, Weibull, and Gompertz, all of which satisfy the PH assumptions with the Cox regression model [18] . We propose two simulation approaches. The first approach is based on simulating survival data under a single-dose regimen before such data are aggregated over multiple-dose intervals; the second approach is based on simulating survival data directly under a multiple-dose regimen. Under the latter approach, we also provide derivations for simulating time-to-event data from studies with varying drug administration intervals to accommodate variable visit windows and possible missed visits.
Statistics in Biosciences (2020) 12:324-339 The paper is structured as follows. In Sect. 2, we introduce notations and assumptions, followed by descriptions of the single-dose and multiple-dose approaches for simulating survival times. For the single-dose approach, we provide, under the zero-protection model, details of the closed-form derivations of the baseline hazard following an exponential distribution in the main text. Derivations for Weibulland Gompertz-distributed baseline hazard are presented in the Appendices. For the multiple-dose approach, we provide details of the derivations assuming a monotonic relationship between the time-varying covariate and the survival outcome within each dosing cycle in the main text. Extensions incorporating the zero-protection model and varying drug administration intervals are provided in the Online Appendices. In Sect. 3, we describe three simulation experiments to assess the developed methods with application to the AMP CoR study. Conclusions are provided in Sect. 4.

Methods
For concreteness, we describe notations and methods in the context of the AMP trials. However, the same data-generating concepts can be generalized to other applicable biomedical settings with repeated drug administrations. where z(t) denotes the time-varying covariate, whose value changes over the duration of the follow-up time, while its association with the hazard of the outcome stays constant as denoted by the regression coefficient ; x denotes the time-invariant covariates, and is the vector of regression coefficients associated with the vector of fixed covariates x. h 0 (t) is the baseline hazard function, i.e., the hazard function of the outcome for those subjects with x = 0 and z(t) = 0 . In addition, let t s be the time (in days) since the most recent infusion when drug concentration reaches the zeroprotection threshold, s.

Cyclic and Piecewise Time-Varying Covariate
Under the zero-protection threshold model, we define the time-varying covariate as time since the most recent infusion or t s in a cyclic and piecewise manner: Although z(t) may be defined directly as the drug concentrations over time, one advantage of the above definition is the easy interpretation of in Eq. (1) as the perday change effect on log-hazard before t s is reached within each drug administration cycle. Intuitively, is ≥ 0 if the risk of infection with respect to z(t) is expected to be nondecreasing over time within each cycle. In other words, we consider z(t) as a proxy of the drug concentration at time t because after each infusion, drug concentrations are expected to change with time in a monotonic fashion. For example, for drug concentrations that follow a log-linear relationship with time, as specified by a one-compartment pharmacokinetics (PK) model with a single decay rate, or for drug concentrations that follow a bi-exponential two-compartment PK model with a brief distribution phase but a much longer elimination phase (as shown in Fig. 1), the effect of drug concentration on log-hazard is measured by simply rescaling by the elimination decay rate. This relationship is expected to be held for many monoclonal antibodies that exhibit the described pharmacokinetic patterns (see review in, e.g., [19]).
Another advantage of this definition of z(t) is the generalizability of the derivations described in the following sections without being constrained to a specific nonlinear PK model of drug concentration over time, while also sidestepping the issue of not having a closed-form derivation of the survival time for more complex nonlinear PK models. The reason why z(t) takes the value of t s after drug concentration reaches below s is to ensure that, beyond t s within each drug administration cycle, the hazard of individuals who received the drug does not keep changing at the rate of exp( ) but maintains at the same level as that of individuals who did not receive the drug. This tactic avoids the need to impose a different value of when the effect of the time-varying covariate changes after t s under the zero-protection threshold model.
In reality, t s could differ across individuals. For simplicity and faster computation, an average t s can be used in the actual simulation of survival times. For example, based on the population PK model of VRC01 described in Huang et al. [2] , we estimate that t s = 57 days for the 10 mg/Kg dose group, and t s = 81 days for the 30 mg/Kg dose group with s = 5.0 mcg/mL, a level of VRC01 concentration that is hypothesized to confer protection against HIV infection [20][21][22][23]. This implies that the instantaneous hazard remains constant after 57 and 81 days, respectively, in the low-and high-dose groups of the AMP trials. This ensures meaningful simulated survival time to account for the wide infusion visit window in AMP (− 1 week to + 7 weeks around the target 8-weekly infusion visits) and for individuals whose infusion intervals are great than 8 weeks due to missed infusions.

Assumptions
The following assumptions are used in the derivations for the single-and multipledose approaches described below.
-The effect of both the time-invariant and time-varying covariates on hazard is multiplicative (i.e., the PH assumption). -is a time-invariant coefficient in Eq. (1). This implies that the association between z(t) and hazard does not change between cycles (i.e., the cycle-invariant assumption).
-Under the zero-protection threshold model, the instantaneous hazard at t s within each cycle is assumed to be indicates the hazard rate in the control group where no association of the drug with survival is expected to be observed. Of note, p (x) is allowed to vary with x if incorporating between-individual variability due to time-invariant covariates is desirable in the simulated datasets.

Simulating Survival Times
As shown in Eq. (1), the Cox model is formulated through the hazard function. Therefore, the simulation of appropriate survival times for this model needs further manipulation based on the relationship between the hazard function and the covariate as discussed in [9][10][11][12][14][15][16][17]. The translation of the regression coefficients from hazard to survival time is relatively easy if the baseline hazard function is constant with h 0 (t) = , > 0 . In this case, the cumulative hazard function of model (1) is given by: Because of the survival function of the above model, S(t|x, z(t)) = exp(−H(t|x, z(t))) follows the standard uniform distribution U(0,1), [9,11,12] have demonstrated that a survival time, T, can be generated by inverting the cumulative hazard function via In the following, we extend the work of Austin [14] to accommodate both timeinvariant covariates, x, and a continuous time-varying covariate, z(t). Importantly, the values of z(t) change over time in a cyclic form and the association between z(t) and survival changes in a piecewise manner within each cycle.

Single-Dose Approach
The single-dose approach considers simulating survival data over one-dose interval as a first step before such data are aggregated over multiple-dose intervals. Instead of having the same continuous relationship with t throughout the entire follow-up time as described in Austin [15], z(t) in our case changes at t s within each drug administration cycle, as shown in Eq. (2). In the following, we describe the steps to simulate survival times after a single dose, by inverting the cumulative hazard function. We show derivations in details for Cox models with an exponential baseline hazard; details for the Weibull and Gompertz distributions are reported in Online Appendices A1 and A2, respectively.
For exponentially distributed baseline hazard, h 0 (t) = , t actually follows the Gompertz distribution with a scale parameter of exp( � x) and a shape parameter of . Therefore, if t ≤ t s , the event time can be generated as where u is the realization of a U(0, 1) random variable. The detailed derivations are provided in Online Appendix A0 and follow similar steps as described in Austin [15] for Gompertz-distributed event times.
If t > t s , the cumulative hazard function is equal to Consequently, the inverse cumulative hazard function is Therefore, an event time can be generated as where u is the realization of a U(0, 1) random variable. In summary, in order to simulate survival times under a zero-protection threshold model after a single dose is given, a random uniform sample, u , is first simulated and the survival time takes the form in Eq.
After the single-dose survival time according to the exponential, Weibull-, or Gompertz-distributed baseline hazard is simulated as described above or in the Online Appendix, the survival time after multiple doses can be simulated as follows: 1. Simulate the actual infusion visit times (since enrollment), D 1 < ⋯ < D m for each individual's m infusions (e.g., [24]). Consequently, the infusion intervals can be calculated as I k = D k+1 − D k , k = 1 , 2, ..., m − 1 , and I m = − D m . Infusion visit windows and possible missed infusions and/or permanent infusion discontinu- .
ations could be considered here. For example, the probability of a missing visit can be specified for each infusion for different scenarios of adherence level. In the case of the AMP study, the target visit date of each subsequent infusion is relative to the immediately previous infusion visit. Therefore, for AMP, the actual infusion visit times will need to be simulated sequentially and an uniform distribution could be used to simulate the visit time of an infusion to be between a window of, say 51 days and 105 days after the previous infusion visit date; 2. For each individual, independently simulate the single-dose survival time T 1 , T 2 , ..., T m for each of the m infusion intervals according to Eqs. (4) and (5) This approach guarantees that, as desired, the event time follows the same survival function within each infusion interval. In addition, the probability of infection during a given interval is not affected by the probability of the same individual not being infected in the prior infusion interval because P(infected in I 2 ) = P(infected in I 2 | not infected in I 1 ) = P ( T 2 < D 2 | T 1 > D 1 ) = P ( T 2 < D 2 ) (given that T k 's are i.i.d).

Multiple-Dose Approach
For simulating survival time with a cyclic time-varying covariate, instead of the approach described above via aggregating survival times generated in single-dose intervals, the multiple-dose approach considers simulating survival data over multiple-dose intervals directly. The following steps can be used to generate survival times for participants receiving up to m doses. These steps apply when all dosing intervals, I 1 , … , I m , are smaller than t s , i.e., the next dose is always given or the study is ended before the drug concentration reaches below s. If some of I 1 , … , I m may be greater than t s , then strategies that combine the cumulative hazards before t s and after t s can be employed (Online Appendix A3). Similarly, survival times are simulated by inverting the cumulative hazard function. In the following derivations, the baseline hazard is assumed to be exponentially distributed.
If D 1 ≤ t < D 2 , following similar derivations shown in Online Appendix A0, t can be generated as and u ∼ U(0, 1).
If D 2 ≤ t < D 3 , the cumulative hazard function is equal to Consequently, the inverse cumulative hazard function is Therefore, an event time can be generated as where u is the realization of a U(0,1) random variable. Similarly, for D k ≤ t < D k+1 , k = 2, … , m − 1 , the cumulative hazard function is and the inverse cumulative hazard function is Therefore, an event time can be generated as and where u is the realization of a U(0, 1) random variable. Lastly, if t ≥ D m , an event time can be generated as � and u is the realization of a U(0, 1) random variable.
In summary, the infusion times,

Applications
We next apply the described survival data-generating approaches and evaluate their validity in simulation experiments. These simulations are motivated by the AMP trials in the context of HIV infection; however, the described procedures can be generalized to other biomedical applications. In the context of HIV infection in healthy adults, previous HIV vaccine efficacy trials have found support for the assumption of a constant hazard over time in the placebo group [25][26][27][28][29][30]. Therefore, we chose the exponential baseline hazard function in the following illustrations.
In the first experiment, the single-dose approach is used to simulate survival data for 1000 AMP-like trials, each with n = 1500 participants in each of the 10 mg/Kg VRC01, 30 mg/Kg VRC01 and placebo groups. Within each trial, the time-varying covariate (i.e., time since infusion) is associated with the survival outcome (i.e., time to HIV infection in days) according to Eq. (1) with = 0.03 and = 0 for both dose groups. In addition, z(t) takes the piecewise form as described in Eq. (2) with a zero-protection threshold s = 5 mcg/mL. Consequently, the baseline hazard h 0 (t) = daily HIV incidence rate divided by exp( t s ) , where t s = 57 and t s = 81 for the low-and high-dose groups, respectively, to ensure the same baseline HIV infection rate beyond t s in the two dose groups.
These parameter values indicate that, before an individual's drug concentration reaches 5 mcg/mL, the hazard ratio over a 28-day period is exp(28 × 0.03) = 2.31 , but the rate of infection remains constant ( = 0.04/year) once the individual's drug concentration falls below 5 mcg/mL. We consider two study adherence levels: the high and medium adherence scenarios assume the probability of missing a given infusion is 2% and 10% for each of the 10 infusions, and are simulated based on random draws from binomial distributions with success probabilities 0.02 and 0.1, respectively. More details in the simulations of such AMP-like study setup can be found in Zhang et al. [8].
We expect three patterns in the simulated data. First, the low-dose group should have higher risk of infection than the high-dose group. This is because drug concentrations in the former group on average are expected to reach the zero-protection threshold, 5 mcg/mL in a shorter time or, in other words, the lower-dose group is expected to have a smaller t s=5 mcg/mL than the higher-dose group, although the two dose groups do have the same risk (due to having the same = 0.03 ) until their respective t s=5 mcg/mL time points within each dosing cycle. Second, a lower risk of infection should be associated with a better study adherence due to less missed infusions and less follow-up time with concentration below the zero-protection threshold s = 5 mcg/mL. Third, a shorter duration between time of infection and prior infusion should occur with better study adherence due to shorter average infusion intervals when there are less missed infusions, although a smaller number of infections do occur with a better study adherence. As shown in Fig. 2, all these patterns are confirmed. In addition, the same patterns are observed when the sample size is reduced to n = 700/group (Online Appendix A4).
In the second experiment, the multiple-dose approach is used to simulate AMPlike trials under perfect study adherence scenarios with = 0 and h 0 (t) = daily HIV incidence rate divided by exp( × 56) . Each trial includes n = 1500 VRC01 recipients in each of the 10 mg/Kg and 30 mg/Kg dose groups. Two values, 0.01 and 0.03, are considered in order to verify how risk of infection varies by within each dose group. Similar to the first experiment, the two dose groups share the same beta value under each scenario. Figure 3 shows that the probability of HIV infection within each 8-weekly infusion cycle is smaller as gets larger. This pattern is also expected because a higher indicates a larger association of the biomarker with reduced risk of infection. In addition, as desired, the rate of HIV infection increases over time (as concentration gets lower) within each infusion cycle, and the pattern remains the same over all cycles under the 'cycle-invariant' assumption described in Sect. 2.3. The same patterns are observed when the sample size is reduced to n = 700/group (Online Appendix A4).
In the third experiment, we expand the first experiment with a total of four values in both the high and medium adherence scenarios. We evaluate the empirical characteristics of ̂ . Specifically, within each simulated trial of n = 3000 VRC01 recipients, besides the cyclic and piecewise time-varying covariate, z(t) defined in (Sect. 2.2), we construct an indicator function, I(z(t) ≤ t s ) , as another time-dependent covariate. We then use a Cox proportional hazards regression model to regress time-to-infection on the product of z(t) and I(z(t) ≤ t s ) ; is the coefficient of this interaction term with its interpretation preserved as the per-day change in log-hazard The singledose approach is used in these simulations of 1000 trials, each with a total of n = 4500 participants randomized to receive ten 8-weekly infusions of 10 mg/Kg VRC01, 30 mg/Kg VRC01, or placebo in a 1:1:1 ratio. The high and medium adherence scenarios assume 2% and 10% of infusion visits missed, respectively. Additional assumptions are as follows: annual HIV incidence rate = 4% in the placebo group, = 0.03 or HR= 2.32 per 28 days for both VRC01 dose groups, and zero-protection concentration threshold s = 5 mcg/mL prior to t s within each dosing interval. As illustrated in Table 1, the maximum partial likelihood estimator of is close to zero empirical bias and Wald-type 95% confidence intervals for with the robust Huber sandwich variance estimator achieves nominal coverage as desired. This further confirms that data simulated using our proposed method maintain the intended nature and effect size of the cyclic and piecewise time-varying covariate.
In addition, our proposed methods have been applied to simulate survival data in the evaluation of pharmacokinetics marker correlates of outcome [31]. popPK models were used to estimate the marker value over time [2]. Satisfactory performance was observed in terms of type I error and statistical power to detect as statistically significant the hazard ratio of HIV infection associated with the pharmacokinetics marker.

Conclusions
In this paper, we considered simulating event time data with a continuous timevarying and piecewise covariate. The values of the covariate vary with time through multiple repetitive cycles, and its association with survival changes differently before and after a threshold within each cycle. The latter particularly accommodates settings with a zero-protection biomarker threshold, above which the drug provides a varying level of protection depending on the biomarker level, but below which the drug provides no protection. We proposed two simulation approaches: one based on simulating survival data under a single-dose regimen first before data are aggregated over multiple doses and another based on simulating survival data directly under a multiple-dose regimen. The derivations of the former are more straightforward for handling different event time distributions and can be more easily extended to data models with multiple protection threshold values within a cycle. The derivations of the latter are more compact, and simulations are generally faster than those based on the former approach. The latter approach is also more flexible to be extended to data models with cyclespecific z(t) functions.
Motivated by the AMP data example, we considered that the time-varying covariate values (i.e., log-transformed drug concentrations) change linearly with time before the protection threshold is reached. Similar derivations can be carried out for covariates that follow a more complex nonlinear relationship with time. In those cases, approximations may be needed in the inversion of the cumulative hazard function. The validity of our proposed methods was assessed in multiple simulation experiments. The results indicate that the proposed procedures perform well in producing data that conform to their cyclic and piecewise and the effect size of the time-varying covariate under a Cox model. An extension can be Table 1 Empirical characteristics of ̂U nder each scenario, the single-dose approach is used to simulate 1000 trials each with a total of n = 3000 participants receiving 10 mg/Kg VRC01 or 30 mg/Kg VRC01.
indicates the per-day increase in log-hazard of HIV infection for both dose groups. ̂ is estimated using a Cox proportional hazards model as described in Sect. 3. Reported are mean of ̂ , relative bias, RBias of datasets with Wald-type 95% confidence intervals including the true value of the parameter . The high and medium adherence scenarios assume 2% and 10% of infusion visits missed, respectively. Annual zero-protection HIV incidence rate is 4% with a zero-protection concentration threshold s = 5 mcg/mL considered to add the number of doses as another time-dependent covariate. Consequently, the 'cycle-invariant' assumption about the effect of the time-varying covariates not changing between cycles can hence be relaxed. Lastly, for drugs that do not satisfy the 'cycle-invariant' assumption, different coefficients can be assumed for each cycle and derivations of the simulation procedure based on the multiple-dose approach can be similarly extended for such data models.