Monolix
Auto Light Dark
Auto Light Dark

How Monolix generates the VPC for Time-To-Event data

The construction of a VPC plot for time-to-event data by Monolix requires several steps in the background:

  1. Simulation of datasets. First, Monolix simulates datasets using the population model, which contains the structural and statistical models and the estimated population parameters.

  2. Survival function estimators. Then, for the original dataset and each simulated dataset, it estimates the survival function with either the Kaplan-Meier estimator for exactly observed events or the Turnbull estimator for interval censored events.

  3. Prediction interval. Finally, Monolix calculates lower and upper percentiles of the simulated survival function estimates, which give a prediction interval.

Simulation of TTE data sets using a population model

Simulations of time-to-event datasets give, for each individual, times when an event occurs. The simulations are based on the same design as in the original data set, the same number of individuals as in the original data set and individual parameters are sampled using the covariates from this original data set and the population parameters estimated in Monolix.

To simulate a time when an event occurs, (u) is defined as a probability that an event (X) occurs before a certain time (T). This probability is computed using the cumulative hazard function (H(t))


Formula, u equals P of X less than or equal to T, which equals 1 minus exp of minus the integral from 0 to T of h of t and psi_i dt, which equals 1 minus exp of minus H of T.


where is a solution to the ODE system . A value of the probability is sampled from the uniform [0,1] distribution, thus in the above equation the time T becomes the unknown variable. A root finding method from an ODE solver finds its value.

The time T is not a given independent variable, but it is a simulated observation. Moreover, simulations are only until the time Tmax, which corresponds to the last time found in the data set. This value is the final integration time of the ODEs for each individual and it also defines a unique right censoring time for all individuals in the simulated data sets. It is independent of the individual times of events or right censoring in the original data set.

If the simulation fails because of a numerical error (e. g. because of a too high hazard), the simulated individuals with NaNs in their simulations are not used in the prediction interval, and the proportion of simulated individuals involved is then displayed in the interface.

The appearance of NaNs in the VPC simulations stops the generation of the VPC in Monolix versions prior to 2021R1. In Monolix versions starting at 2021R1, NaNs are ignored and the percentage of simulations giving NaNs is indicated in a warning message.

Example

In this example, the individual 3 in the original data set (table on the left) experienced an event at time 4. In the simulations (tables on the right), an event for this individual can occur before or after that time, or may occur after Tmax=5 (last table). Similarly, while the individual 5 left the study at time 3 without experiencing an event in the original data set, in the simulations for this individual an event can occur before or after time 3. If an event has not occurred at Tmax=5, then it is right censored.


Diagram of time-to-event data simulation. Left, the original data set table with columns ID, TIME and DV for 5 individuals, for example individual 3 has an event at time 4 and individual 5 is censored at time 3. An arrow labeled Tmax equals 5 leads to three possible simulated data sets with different event times, where individuals without an event before Tmax are right censored at time 5, shown in green with DV 0.


Possible sources of bias in the simulations

Censoring (dropout)

In the original dataset (input Monolix dataset), censoring can be at any time: because the patient drops out or because the study is stopped for instance. In contrast, simulated datasets have no dropout until the global Tmax over all individuals, which means that there are on average more events in the simulated datasets than in the original dataset. However, if censoring in the original dataset is truly random, simulating until the global Tmax over all individuals should not produce a bias because the “additional” simulated events are evenly distributed over time. But if censoring in the dataset is not truly random, the empirical Kaplan-Meier curve is biased while the VPC predictions are not, so it may appear as a misfit. If we would instead censor the simulated datasets at the same censoring times as in the original dataset (Tmax=5 for id 4 and Tmax=3 for ID 5 on the above example), this could introduce other bias.

Regressor

If the TTE model depends on a regressor, the regressor is interpolated using last value carried forward.

Doses

If the TTE model depends on a PK model with doses present in the dataset, it is important to also include the planned (but not given because of event or dropout) doses in the dataset such that the doses span the same time range for all individuals. Otherwise this will create a bias in the VPC.

