[R] coxph() and intervening events

Thomas Lumley tlumley at u.washington.edu
Thu Jan 13 16:07:55 CET 2005


On Thu, 13 Jan 2005, Vegard Andersen wrote:

> Hello!
>
> I am using the coxph() function for counting process data. I want to include 
> an intervening event as one of my covariates. In order to do this I have 
> split the relevant observations in my data at the time of intervention. But I 
> have not found any way to "inform" coxph() of the id of these observations. 
> The result of this is that coxph() interprets the split data as extra 
> observations, which is wrong.

No, it is not wrong.

> Do anyone have a suggestion on how to specify the ID of subjects experiencing 
> intervening events?

You can specify the ID by including cluster(id) in your formula. This 
gives you a model-robust sandwich variance.  You don't need to do this and 
it is not standard (though IMO it's a good idea).


 	-thomas




More information about the R-help mailing list