Model suggestion for a Cox regression with time dependent covariates I´m modeling the effect of pregnancy on the outcome of a disease (dead-alive). Approx 40% of the patients did become pregnant after the time of diagnosis-but at different points in time. So far I´ve done KM plots showing a clear protective effect of pregnancy on survival and also a regular Cox model-however these have been modeled using only a dichotomised pregnancy variable and assuming the effect is present from the time of diagnosis which is clearly unrealistic since the median time to pregnancy is 4 years from diagnosis.
What kind of model would absorb the effect of multiple pregnancies at different time points after diagnosis? Would it be correct to model the pregnancies interacting with time (which would require some serious data reconstruction-any automated software that could help with this?) or is there another preferred modeling strategy for these problems? Also what is the preferred plotting strategy for these problems?
 A: What you need here is a time-varying covariate and not necessarily a time-varying coefficient. A known example that could help you with your analyses is the Stanford heart transplant data. 
To present your results you can use the classic Kaplan-Meier estimator that handles time-varying covariates with no problems (remember, though, that this is a crude - or unadjusted analysis with all its well-known limitations). 
As an example, the following graph shows the analysis of the Stanford HT data when correctly accounting for the time-varying transplant status (top panel) and without accounting for it (bottom panel).

A: In R, this can be addressed with the start/stop version of a Survival object, e.g.
fit <- coxph(Surv(time1, time2, status) ~ is.pregnant + other.covariates, data=mydata)

This paper discusses this in more detail: http://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf
A: Beware immortal time bias in this situation. Your pregnant group will inevitably have a better survival than the non-pregnant group since you can't become pregnant after you die (to the best of my knowledge!)