Survival function estimators

Given some survival data that includes censoring (right-censoring or interval-censoring), a survival function can be estimated as a non-parametric maximum likelihood estimator (NPMLE).

Thus Monolix estimates an NPMLE for each simulated dataset, depending on the event type:

  1. Kaplan-Meier estimator for exactly observed events.

  2. Turnbull estimator for interval censored data.

The calculation of these estimators is detailed in the next sections.

Note: for interval censored data, the Turnbull estimator is used only in the VPC:

  • In the plot of Observed data, Monolix assumes that all events are exactly observed and displays the data using the Kaplan-Meier estimator explained in the previous section. This is because that plot is generated right after accepting the dataset, before a model has been selected. However, just looking at the dataset, the case of exact and interval censored events are indistinguishable. For example: assume that an observation period started at t=0 and at t=1 an event is marked by 1 in the column for the observation. Without any other information, the event could have occurred at t=1 or before.

  • In the VPC, Monolix uses the eventType information specified in the structural model. If “eventType = intervalCensored” is specified in the structural model, Monolix uses the Turnbull estimator for empirical and simulated survival curves in the VPC, in order to avoid bias in the survival function estimate. If eventType is not specified in the structural model, Monolix considers all interval-censored events as exactly observed at the end of a censored interval, and uses the Kaplan-Meier estimator.

DEFINITION: 
Event = {type = event, eventType = intervalCensored, intervalLength = L,
                maxEventNumber = 1, hazard = h}

Exact events: Kaplan-Meier estimator

The Kaplan-Meier estimator, or product limit estimator, is a type of non-parametric maximum likelihood estimator and a standard method to approximate the survival function S(t)

in the case of exact events. It describes the probability that an individual survives until time t, knowing that it survived at any earlier time. For single events, it is given by the following formula:

Formula image of the Kaplan-Meier estimator. S hat of t equals the product, over all i with t i less than t, of 1 minus d i over n i.

where

  • – times before t, when at least one event occurred,

  • – number of events at the time ,

  • – number of individuals at risk, that is who did not experience an event until .

The probability ( ) of an event is the ratio between the number of occurred events ( ) and the number of individuals at risk ( ). The complement of it, , gives an estimation of the survival. For each time t, the total number of individuals at risk, who survived, may change. Thus, the current survival probability is the product of all probabilities at previous times , when at least one event occurred.

This formula can be better understood by calculating for example the probability that a patient survives 2 days: it is a product of two probabilities: the probability that the patient survives the first day and a conditional probability that they survive the second day, knowing that they survived the first one.

Example

On the left of the figure below, a typical example of a time-to-event data set contains information about exact times when individuals experienced an event (T=1) or when they left the study (drop-out: T=0). Five individuals have two observations each: the time at which the observation starts (T=0 for everyone) and the time of an event. If a patient leaves the study, then the dataset contains a drop-out time with T=0, instead of T=1, in the column for the observations. This means that the patient experienced no event but survived until the drop-out time. The Kaplan-Meier estimator takes into account such situations, because these individuals are not counted as individuals at risk (they are not counted in the denominator ) at later times.


Kaplan-Meier example in three parts. Left, a data set table with columns ID, t and T for 5 individuals. Middle, a table of the estimator at each event time, for example at t equals 3, with d i equals 2 and n i equals 4, it is 1 times 1 minus 1 over 5 times 1 minus 2 over 4. Right, a step plot of survival function versus time dropping from 1 to 0.8 at time 1, to 0.4 at time 3 and to 0 at time 5, with a red dot marking the drop-out at time 4.


 

The study starts at time t1. There are no events, so d1=0 and the value of the Kaplan-Meier estimator is 1. Until the next event time at t2=1, the estimator remains constant. At that time, one individual experienced an event, hence d2=1, and all individuals survived until that time so n2=5. As a result, the probability to survive decreases by 0.2. It is the height of the jump at t=1 in the plot. The Kaplan-Meier estimator remains constant until the next event. At time t=3 there are two events. The number n3 counts now only 4 individuals – it has decreased by 1 due to the previous event. The final probability at time 3 is a product of all earlier probabilities. At t=4 there is a drop-out: patient 5 left the study without experiencing an event. The survival curve remains constant and a red dot marks the drop-out. The Kaplan-Meier estimator takes into account this situations, because at the next event time t=5, this individual is not counted as an individual at risk – thus the denominator n will be smaller. Finally, at time t=5, there is only one individual left, and one event, so the survival becomes 0.

