[R] Survival Regression with multiple events per subject
fabian-hefner at web.de
Mon Apr 28 09:57:59 CEST 2008
Dear R users!
I want to process a maximum likelihood estimation for a parametric
regression survival time model with multiple events per subject.
the STATA command for this survival regression is:
stset failure(exercise), id(optionid)
local regressors itm posret negret
streg `regressors', distribution(weibull)
stset declares data to be survival-time data;
exercise is the indicator variable, which shows if the subject is dead or
optionid is the multiple-record ID variable which means every subject has a
unique id and one subject can have multiple events. (see example below)
streg computes a maximum likelihood estimation for parametric regression
survival time models with multiple record data
now I search an equivalent command in R
I found the survival package but I have no solution for the use with
multiple records per subject.
survRegData <- survreg(formula=Surv(time,exercise)~itm+posret+negret,
My Question is: how can I modify the above command for the use of multiple
events per subject when the optionid is used for indicating the subject?
The dataset look like:
data | exercisedate | itm | posret | negret | optionid| exercise | time
1996 | 1996 | 1.4518 | 0.05487 |-0.4485 | 1 | 0 | 1
1997 | 1997 | 2.4535 | 0.00385 |-0.2525 | 1 | 1 | 5
1998 | 1998 | 1.2523 | 0.04486 |-0.1482 | 2 | 1 | 8
1999 | 1999 | 3.4257 | 0.15287 |-0.8615 | 3 | 0 | 4
2000 | 2000 | 1.1457 | 0.07487 |-0.5485 | 3 | 1 | 5
2001 | 2001 | 2.4418 | 0.09553 |-0.3772 | 3 | 0 | 2
More information about the R-help