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. Do anyone have a suggestion on how to specify the ID of subjects experiencing intervening events? Or maybe other solutions on how to perform a cox regression including an intervening event covariate? Thanks in advance! -- Best regards, Vegard Andersen Institute of Community Medicine University of Tromso Tromso, Norway vegard.andersen at ism.uit.no
Unless you have repeated events per person, you do not need to keep tack of which follow-up belongs to whom. The likelihood contribution from the two parts is a product. See any textbook on survival anlysis or p. 50 ff. of: staff.pubhealth.ku.dk/~bxc/Melbourne/Staff/foils.pdf or another of the zillion of survival/epidemiology lecture notes on the net. Best, Bendix Carstensen ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06 bxc at steno.dk biostat.ku.dk/~bxc ----------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Vegard Andersen > Sent: Thursday, January 13, 2005 12:52 PM > To: r-help at stat.math.ethz.ch > Subject: [R] coxph() and intervening events > > > 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. > Do anyone have a suggestion on how to specify the ID of subjects > experiencing intervening events? > Or maybe other solutions on how to perform a cox regression > including an > intervening event covariate? > > Thanks in advance! > > -- > Best regards, > Vegard Andersen > Institute of Community Medicine > University of Tromso > Tromso, Norway > > vegard.andersen at ism.uit.no > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read > the posting guide! R-project.org/posting-guide.html >
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