Remarks
  • The Kaplan-Meier estimator handles correctly the information about individuals who left the study (right-censoring), but there is a bias when the exact times of events are unknown (interval-censoring).

  • In the TTE VPC, Monolix estimates a linear approximation of the Kaplan-Meier estimate.

Interval censored events: Turnbull estimator

The Turnbull estimator is a generalization of the Kaplan-Meier estimator that allows for interval censoring. In the TTE VPC, Monolix uses this estimator to plot both the empirical and simulated survival curves.

Interval censored events do not occur at exact times , , but within some time intervals between times and , . In case of right censored data (dropout), is the time when the individual leaves the study, and : an event will occur within the interval .

In the TTE VPC, the intervals are:

  • For the empirical survival curve, they correspond to the censoring intervals of the original data set.

    • For simulated survival curves, the definition of these intervals depends on whether the structural model contains the option “intervalLength” or not:

      • If “intervalLength=L” is given, then the intervals are

  • If “intervalLength” is missing, then the whole period of observation defined with the minimal and maximal times in the data is split in 10 regular intervals.

Simulations of interval censored datasets give, as in the case of exactly observed events, exact times of events for each individual. In order to compare the simulated survival to the empirical survival without bias, simulated events are counted in regular intervals to be transformed into interval censored events, and they are then represented in the VPC with the Turnbull estimator just like for the empirical survival.

Turnbull intervals

The Turnbull estimator is computed on time intervals that are called Turnbull intervals:

Formula image defining the Turnbull grid. 0 equals tau 0, less than or equal to tau 1, less than or equal to and so on up to tau m, less than or equal to tau m plus 1, which equals infinity.

This grid of times is constructed from all points for in increasing order.

Turnbull algorithm
Notations
  • The probability that an event occurs in a j-th Turnbull interval is

Formula image. p j equals the probability that T lies between tau j minus 1 and tau j, which equals S of tau j minus 1 minus S of tau j.
  • For each individual i: denotes a weight such that

Formula image defining the weight alpha i j as an indicator equal to 1 when the Turnbull interval from tau j minus 1 to tau j is contained in the censoring interval from L i to U i.
  • The Weight αij is an event indicator – it indicates whether an event from the interval occurred at .

  • is the number of events until and is the number of individuals at risk at

  • The likelihood function for is:

Formula image of the likelihood. L S of p equals the product over i from 1 to n of S of L i minus S of R i, which equals the product over i from 1 to n of the sum over j from 1 to m plus 1 of alpha i j times p j.
Main idea of the Turnbull algorithm

Finding the NPMLE of , denoted by , means maximizing under the constraint that are positive and . The original Turnbull algorithm (1976) is the first and the simplest method to maximize with respect to p. It is an application of the Expectation-Maximization (EM) algorithm.

Remark: depends only on values of S at points , and the behaviour of S within the Turnbull intervals is unknown. The convention applied here is: when . 

Procedure

The algorithm is the following:

  • Step 0: Initialization – choose an initial guess for . This initial guess for S is the estimate obtained from the Kaplan-Meier estimator under the assumption that events occur at , interpolated on the –grid.

  • Step 1: Compute the probability of an event at time as

Formula image for Step 1. p j equals S old of tau j minus 1 minus S old of tau j, for j equals 1 to m.
  • Step 2: Estimate the number of events at as

Formula image for Step 2. d tilde j equals the sum over i from 1 to n of alpha i j times p j, divided by the sum over k from 1 to m of alpha i k times p k, for j equals 1 to m.
  • Step 3: Compute the estimated number of individuals at risk at time

