Skip to contents

For 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.

Usage

nostutter(id, x, censor = 0, single=FALSE)

Arguments

id

subject identifier

x

covariate of interest

censor

censoring code to be used as the "no event at this time" value

single

if TRUE, a given level can appear only once

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.

Value

an updated vector with repeated values marked as censor

See also