## How do I fit a conditional frailty model (survival analysis of recurrent events) ?

Occasional Contributor
Posts: 7

# How do I fit a conditional frailty model (survival analysis of recurrent events) ?

I want to evaluate the effect of a treatment on the rate of a recurrent event (groupe=1 treatment, groupe=0 control), under the assumptions that the recurrent events are dependent and there is heterogeneity,  the 'conditional frailty model' is recommended (Box-Steffensmeier, 2005)

I know how to fit a shared frailty model using phreg:

proc phreg data=table;

class  groupe id;

model time*Status(0)=groupe  ;

random id;

run;

with the variable time = time from the beginning of the trial

and Status=1: event occurence

But how do I fit a conditional frailty model? Do I just use the gaptime (time from the last event) instead of time?

Thanks

Fabienne

Occasional Contributor
Posts: 7

## Re: How do I fit a conditional frailty model (survival analysis of recurrent events) ?

Ok since no one has answered yet, I'll share what I learned for other people who might be interested.

There's an R package that fits frailty models:

## 'frailtypack'CRAN - Package frailtypack

It is very helpful cause it allows to compare the resulting AIC from different frailty distributions 'gamma, exponential, weibull..' to determine the best fit for the data.

To fit a conditional frailty model using R , you can even use the standard 'coxph' with a frailty term while stratifying for the number of the event.

Super Contributor
Posts: 301

## Re: How do I fit a conditional frailty model (survival analysis of recurrent events) ?

There is also this possibility:

You can split you data up in intervals, such that it doesn't look like recurrent event data. Then if you have an event, the next record will be left-truncated at the time of the first event. If one more event happens the next record will be left-truncated at the time of the second event, and so on. Notice that the cox-regression model is not violated by the fact that same indiviual contribute with several records, since the intervals for each person will not overlap.

the procedure will be something like this,

proc phreg data=longtable;

class  groupe id;

model (lefttrunctime time)*Status(0)=groupe  ;

strata id;

run;

where longtable is a derived dataset, with as many records for each individual as there are events for this individual.

There is also the variant where you start the time from zero at each event, and use the time since last event as underlying time. This is not exactly the same model. (you can read about this difference in ("The statistical analysis of recurrent events" by richard J. cook and Jerald F lawless).

I hope this make sense.

Super Contributor
Posts: 301

## Re: How do I fit a conditional frailty model (survival analysis of recurrent events) ?

I would like to make a comment more about the model where you put the time to zero at each event. It is a legal model, and easy to handle compared to the model where you use the original timescale. This is so because you avoid the lefttruncations. But, the underlying time is not the same, which it almost no problem if it is acceptable in your context. Though, I see one problem: namely that the time to first event is (perhaps) measured from some arbitrary time, wheareas time to the next events is measured from an event-time. A partly solution can be to stratify or justify for eventnumber (which is legal since as it belong the the past history).

Jacob

Occasional Contributor
Posts: 7

## Re: How do I fit a conditional frailty model (survival analysis of recurrent events) ?

Why stratify by the id when you can put id in a 'random statement'? and thus the random statement allows you to do a frailty model that can account for the within-individual correlation between events (adjust for heterogeneity )

Ok I think this the code for the conditional model proposed by  Box-Steffensmeier :

proc phreg data=table;
model (time0 time1)*status(0) = groupe;

random id
strata event;
run;

It's a conditional model that stratifies by the number of events/ assumes that it is not possible to be at risk for a subsequent event without having experienced the previous event (i.e. you can not be at risk for event 2 without having experienced event 1), but with a frailty (random) term.

Super Contributor
Posts: 301

## Re: How do I fit a conditional frailty model (survival analysis of recurrent events) ?

I agree. id should be in random, otherwise the model is much too flexible the paramers can not be identified.

Discussion stats
• 5 replies
• 841 views
• 3 likes
• 2 in conversation