Formula image for Step 3. n tilde j equals the sum over k from j to m of d tilde k, for j equals 1 to m.
  • Step 4: Compute using the Kaplan-Meier estimator using and to update the survival function

  • Stopping criterion: If the updated solution is close to the old solution (in Monolix, ), stop, otherwise set and repeat steps 1 – 4

Linear approximation

In the TTE VPC, just like for the the Kaplan-Meier estimate, Monolix calculates a linear approximation of the Turnbull estimate.

Example

Below we show a small dataset with interval censored events. The individuals are in increasing order of the times at which censored intervals end. The figure on the rights shows two curves:

  • The upper bound curve is the Kaplan-Meier estimate assuming that events occur exactly at the upper interval limit .

  • The lower bound curve is the Kaplan-Meier estimate assuming that events occur exactly at the lower interval limit .


Turnbull example. Left, a data set table with columns ID, time and Yobs for 4 individuals with interval limits L1 U1, L2 U2 and L4 U4, while individual 3 is censored at L3 without an event. Right, a step plot of survival levels S0 to S4 versus Turnbull grid points tau 0 to tau 7, with a blue upper bound curve assuming events at U i and an orange lower bound curve assuming events at L i.


For comparison, we show now a similar dataset corresponding to exactly observed events at the upper interval limit. The figure on the right shows again the Kaplan-Meier estimator, and in addition its linear approximation.


Comparison with exactly observed events. Left, a table with columns ID, time and Yobs, with events at t1, t2 and t4 and individual 3 censored at t3. Middle, Kaplan-Meier estimator values, S 0 equals 1, S 1 equals three quarters, S 2 and S 3 equal one half, S 4 equals 0. Right, a plot of the blue step Kaplan-Meier estimator and its red linear approximation joining the step corners from S0 to S4.


Procedure

The time points of the lower and upper interval limits for all individuals are ordered in increasing sequence. In this example, the assumption is

Formula image ordering the interval limits in this example. 0 less than L1 less than U1 less than L4 less than L2 less than U2 less than L3 less than U4.
Formula image of the Turnbull grid for this example. 0 less than tau 1 less than tau 2 less than tau 3 less than tau 4 less than tau 5 less than tau 6 less than tau 7.

The Turnbull intervals are the intervals , where , with and .

The weights are elements of the following matrix:


Table of weights alpha i j. Rows are individuals with censoring intervals L1 to U1, L2 to U2, L3 to infinity and L4 to U4. Columns are the Turnbull intervals from 0 to L1 up to U4 to infinity. Red ones mark contained intervals, alpha 1 in L1 to U1, alpha 2 in L2 to U2, alpha 3 in L3 to U4 and U4 to infinity, alpha 4 in the four intervals from L4 to U4. All other entries are 0.


First iteration of the algorithm

Step 0: The initial guess is the upper bound curve, that is the Kaplan-Meier estimator under the assumption that events occur at , interpolated on the –grid.

Formula image for Step 0, the initial guess. S old at tau 0 and tau 1 equals 1, at tau 2, tau 3 and tau 4 equals S1, at tau 5 and tau 6 equals S2, and at tau 7 and tau 8 equals S4.

Step 1: The probabilities that events occur in the Turnbull intervals are

Formula image for Step 1 in the example. p1, p3, p4, p6 and p8 equal 0, p2 equals 1 minus S1, p5 equals S1 minus S2, and p7 equals S2 minus S4.

Step 2: Modified number of events

Step 3: Modified number of individuals at risk

Step 4: Kaplan-Meier estimator for the modified values of d and n:

The figure below compares the linear approximations of Turnbull estimate at the start of the first iteration ( ) and at the end ( ), as well as the linear approximation of the Kaplan-Meier estimate in case of exact events.


