
Remove repeated events
nostutter.RdFor a subject with repeated follow-up visits, do not count the second, third, etc. visit in a row with the same state as a repeated event.
Details
When an covariate is recorded multiple times during follow-up, and that
variable is being used as an endpoint in a multi-state hazard model,
we will sometimes want to consider each instance as a new event and
sometimes not. An example of the first kind is the cgd data
set; each row in which status =1 is a new infection.
An example of the second is the nafld data when we treat the
number of co-morbidities as a state; multiple visits with the same
total do not count as entry into a new state.
This routine will often be called on a current state variable before
using that variable as an event variable in tmerge.