Tutorials
Auto Light Dark
Auto Light Dark

A TTE model for the NCCTG lung cancer study

This case study shows how to build and validate a parametric survival model using the NCCTG lung cancer dataset, identify key covariates, and simulate survival in new patient cohorts. The step-by-step workflow uses Monolix, Simulx, and R to support prognosis and explore the impact of patient characteristics on survival outcomes.

Download data set only | Download all Monolix and Simulx project files | Download RsSimulx scripts

This time-to-event case study represents a detailed modeling and simulation workflow using MonolixSuite applications. It is recommended to read before the Introduction to TTE data and library of models in Monolix.

Another case study on time-to-event data is also available: Case study on veteran lung cancer data set

In this case study, we develop a model for the NCCTG survival data set and study the effect of covariates.

Introduction

The North Central Cancer Treatment Group (NCCTG) data set records the survival of 228 patients with advanced lung cancer, together with assessments of the patients performance status measured either by the physician and by the patients themselves. The goal of the study was to determine whether patients self-assessment could provide prognostic information complementary to the physician’s assessment.
This data set has been originally presented and analyzed in:

Loprinzi et al. (1994). Prospective evaluation of prognostic variables from patient-completed questionnaires. North Central Cancer Treatment Group. Journal of Clinical Oncology : Official Journal of the American Society of Clinical Oncology, 12(3), 601–607. 

This case study will test several parametric models to fit the dataset and assess the prognostic performance of the recorded covariates.

Data set visualization

The data set contains 228 patients, including 63 patients that are right censored (patients that left the study before their death). The original data set has been reformatted according to the data set formatting guidelines and includes both the starting time and the time of death or drop out.
To assess the importance of self performance assessment versus physician’s assessment, the following covariates have been recorded:

  • ecogPH: ECOG (Eastern Cooperative Oncology Group) performance status assessed by the physician, on a scale from 0 (fully active) to 5 (dead). For information on the scale, click here.

  • karnoPH: Karnofsky performance status, assessed by the physician, on a scale from 0 (dead) to 100 (completely healthy). More details about the scale can be found here.

  • karnoPAT: Karnofsky performance status, assessed by the patient

  • sex: sex of the patient (F for female, M for male)

  • age: age of the patient (years)

Excerpt of the NCCTG lung cancer data set for the first four patients, with columns ID, TIME, Y, age, sex, ecogPH, karnoPH and karnoPAT. Each patient has a row at time 0 with Y 0 and a row at the time of death, Y 1, or censoring, Y 0, for example patient 1 dies at 306 and patient 3 is censored at 1010.

First, use Monolix to visualize the data set. After opening Monolix, start a new project and load the data, ensuring that covariates are assigned to the appropriate tags (continuous or categorical). In the Data Information section, specify that the data is of the EVENT type to visualize time-to-event data.

Monolix Data tab after loading the NCCTG data set. Columns are tagged ID, TIME, OBSERVATION for Y, continuous covariates age, karnoPH and karnoPAT, and categorical covariates sex and ecogPH. In Data information, Y is set to the EVENT type. The table shows 456 entries for 228 individuals, with an ACCEPT button.

Once the dataset is accepted, the Kaplan-Meier (KM) estimate of the survival curve will appear in the Plots tab. In the “Settings” panel (right side), options are available to add the mean number of events curve and display censored data.

Monolix Plots tab, Observed data, showing the Kaplan-Meier survival curve of the NCCTG data. Survival function on the y axis falls from 1 to about 0.05 over time 0 to about 1000. Red dots mark censored data. In the Settings panel, the Censored data toggle under Display is highlighted.

The Kaplan-Meier curve cannot be stratified by “coloring”, but you can split it and then a “merge” with a button that appears. It will merge the plots in one figure with different colors (fixed) for each curve. Add legend to visualize the assignment of colors to each stratification group.

