I am trying to model a non-constant (and non-linear) hazard ratio between two groups (Group A and Group B), assuming that the baseline hazard for one of the groups can be described with the Weibull hazard function. I suppose that using heaviside functions to estimate non-proportional hazards (i.e. assume that hazard ratios between two groups remain constant only within of separate time intervals) would be a good and relatively simple solution to solve the problem with the selected parametric failure (survival) model.
However, I haven't seen any examples in the literature how to do it. May I ask to suggest references or examples (would be great if someone would give an example by using "R") how to perform such study? Many thanks for all suggestions, and apologize if this question was asked before (but I was not able find it)!