Hello,
I would like to compute the cumulative incidence (CI) of graft versus host disease following a transplant with death being the competing event. I've gone through "Cumulative incidence estimation in the presence of competing risks" but I'm not sure if I've set this up correctly and how to graph it.
These are my variables:
alive byte %10.0g 1-alive, 2-dead
aGVHD byte %10.0g 1 - developed GVHD, 0-no GVHD
contact float %9.0g date of last follow-up: based on a date variable that I converted using mdy() function to make it numeric
tx_date double %10.0g date of transplant: based on a date variable that I converted using mdy() function to make it numeric
aGVHD_date float %9.0g date of GVHD onset: based on a date variable that I converted using mdy() function to make it numeric
*generated a variable that takes on the date of death or GVHD, whichever comes first. And if no death or GVHD then it should just be last follow-up date
. gen contact2 = contact
. replace contact2 = aGVHD_date if (aGVHD==1 & aGVHD_date<contact)
*generate a variable to define the event of interest. So event = 1 is the outcome event (
. gen event = 0 // no GVHD and no death
. replace event = 1 if (aGVHD==1 & alive==1) // patient got aGVHD and patient is alive
. replace event = 2 if (alive==2 & aGVHD==0) // patient died with no GVHD prior
. stset contact2, failure(event==1) origin(tx_date) enter(tx_date) id(crid) exit(time tx_date+(365.25))
. stcompet CIF = ci, compet1(2)
How do I graph this?
When I use
. twoway line CIF contact2
I get something crazy so I think it's the time variable that's wrong.... or maybe it's something else that I'm computing wrong.
Any help would be appreciated
I'm using Stata/SE 16.1 version
Thanks,
Kalina Abrol
I would like to compute the cumulative incidence (CI) of graft versus host disease following a transplant with death being the competing event. I've gone through "Cumulative incidence estimation in the presence of competing risks" but I'm not sure if I've set this up correctly and how to graph it.
These are my variables:
alive byte %10.0g 1-alive, 2-dead
aGVHD byte %10.0g 1 - developed GVHD, 0-no GVHD
contact float %9.0g date of last follow-up: based on a date variable that I converted using mdy() function to make it numeric
tx_date double %10.0g date of transplant: based on a date variable that I converted using mdy() function to make it numeric
aGVHD_date float %9.0g date of GVHD onset: based on a date variable that I converted using mdy() function to make it numeric
*generated a variable that takes on the date of death or GVHD, whichever comes first. And if no death or GVHD then it should just be last follow-up date
. gen contact2 = contact
. replace contact2 = aGVHD_date if (aGVHD==1 & aGVHD_date<contact)
*generate a variable to define the event of interest. So event = 1 is the outcome event (
. gen event = 0 // no GVHD and no death
. replace event = 1 if (aGVHD==1 & alive==1) // patient got aGVHD and patient is alive
. replace event = 2 if (alive==2 & aGVHD==0) // patient died with no GVHD prior
. stset contact2, failure(event==1) origin(tx_date) enter(tx_date) id(crid) exit(time tx_date+(365.25))
. stcompet CIF = ci, compet1(2)
How do I graph this?
When I use
. twoway line CIF contact2
I get something crazy so I think it's the time variable that's wrong.... or maybe it's something else that I'm computing wrong.
Any help would be appreciated

I'm using Stata/SE 16.1 version
Thanks,
Kalina Abrol
Comment