Two Kaplan-Meier survival plots of the observed data split by covariate. Left, by sex, females survive longer than males, for example about 0.5 versus 0.3 at time 400. Right, by age groups 39 to 63 and 63 to 82, the two curves largely overlap, suggesting little effect of age.
Three Kaplan-Meier plots of observed survival split by performance score. By ecogPH 0, 1, 2 and 3, survival is lower for higher scores, and ecogPH 3 has a single patient with a vertical drop near time 120. By karnoPH 50 to 80 versus 80 to 100 and by karnoPAT 30 to 80 versus 80 to 100, the higher score group survives longer.

Note that ECOG, karmoPH and karnoPAT are all performance scores and that they are probably strongly correlated.

In the Covariate Statistics section of the data tab, it can be seen that only one subject in the population has category 3 as the ECOG PH score:

Covariate statistics table of categorical covariates. ecogPH counts are 63 for 0, 114 for 1, 50 for 2 and 1 for 3, with the single subject in category 3 highlighted. sex counts are 90 F and 138 M.

It can therefore be assumed that the score of this subject has a negligible impact on the population. Modalities 2 and 3 of the ECOG PH score can thus be pooled:

Monolix Kaplan-Meier plot stratified by ecogPH after pooling modalities 2 and 3 into one group in the Stratify panel, highlighted, with Merged splits on. The three curves ecogPH 0, 1 and 2-3 show that survival decreases as the ECOG score increases, with group 2-3 the lowest.

Modeling with Monolix

A model for this dataset will be developed to analyze which covariates have the highest prognostic performance. Within the MonolixSuite, only parametric models for time-to-event data are possible (no non-parametric or semi-parametric approaches).

Structural model

The development of the structural model begins by considering the typical shapes of common parametric survival models, as presented in the introduction to time-to-event modeling, along with the library of common TTE models. Based on the Kaplan-Meier curve visualization, models such as Weibull, log-logistic, gamma, or Gompertz could be appropriate. Each model is tested in turn by selecting the files with the extension "_singleEvent.txt" from the library.

For models with two parameters, it is common practice to assume that the shape parameter remains constant across individuals, while the scale parameter can vary between them. This inter-individual variability can be explained by the effect of covariates or random effects (often referred to as frailty models). Following this approach, random effects are disabled for the shape parameters ( and ) by adjusting the corresponding diagonal element of the variance-covariance matrix, while random effects are retained for the scale parameter . The default log-normal distributions are kept to ensure positive values for the parameters.

In each model, the scale parameter is represented by the characteristic time . Based on the Kaplan-Meier data visualization, an initial value of 300 is chosen, corresponding to a survival rate of around 50%. The shape parameter is initialized at 1, according to the typical value chart provided on the introduction page to TTE modelling. Starting from the Monolix2021R1 version, the auto-initialization is available also for time-to-event data.

Monolix Initial estimates tab for project r02_weibull, with the AUTO-INIT button. Population distribution parameters show Te_pop about 417.7 and p_pop about 1.316.

Next, the estimation tasks are launched for each structural model in turn: estimation of the population parameters, individual parameters, standard errors via the Fisher Information Matrix, log-likelihood estimation, and generation of graphics. The performance of each structural model can then be assessed and compared using the TTE graphics and log-likelihood values. A Sycomore project is used to organize and compare different models.

Sycomore Hierarchy view comparing five structural models, r01_exp, r02_weibull, r03_gompertz, r04_loglogistic and r05_gamma. Highlighted columns of -2LL and BICc by importance sampling rank r02_weibull best, with -2LL about 2307.7 and BICc about 2319.9, and r01_exp and r04_loglogistic worst.

After each run, the VPC can be reviewed. A summary is presented below:

Five VPC plots for time-to-event data, one per structural model, Exponential, Weibull, Gompertz, Loglogistic and Gamma, each showing the empirical Kaplan-Meier curve over a shaded 90 percent prediction interval with OFV, AIC, BIC and BICc. The exponential and log-logistic intervals miss the curve at late times. Weibull has the lowest BIC, about 2318.5.

The "empirical" toggle in the VPC for time-to-event data refers to displaying the Kaplan-Meier survival curve based on the observed data. This shows the real survival behavior without model assumptions. The prediction interval with a 90% level reflects the range in which 90% of the model's simulated survival curves fall. If the empirical curve lies mostly within this interval, it suggests the model predictions align well with the observed data, indicating an acceptable model fit.