Plot comparing survival estimates on the Turnbull grid tau 0 to tau 7. Dashed grey shows the Kaplan-Meier estimator for exact events, blue its linear approximation, orange the Turnbull S-old and red the Turnbull S-new. After tau 4 the red S-new curve drops below S-old, staying lower between tau 5 and tau 6, and both curves end at S4 at tau 7.


  • The difference between the blue curve and comes from the fact that is interpolated on a grid including the time points while they are not included in the grid considered in the case of exact events.

  • The first iteration of the Turnbull agorithm has the effect of lowering compared to after , which is due to the fact that the event in may have already occured after that point.

Mean number of events estimator

In case of repeated time-to-event data with several events per individual, the survival function plot takes into account only the first event for each individual. A better overview of the data is provided by the Mean number of events per subject plot.

The mean number fo events per subject curve is constructed in the following way: for each ith event (i.e the first event for all individuals, the second event, etc), the corresponding survival curve is calculated using the Kaplan-Meier estimator for exactly observed events or the Turnbull estimator for interval censored events (as if the data would contain only the ith event of each individual). The mean number of events per individual curve is then computed as:

with the maximal number of events per individual, and the number number of ith events.

Prediction interval

To generate the prediction interval in the VPC plot, Monolix performs by default 500 simulations with N individuals as in the original data set. As a result, it produces 500 time series that form 500 survival curves (based on Kaplan-Meier or Turnbull estimators). Since simulated event times are random numbers, all estimated survival functions have different time grids. This is shown on Fig.(a) with two different simulated datasets.

The interpolation of these curves on a fixed time grid allows to calculate the prediction interval. In Monolix the default time grid consists of a uniform grid with 100 points. For exactly observed events, the grid includes in addition all time points from the original data set to provide all possible information. Exact event times are unknown for interval censored events, so dataset time points have no additional information. This is shown on Fig.(b) with the Kaplan-Meier plot from the simulated dataset 1 from Fig.(a), interpolated on a different time grid than its events, combining regularly spaced points at times 0, 10, 20, …, 100, and additional time points indicated in green that come from the original dataset.). 

The interpolation on the new grid gives at each time point of the grid a set of probabilities corresponding to different simulated survival curves. It allows to calculate lower and upper percentiles (the 5th and 95 percentiles are the default choice) and draw the prediction interval. This is shown on Fig.(c) with the survival estimators from multiple simulations on the same time grid as on Fig. (b).


Three plots illustrating the prediction interval. Fig. a, two simulated Kaplan-Meier survival curves, blue and orange, each with its own event times. Fig. b, simulated dataset 1 interpolated on a fixed grid of times 0, 10, 20 up to 100 plus extra dataset time points in green such as 8, 24, 45 and 96. Fig. c, survival values from many simulations as red dots at each grid time, with lower and upper percentile lines forming the prediction interval.


Example: exactly observed events

The dataset contains times of exactly observed single events of 30 individuals. The survival model has a constant hazard function and the Kaplan-Meier estimator approximates the survival function. The VPC plot uses a linear approximation of the Kaplan-Meier curve (Fig. on the left). By default, the fixed grid has 100 uniformly distributed points together with all time points from the date set. The figure on the left presents the VPC plot with the default settings. The approximation of the empirical and simulated Kaplan-Meier curves is sufficient on the default grid. In contrast, the VPC on the Figure on the right uses a grid with only time points from the original dataset. The accuracy of the prediction interval is decreased.


Two Monolix TTE VPC plots of survival function versus time from 0 to 100, each with the empirical curve and a blue 90 percent prediction interval beside the Display settings. Left, Number of data points under Calculations is 100, highlighted, and the band follows the steps closely. Right, it is set to 2, highlighted, so mainly dataset time points are used and the prediction interval is less accurate.


Example: interval censored events

In this dataset, the times of events from the previous example are the ends of time intervals within which events occurred. The length of the censored intervals in the dataset is non constant among individuals, and oscillates around 5. The structural model includes this information in eventTime and intervalLength options.


Monolix TTE VPC for interval censored events, survival function versus time from 0 to 100, with the empirical curve and a blue 90 percent prediction interval. In the Display settings, Empirical and Prediction interval are on, and the Calculations field Number of data points, set to 100 with allowed values between 2 and 10000, is highlighted.


Last updated: