BookmarkSubscribeRSS Feed
Fabie10
Calcite | Level 5

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

5 REPLIES 5
Fabie10
Calcite | Level 5

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.

JacobSimonsen
Barite | Level 11

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.

JacobSimonsen
Barite | Level 11

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

Fabie10
Calcite | Level 5

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.

JacobSimonsen
Barite | Level 11

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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