From a visual point of view, the exponential, log-logistic and gamma models can be excluded as they do not capture the shape of the KM curve. The Weibull and Gompertz models are satisfactory, with a slight preference for the Weibull model, as indicated by the BIC values. Therefore, the Weibull model is selected as the final structural model.

Covariate model

The investigation of covariates on the parameter focuses on explaining inter-individual variability. For educational purposes, covariate search will be conducted manually in a stepwise manner. In Monolix, using a backward covariate search approach is especially powerful. Indeed, after having calculated the s.e, a Wald test is performed to test the significance of each covariate. Thus it is sufficient to estimate the parameters of the model including all covariates relationships to get a p-value for each relationship, without having to estimate the submodels with one covariate relationship less. Following this strategy, we will estimate the model with all available covariates on and stepwise remove the less significant relationship, until all remaining covariates are significant. The AIC and BIC will also be monitored in parallel.

Since only one subject has an ecogPH score of 3, this modality can be combined with the ecogPH score 2 modality into a single category. To add the covariate, use the ‘Discrete' button to create a new categorical covariate, assigning both '2' and '3' to the reference group 'G_2_3’.

Monolix dialog Define a new categorical covariate, with Function of set to ecogPH and name tEcogPH, opened with the highlighted DISCRETE button. Modalities are grouped into G_0, which is selected as reference, G_1, and G_2_3 containing modalities 2 and 3, highlighted.

All covariates are added to the Te parameter in the "Covariate model" section. This corresponds to defining a model for that includes the influence of all selected covariates:

The table below summarizes the stepwise covariate removal, based on the p-values, and information criteria AIC, BICc and OFV:

Table of the stepwise backward covariate search on Te. Starting with age, sex, tEcogPH, karnoPH and karnoPAT, age, then karnoPH, then karnoPAT are removed based on the highest p-value. The model with sex and tEcogPH, highlighted in green, has all covariates significant, AIC 2288.95, BICc 2309.56 and OFV 2278.95. Sex alone gives a worse AIC of 2303.29.

The models with (sex, tEcogPH, karnoPAT) and (sex, tEcogPH) have similar AIC and BIC values. However, the model including (sex, tEcogPH, karnoPAT) has a high condition number (around 300). The condition number, which is the ratio of the maximal and minimal eigenvalues, indicates whether the model may be over-parameterized. A low condition number (i.e., less than 100) suggests a well-specified model. Due to this, the (sex, tecogPH) model is preferred.

Final model

The final model incorporates a Weibull structural model with sex and ecogPH as covariates on the scale parameter Te. The model improvement when karnoPAT is included in addition to ecogPH is very small indicating that a self-assessment of the performance status by the patient permits only a slightly better prognosis, compared to using the physicians ECOG performance status evaluation only. In the original study including more patients and different types of cancer, the value of patient self-assessment was higher.

The estimated population parameters are displayed below. The r.s.e are reasonable.

Monolix table of population parameter estimates for the final Weibull model. Te_pop 732.1, beta_Te_sex_M -0.408, beta_Te_tEcogPH_G_1 -0.308, beta_Te_tEcogPH_G_2_3 -0.707 and p_pop 1.36, with standard errors and relative standard errors between about 6 and 47 percent, and 95 percent confidence bounds.


The 90% prediction interval for the KM curve shows that the data is properly captured. The other graphics do not hint at any model mis-specification. 

VPC for time-to-event data of the final Weibull model with sex and ecogPH on Te. The empirical Kaplan-Meier curve, falling from 1 to about 0.05 over 1000 days, lies within the shaded 90 percent prediction interval over the whole time range, showing that the data are properly captured.

For a given sex and ecogPH score, the typical hazard and associated Weibull survival can be calculated analytically:

Using the survival function, it is possible to determine the probability of surviving for at least 6 months (182.5 days), 1 year (365.25 days), or 2 years (730.5 days), based on sex and ECOG score:

