I have implemented a gap time-conditional (aka PWP) recurrent Cox regression model in R. However, rather then baseline hazard function (delta_0(t)) acting as a constant, I would like to incorporate a probability distribution based on event time duration (this is something I have written myself) to ensure that the baseline hazard function is weighted by the duration at which an individual has been exposed to a certain number of events.
For example. When I consider 5 recurrent events the baseline hazard function is reset and I will have some risk associated with defined covariates. e.g., in R code:
coxph(Surv(tstart,tstop,status) ~ drug + cluster(id) + strata(enum), data=medicalDF)
In my work, this is a collection of medical event. The longer the individual has recurrent events the less risk they will be at having a new event (because they are undergoing treatment). For example, if you are having a 10th headache the probability of your headache lasting very long or being as potent is a lot less than a 5th headache you had.
I have spent a lot of time going through the R documentation. Is there any way of modifying the underlying hazard baseline function?
EDIT #1 I have a very vague feeling that what I want involves the use of case weights.