Time varying logistic regression

Hi
I am looking for an implementation of a time-varying logistic regression, actually for time varying coefficients, to explore the changes of the odds ratio over time.
I found a R package called dynamichazard that claims to implement such a model, however it is based on specific modelling and the code doesn’t run on my data anyway.
Of course I can try a naïve model in which I divide the time to short time frames, and then run a logistic model for the first week, the for the first two weeks and so on, but I still hope to find something more sophisticated.
And one more note: a time-varying cox PH model may be used as a sensitivity analysis, but I am not able to use it as a primary analysis (please don’t ask)
I will appreciate any advice.

A GEE approach with a cluster sandwich covariance estimator allows for much flexibility in that setting, even for overlapping time intervals .

1 Like

Are you thinking like you would run separate models here? Because otherwise this sounds like a pooled logistic model which would approximate cox.

Exactly, but I don’t like this approach

This would be pooled logistic regression, using a single model fit.

Yossi, can you describe what your data look like? Are you working in continuous time or discrete time?

Hi David
I work in discrete time (weeks). It’s a simple setup: I have a (large) cohort of patients, an intervention, a rare outcome, and a bunch of baseline covariates. For every subject I have the time of the intervention (if the intervention was administered), and the time of the outcome (if it occurred), so there 4 combinations. If the outcome occurred before an intervention was administered, then intervention is no longer possible. I thought that a time-varying PH model will do fine, but for reasons I don’t want to discuss this is not an option. After some research I found a paper by Tan, Shiyko, Li, Li & Dierker (2012) with an implementation in the tvem package in R, and got nice results. But of course I’ll be glad to hear about other approaches.

Discrete time state transition models may be ideal for your situation. Check out COVID-19.