Skip to main content

Simulating Duration Data for the Cox Model

  • Jeffrey J. Harden and Jonathan Kropko

The Cox proportional hazards model is a popular method for duration analysis that is frequently the subject of simulation studies. However, no standard method exists for simulating durations directly from its data generating process because it does not assume a distributional form for the baseline hazard function. Instead, simulation studies typically rely on parametric survival distributions, which contradicts the primary motivation for employing the Cox model. We propose a method that generates a baseline hazard function at random by fitting a cubic spline to randomly drawn points. Durations drawn from this function match the Cox model’s inherent flexibility and improve the simulation’s generalizability. The method can be extended to include time-varying covariates and non-proportional hazards.

Hide All

Jeffrey J. Harden is an Assistant Professor in the Department of Political Science, University of Notre Dame, 2055 Jenkins Nanovic Halls, Notre Dame, IN 46556 ( Jonathan Kropko is an Assistant Professor of in the Department of Politics, University of Virginia, S383 Gibson Hall, 1540 Jefferson Park Avenue, Charlottesville, VA 22904 ( The methods described here are available in the coxed R package. To view supplementary material for this article, please visit

Hide All
Austin, Peter C. 2012. ‘Generating Survival Times to Simulate Cox Proportional Hazards Models with Time-Varying Covariates’. Statistics in Medicine 31(29):39463958.
Benaglia, Tatiana, Jackson, Christopher H., and Sharples, Linda D.. 2015. ‘Survival Extrapolation in the Presence of Cause Specific Hazards’. Statistics in Medicine 34(5):796811.
Bender, Ralf, Augustin, Thomas, and Blettner, Maria. 2005. ‘Generating Survival Times to Simulate Cox Proportional Hazards Models’. Statistics in Medicine 24(11):17131723.
Box-Steffensmeier, Janet M., and Jones, Bradford S.. 2004. Event History Modeling: A Guide for Social Scientists. New York: Cambridge University Press.
Box-Steffensmeier, Janet M., Linn, Suzanna, and Smidt, Corwin D.. 2014. ‘Analyzing the Robustness of Semi-Parametric Duration Models for the Study of Repeated Events’. Political Analysis 22(2):183204.
Chastang, Claude, Byar, David, and Piantadosi, Steven. 1988. ‘A Quantitative Study of the Bias in Estimating the Treatment Effect Caused by Omitting a Balanced Covariate in Survival Models’. Statistics in Medicine 7(12):12431255.
Cox, Christopher, Chu, Haitao, Schneider, Michael F., and Munoz, Alvaro. 2007. ‘Parametric Survival Analysis and Taxonomy of Hazard Functions for the Generalized Gamma Distribution’. Statistics in Medicine 26(23):43524374.
Crowther, Michael J., and Lambert, Paul C.. 2013. ‘Simulating Biologically Plausible Complex Survival Data’. Statistics in Medicine 32(23):41184134.
Desmarais, Bruce A., and Harden, Jeffrey J.. 2012. ‘Comparing Partial Likelihood and Robust Estimation Methods for the Cox Regression Model’. Political Analysis 20(1):113115.
Hendry, David J.. 2014. ‘Data Generation for the Cox Proportional Hazards Model with Time-Dependent Covariates: A Method for Medical Researchers’. Statistics in Medicine 33(3):436454.
Hyman, James M.. 1983. ‘Accurate Monotonicity Preserving Cubic Interpolation’. SIAM Journal on Scientific and Statistical Computing 4(4):645654.
Jackson, Dan, White, Ian R., Seaman, Shaun, Evans, Hannah, Baisley, Kathy, and Carpenter, James. 2014. ‘Relaxing the Independent Censoring Assumption in the Cox Proportional Hazards Model Using Multiple Imputation’. Statistics in Medicine 33(27):46814694.
Keele, Luke. 2010. ‘Proportionally Difficult: Testing for Nonproportional Hazards in Cox Models’. Political Analysis 18(2):189205.
Kropko, Jonathan, and Harden, Jeffrey J.. 2018. ‘Beyond the Hazard Ratio: Generating Expected Durations from the Cox Proportional Hazards Model’. British Journal of Political Science (Forthcoming).
Leemis, Lawrence M.. 1987. ‘Variate Generation for Accelerated Life and Proportional Hazards Models’. Operations Research 35(6):892894.
Leemis, Lawrence M., Shih, Li-Hsing, and Reynertson, Kurt. 1990. ‘Variate Generation for Accelerated Life and Proportional Hazards Models with Time Dependent Covariates’. Statistics & Probability Letters 10(4):335339.
Shih, Li-Hsing, and Leemis, Lawrence M.. 1993. ‘Variate Generation for a Nonhomogeneous Poisson Process with Time Dependent Covariates’. Journal of Statistical Computation and Simulation 44(3–4):165186.
Sylvestre, Marie-Pierre, and Abrahamowicz, Michal. 2008. ‘Comparison of Algorithms to Generate Event Times Conditional on Time-Dependent Covariates’. Statistics in Medicine 27(14):26182634.
Zhou, Mai. 2001. ‘Understanding the Cox Regression Models with Time-Change Covariates’. The American Statistician 55(2):153155.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Political Science Research and Methods
  • ISSN: 2049-8470
  • EISSN: 2049-8489
  • URL: /core/journals/political-science-research-and-methods
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
Type Description Title
Supplementary materials

Harden and Kropko supplementary material
Harden and Kropko supplementary material

 PDF (143 KB)
143 KB


Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed