Philippe Guardiola
2008-Aug-22 13:02 UTC
[R] Re : Help on competing risk package cmprsk with time dependent covariate
Hello again,
I m trying to use timereg package as you suggested (R2.7.1 on XP Pro).
here is my script based on the example from timereg for a fine & gray model
in which
relt = time to event, rels = status 0/1/2 2=competing, 1=event of interest,
0=censored
random = covariate I want to test
library(timereg)
rel<-read.csv("relapse2.csv", header = TRUE, sep = ",",
quote="\"", dec=".", fill = TRUE,
comment.char="")
names(rel)
> names(rel)
[1] "upn" "rels" "relt" "random"
times<-rel$relt[rel$rels==1]
fg1<-comp.risk(Surv(relt,rels>0)~const(random),rel,rel$rels,times[-1],causeS=1,resample.iid=1,model="prop")
summary(fg)
fg2<-comp.risk(Surv(relt,rels>0)~random,rel,rel$rels,times[-1],causeS=1,resample.iid=1,model="prop")
summary(fg)
Question1: can you confirm that "fg1" evaluates "random"
with the
hypothesis that it has a constant hazard over time and that it is
assumed as being time dependent in "fg2" ?
Question 2: both summaries give me the following that I dont understand at all,
is there a mistake in my script ?
Competing risks Model
Test for nonparametric terms
Test for non-significant effects
sup| hat B(t)/SD(t) | p-value H_0: B(t)=0
(Intercept) 0 0
random 0 0
Test for time invariant effects
supremum test p-value H_0: B(t)=b t
(Intercept) 0 0
random 0 0
int (b(t)-g(t,gam))^2dt p-value H_0:constant effect
(Intercept) 0 0
random 0 0
Call:
comp.risk(Surv(relt, rels > 0) ~ random, rel, rel$rels, times[-1], causeS
= 1, resample.iid = 1, model = "prop")
any help is very welcome
regards
Philippe G
----- Message d'origine ----
De : Arthur Allignol <arthur.allignol@fdm.uni-freiburg.de>
À : Philippe Guardiola <allogreffe@yahoo.fr>
Cc : R-help@r-project.org; phguardiol@aol.com
Envoyé le : Vendredi, 22 Août 2008, 11h53mn 42s
Objet : Re: [R] Help on competing risk package cmprsk with time dependent
covariate
Hello,
Something i don't understand
in your question.
Is treatment a time-dependent covariate?
That is, do patients receive the treatment
at the beginning of the study or later?
cmprsk cannot handle time-dependent covariates.
But if treatment is a baseline covariate,
but has a time-varying effect (i.e. does the subdistribution hazard
ratio varies with time?), your solution
to assess that is weird, because you will transform
your baseline covariate into a time-dependent one,
thus considering all the patients to receive no treatment
the first year. For sure, the treatment wont have any
effect for the first year.
To assess a time-varying effect on competing risks,
i would either follow the cmprsk documentation, including
an interaction with functions of time, or use the comp.risk
function in the timereg package, which fits more flexible
models for the cumulative incidence functions.
Best regards,
Arthur Allignol
Philippe Guardiola wrote:> Dear R users,
>
>
> I d like to assess the effect of "treatment" covariate on a
disease relapse risk with the package cmprsk.
> However, the effect of this covariate on survival is time-dependent
> (assessed with cox.zph): no significant effect during the first year of
follow-up,
> then after 1 year a favorable effect is observed on survival (step
> function might be the correct way to say that ?).
> For overall survival analysis
> I have used a time dependent Cox model which has confirmed this positive
effect after
> 1 year.
> Now I m moving to disease relapse incidence and a similar time dependency
seems to be present.
>
> what I d like to have is that: for
> patients without "treatment" the code for "treatment"
covariate is
> always 0, and for patients who received "treatment" covariate I d
like
> to have it = 0 during time interval 0 to 1 year, and equal to 1 after 1
> year. Correct me if I m wrong in trying to do so.
>
>
> First, I have run the following script (R2.7.1 under XPpro) according to
previous advices:
>
> library(cmprsk)
> attach(LAMrelapse)
> fit1<- crr(rel.t, rel.s, treatment, treatment, function(uft)
> cbind(ifelse(uft<=1,1,0),ifelse(uft>1,1,0)), failcode=1,
> cencode=0, na.action=na.omit, gtol-06, maxiter)
> fit1
>
> where:
> rel.t = time to event (in years)
> rel.s = status , =1 if disease relapse, =2 if death from non disease
> related cause (toxicity of previous chemotherapy), =0 if alive &
> not in relapse
> treatment > binary covariate (value: 0 or 1) representing the treatment
to test
> (different from chemotherapy above, with no known toxicity)
> I have not yet added other covariates in the model.
>
>
> this script gave me the following result:
>> fit1 <- crr(relcmp.t, relcmp.s, treatment, treatment, function(uft)
cbind(ifelse(uft <= 1, 1, 0), ifelse(uft > 1, 1, 0)), failcode = 1,
cencode = 0,
> na.action = na.omit, gtol = 1e-006, maxiter = 10)
>> fit1
> convergence: TRUE
> coefficients:
> [1] -0.6808 0.7508
> standard errors:
> [1] 0.2881 0.3644
> two-sided p-values:
> [1] 0.018 0.039
>
> ...That I dont understand at all since it looks like if
"treatment"
> covariate had also a significant effect of the first period of time !?
> This is absolutely not the case.
> So I m surely wrong with a part of this script... cov2 and tf are
> pretty obscure for me in the help file of the package. I would really
> appreciate advices regarding these 2 "terms".
>
> I was thinking that I might changed : cbind(ifelse(uft <= 1, 1, 0),
ifelse(uft > 1, 1, 0) into: cbind(ifelse(uft <=
1, 0, 1), ifelse(uft > 1, 1, 0)
>
> But since I only have one covariate (treatment) to test, shouldnt I only
write the following:
> fit1<- crr(rel.t,
> rel.s, treatment, treatment, function(uft) ifelse(uft<=1,0,1)),
failcode=1,
> cencode=0, na.action=na.omit, gtol-06, maxiter)
>
> which gives me :
>> fit1
> convergence: TRUE
> coefficients:
> [1] 0.06995 -0.75080
> standard errors:
> [1] 0.2236 0.3644
> two-sided p-values:
> [1] 0.750 0.039
>
> which, if I understand things
> correctly (I m not sure at all !) confirms that before 1 year, the effect
of "treatment" covariate is not
> significant, but is significant after 1 year of follow up. But there I m
again not sure of the result I obtain...
>
> any help would be greatly appreciated with cov2 and tf
>
> thanks for if you have some time for this,
>
>
> Philippe Guardiola
>
>
>
_____________________________________________________________________________
>
> o.fr
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
_____________________________________________________________________________
o.fr
[[alternative HTML version deleted]]
Seemingly Similar Threads
- Help on competing risk package cmprsk with time dependent covariate
- cmprsk and a time dependent covariate in the model
- competing risk model with time dependent covariates under R or Splus
- competing risk model with time dependent covariates
- Competing risks Kalbfleisch & Prentice method