Table of the probability to survive 6 months, 1 year and 2 years by sex and ECOG score. For males, ECOG 0 gives 77, 51 and 18 percent, ECOG 1 gives 67, 36 and 7 percent, ECOG 2 and 3 gives 50, 17 and 1 percent. For females, ECOG 0 gives 86, 68 and 37 percent, ECOG 1 gives 79, 55 and 22 percent, ECOG 2 and 3 gives 67, 36 and 7 percent.

The probability density function of the death event can be calculated analytically as the product of the hazard and survival functions, based on a given sex and ECOG score. The probability of death over time for three different cases is shown below. This plot can also be interpreted as the distribution of death times in each of the three sub-populations.

Plot of the probability density of death versus time in days, 0 to 1000, for six categories combining sex and ECOG score. Male ecog2_3 has the sharpest and earliest peak, about 0.003 near 90 days, while Female ecog0 has the flattest curve, about 0.001, with deaths spread to later times.

Simulations using Simulx GUI

The model developed in Monolix can be applied to simulate new populations. In this case, three new patient cohorts with different covariate profiles compared to the original data set will be simulated. The three cohorts have the following characteristics:

  • cohort 1: 50% male / 50% female, good ECOG scores (0 or 1)

  • cohort 2: 50% male / 50% female, poorer ECOG scores (2 or 3)

  • cohort 3: 90% male / 10% female, good ECOG score (0 and 1)

To simulate these three cohorts, the final Monolix project is imported into Simulx. The model (structural and statistical), parameters (population and individual), outputs and covariates are imported from the Monolix project and its data set. In the Simulation tab of Simulx, the default scenario corresponds to re-simulating a dataset used in the Monolix project.

Simulx Simulation tab with the default scenario imported from the Monolix project. Single simulation is selected, one shared group of size 228 uses parameters mlx_Pop, output mlx_Event and covariates mlx_Cov. A New group button is available to add groups.

To simulate new cohorts, three groups are created, each with a specific covariate element corresponding to the defined characteristics. For instance, cohort 1 is configured as follows:

Simulx dialog New covariates from distribution, Distribution tab, defining covariate element cohort_1. Categorical covariate sex has probability 0.5 for F and 0.5 for M, and ecogPH has probability 0.5 for 0, 0.5 for 1 and 0 for 2 and 3.

After running the scenario, the three Kaplan-Meier curves (one per group) are displayed in the Plots tab.

Simulx Plots tab, output distribution, showing one simulated Kaplan-Meier survival curve per group, Group1_50F_50M_goodECOG, Group2_50F_50M_poorECOG and Group3_10F_90M_goodECOG. Group 2 with poor ECOG drops fastest, near 0 by about 750, while Group 1 keeps the highest survival, about 0.1 at 1000.

Since the time of death is a random variable, multiple simulations of the same population will result in different survival curves. To evaluate the uncertainty around the survival curve, replicates are generated by switching the simulation mode from "Single simulation" to "Replicates" in the scenario definition, with the number of replicates set to 100. The outputs now represent the prediction interval for the Kaplan-Meier curve.

Simulx Plots tab for project s02_3cohorts_100reps, showing the simulated Kaplan-Meier curve of each of the three cohorts with a shaded prediction interval from 100 replicates, up to time 750. The poor ECOG group has the lowest survival, about 0.04 at the end, versus about 0.2 for Group1 and 0.14 for Group3.

To quantitatively compare the median survival, the post-processing tool in Simulx, called "Outcomes & Endpoints," is used. It calculates how many individuals survive for a specific duration and assesses the uncertainty of this result when simulating replicates. For instance, an outcome can be created to determine if an individual “has no event” between the observation's start (time = 0) and the end (time = 750).

Simulx outcome definition dialog named has_no_event, using output Observation_until_750 with the option has no event selected, rather than has event or time of event.

Then, this outcome is used in the definition of an endpoint: percent true

Simulx Outcomes and endpoints section with outcome has_no_event and endpoint percentage_survived defined as Percent true. Group comparison is off, and the reference group is Group1_50F_50M_goodECOG.

The results are presented in the results tables and as a boxplot in the plots tab:

