Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: SV: SV: stcompet and cumulative incidence at a specific point in time

 From Adam Olszewski To statalist@hsphsun2.harvard.edu Subject Re: st: SV: SV: stcompet and cumulative incidence at a specific point in time Date Mon, 17 Jun 2013 03:28:53 -0400

```Hi,
You can also use this short program to list the basic CIF and 95% CI:

program define ciflist
version 12.1
syntax anything [if]
capture drop _cif*
stcompet _cif_ = ci  _cifhi = hi _ciflo = lo  `if', compet1(2)
noi table `2' if _t<`1' & _cif_<., c(max _t max _cif_ max _ciflo max
_cifhi) format(%04.3f)
end

Then you can type e.g.
-ciflist 5 cevent-
where "cevent" is your fail-event variable and 5 is the time you want
the point estimate for. This assumes that value 1 is your event of
interest and value 2 is a competing event.
The downside is that you have to wait for a new stcompet run each
time, but of course you could modify it to run just once.

AO

On Mon, Jun 17, 2013 at 3:06 AM, Rikke Esberg Kirkfeldt <REKI@svf.au.dk> wrote:
> Dear Katja and Enzo,
>
> Thank you so much for your replies.
>
> Katja, indeed the pseudo value approach would be appropriate. However, we plan to use the cumulative incidence curves, and all I wanted was a relatively precise way of estimating the cumulative incidence from the curves generated after stcompet. And I believe, Enzo, that your solution does just that.
>
> Would it be correct to replace –ci- with –lo- and –hi- in order to estimate the confidence intervals, like this?
>
> . stset survtime, failure(outcome==1)
>
>      failure event:  outcome == 1
> obs. time interval:  (0, survtime]
>  exit on or before:  failure
>
> ------------------------------------------------------------------------------
>      1415  total obs.
>         0  exclusions
> ------------------------------------------------------------------------------
>      1415  obs. remaining, representing
>       247  failures in single record/single failure data
>  6708.504  total analysis time at risk, at risk from t =         0
>                              earliest observed entry t =         0
>                                   last observed exit t =  10.58179
>
> .  stcompet ci=ci hi=hi lo=lo, compet1(2)
>
> . forval i = 1(1)5 {
>   2.    qui su _t if _t<=`i'
>   3.    local tobs = `r(max)'
>   4.    qui su ci if _t<=`i'
>   5.    local ciat = `r(max)'
>   6.    if `i'==10 di _col(5) "at" _col(18) "Obs Time" _col(33) "Cum Inc"
>   7.    di _col(5) `i' _col(20) `tobs' _col(35) `ciat'
>   8.    }
>     1              .99657768      .04452297
>     2              1.9986311      .0864664
>     3              2.9952087      .11046968
>     4              3.9972622      .14158537
>     5              4.9993157      .17513161
>
> .
> .                 forval i = 1(1)5 {
>   2.    qui su _t if _t<=`i'
>   3.    local tobs = `r(max)'
>   4.    qui su lo if _t<=`i'
>   5.    local ciat = `r(max)'
>   6.    if `i'==10 di _col(5) "at" _col(18) "Obs Time" _col(33) "Cum Inc"
>   7.    di _col(5) `i' _col(20) `tobs' _col(35) `ciat'
>   8.    }
>     1              .99657768      .03464053
>     2              1.9986311      .07253825
>     3              2.9952087      .09467253
>     4              3.9972622      .12335587
>     5              4.9993157      .15447509
>
> .                 forval i = 1(1)5 {
>   2.    qui su _t if _t<=`i'
>   3.    local tobs = `r(max)'
>   4.    qui su hi if _t<=`i'
>   5.    local ciat = `r(max)'
>   6.    if `i'==10 di _col(5) "at" _col(18) "Obs Time" _col(33) "Cum Inc"
>   7.    di _col(5) `i' _col(20) `tobs' _col(35) `ciat'
>   8.    }
>     1              .99657768      .05616275
>     2              1.9986311      .10186408
>     3              2.9952087      .12760713
>     4              3.9972622      .16104027
>     5              4.9993157      .1968829
>
> Best regards,
>
> Rikke Kirkfeldt, MD, PhD
> Department of Cardiology
> Aarhus University Hospital
> Denmark
>
> ________________________________________
> Fra: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] p&#229; vegne af Katja Maretty Nielsen [KATJA.MARETTY.NIELSEN@ki.au.dk]
> Sendt: 16. juni 2013 08:42
> Til: statalist@hsphsun2.harvard.edu
> Emne: st: SV: stcompet and cumulative incidence at a specific point in time
>
> Dear Enzo.
>
> I've encountered the same problem, but was advised to use the psudovalue approach with the -stpci-, were you generate pseudo values at the time you are interested in:
>
> gen cevent=(dssstatus==2)
> label variable cevent "competing risk event"
> stpci cevent, at(1 2 3 4 5)
> glm pseudo1, fam(gauss) link(id) vce(robust)
> glm pseudo2, fam(gauss) link(id) vce(robust)
> glm pseudo3, fam(gauss) link(id) vce(robust)
> glm pseudo4, fam(gauss) link(id) vce(robust)
> glm pseudo5, fam(gauss) link(id) vce(robust)
>
> Hope this helps.
>
> Best regards
>
> Katja Maretty Nielsen
>
> MD, Phd-student
> Dept. of Experimental Clinical Oncology
> Aarhus University Hospital
> DK- 8000 Aarhus C
> Tel.: +45 78462621 / 50904640
> Mail: katja.maretty.nielsen@ki.au.dk
> ________________________________________
> Fra: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] p&#229; vegne af Enzo Coviello [enzo.coviello@tin.it]
> Sendt: 16. juni 2013 08:14
> Til: statalist@hsphsun2.harvard.edu
> Emne: st: stcompet and cumulative incidence at a specific point in time
>
> Hi All,
>
> Is there a Stata command that can be used to list (at specific time
> points  e.g. -sts list, at (0 (1) 5)-)
> the cumulative incidence function with confidence intervals from a
> competing risk analysis (after the –stcompet- command)?
>
>
> As far as I know there is not a command.
> The following code should approximately obtain what you need supposing
> that the -ci- is the name of the variable containing the cumulative
> incidence:
>
> forval i = 1(1)5 {
>    qui su _t if _t<=`i'
>    local tobs = `r(max)'
>    qui su ci if _t<=`i'
>    local ciat = `r(max)'
>    if `i'==10 di _col(5) "at" _col(18) "Obs Time" _col(33) "Cum Inc"
>    di _col(5) `i' _col(20) `tobs' _col(35) `ciat'
>    }
>
> Best
>
> Enzo
>
> --
> Enzo Coviello
> Epidemiology Unit - Cancer Registry ASL BT
> Piazza Umberto 1
> 76121 BARLETTA (BT)
> Italy
> mobile +39 347 5016016
> tel +39 0883 577329
> fax +39 0883 577288
> Home +39 0883 695055
>
>
> --
> Enzo Coviello
> Epidemiology Unit - Cancer Registry ASL BT
> Piazza Umberto 1
> 76121 BARLETTA (BT)
> Italy
> mobile +39 347 5016016
> tel +39 0883 577329
> fax +39 0883 577288
> Home +39 0883 695055
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```