Simulx boxplot of the endpoint percentage_survived across 100 replicates for the three cohorts. Median percent surviving is about 19.5 for Group1_50F_50M_goodECOG, about 3.5 for Group2_50F_50M_poorECOG, and about 13.5 for Group3_10F_90M_goodECOG, so the poor ECOG cohort has the lowest survival.

The simulations performed in Simulx can also be conducted in R using either the RsSimulx package or the lixoftConnectors package.

Simulations scripting with RsSimulx

The documentation on the RsSimulx R-function can be found here.

The same approach used in the previous section "Simulations using Simulx GUI" is applied here for simulating three new cohorts with different covariates:

  • cohort 1: 50% male / 50% female, good ECOG scores (0 or 1)

  • cohort 2: 90% male / 10% female, good ECOG score (0 and 1)

  • cohort 3: 50% male / 50% female, poorer ECOG scores (2 or 3)

The three groups are created via a data frame defining individual covariates, which are then passed as input to the simulx() function. This function returns an R object with the simulation results (time of death for each individual). These results can then be visualized with the kmplotmlx function, producing Kaplan-Meier survival curves.

For cohort 1, the corresponding R code reads as follows:

#========== defining group 1
# covariate data frame for group 1, with column id and one column per covariate
cov1 <- data.frame(id=1:228,
                   sex     = c(rep("F",114),rep("M",114)),
                   ecogPH  = rbinom(n=228, size=1, prob=0.5), 
                   karnoPH = rnorm(228,mean=80,sd=12.3),      #unused in model but must be present
                   karnoPAT= rnorm(228,mean=80,sd=14.5),      #unused in model but must be present
                   age     = rnorm(228,mean=63,sd=9))         #unused in model but must be present
          
#============= calling simulx for group 1
res1 <- simulx(project  = project.file,
               covariate= cov1)

The output objects are combined into one and plotted using the following command:

#============= plotting the KM survival curve
group.labels <- c("50% M/50% F, ECOG 0-1", "50% M/ 50% F, ECOG 2-3","90% M/10% F, ECOG 0-1" )
km <- kmplotmlx(EvRes,labels=group.labels,facet=FALSE) + 
  xlab("Time (days)") + 
  ylab("Survival") + 
  theme(legend.position = "bottom")

The prediction is as follows:

R plot of Kaplan-Meier survival curves simulated with RsSimulx for three cohorts over 1000 days. The 50 percent male, ECOG 0-1 group has the highest survival, about 0.15 at the end, the 90 percent male, ECOG 0-1 group is intermediate, about 0.06, and the 50 percent male, ECOG 2-3 group is lowest, about 0.01.


Since the time of death is a random variable, multiple simulations of the same population will result in different survival curves. The uncertainty of the survival curve can be assessed by performing replicates, which can be easily achieved by including the argument nrep.

res1 <- simulx(project  = project.file,
               covariate= cov1,
               group    = list(size=50),
               nrep     = 100)

A prediction interval for the three survival curves is then obtained:

Three R panels of simulated Kaplan-Meier survival curves with prediction intervals from 100 replicates, one per cohort, 50 percent male ECOG 0-1, 50 percent male ECOG 2-3, and 90 percent male ECOG 0-1. Shaded blue bands show probability levels from 0.1 to 0.9 around the median curve, and the ECOG 2-3 cohort declines fastest.

Conclusion

The MonolixSuite is a powerful tool for modeling and simulating time-to-event data via a parametric approach. Covariates, frailty models, and censoring can easily be incorporated. Built-in statistical tests and diagnostic plots (in particular, the “visual predictive check for TTE data”) render the model development process straightforward.

With the lung cancer data set of this case study, the risk of death increases over time (Weibull distribution of death times). Sex and the ECOG performance score are significant covariates and thus prognostic factors. Performance scores assessed by patients rather than physicians can also serve as prognostic factors, but their utility in addition to the physician-measured score is minimal.

Thanks to the parametric formulation of the model, survival probabilities depending on sex and ECOG score can easily be computed. Additionally, simulations of cohorts with combinations of covariates can be performed using Simulx, and the uncertainty of the resulting survival curve can be visualized.

Last updated: