help stpm2cifalso see:stpm2 stpm2_postestimation-------------------------------------------------------------------------------

Title

stpm2cif-- Competing risks post-estimation tool to estimate cumulative incidence function after stpm2

Syntax

stpm2cifnewvarlist[,options]

optionsDescription -------------------------------------------------------------------------cause1...cause10obsspecifies the number of observations (of time) to predict forcicalculates confidence intervals for cumulative incidence functionmintthe minimum value of follow up timemaxtthe maximum value of follow up timetimenamename of time variable derived by codehazardpredicts cause-specific hazard function for each causecontmortpredicts the contribution to total mortalityconthazpredicts the contribution to hazard -------------------------------------------------------------------------

Description

stpm2cifcan be used afterstpm2to obtain cumulative incidence functions for up to 10 causes of death.

OptionsNote: in the table below,

vnis an abbreviation forvarname.+------+ ----+ Main +-------------------------------------------------------------

cause1(vn #[vn #..])..cause10(vn #[vn #..])requests that the covariates specified by the listedvarname(s)be set to # when predicting the cumulative incidence functions for each cause. It is complusory to specify cause1 and cause2.

obs(integer)specifies the number of observations (of time) to predict for (default 1000). Observations are evenly spread between the minimum and maximum value of follow-up time.

cicalculates a 95% confidence interval for the cumulative incidence function and stores the confidence limits inCIF_newvar_lciandCIF_newvar_uci.

mint(#)the minimum value of follow up time. The default is set as the minimum event time fromstset.

maxt(#)the maximum value of follow up time. The default is set as the maximum event time fromstset.

timename(newvarname)this is the time variable generated during predictions for the cumulative incidence function (default_newt). Note that this is the variable for time that needs to be used when plotting curves for the cumulative incidence function and the cause-specific hazard function.

hazardpredicts cause-specific hazard function for each cause.

contmortpredicts the contribution to total mortality.

conthazpredicts the contribution to hazard.

Examples

This example is taken from a paper by Putter et al. (2007) where data were anal > yzed on 324 homosexual men from the Amsterdam Cohort Studies on HIV infection and AIDS. For a more detailed descrip > tion of the web based data see Example 4 in the following document http://www.stata.com/features/competing-ris > ks/stcrreg.pdf.

Expand the data set so that each patient has a row of data for each of the two > competing events - time to SI phenotype appearance and diagnosis of AIDS.

webuse hiv_si gen id=_n expand 2

Create a cause variable variable for each of the two competing events. Generate > an event indicator by setting the cause variable equal to the status variable. The status variable indicates > whether the patient has experienced either of the two events. Once this has been generated use it to

stsetthe data > .

bysort id: gen cause= _n gen si=cause==1 gen aids=cause==2 gen event=(cause==status) stset time, failure(event)

Run

stpm2including each of the two competing events in the model.

stpm2 si aids, scale(hazard) tvc(si aids) nocons rcsbaseoff dftvc(3)

Run

stpm2cifto obtain the cumulative incidence function for each cause. Note t > hat the names in the newvarlist are in capital letters so as not to overwrite the original variables with those > names.

stpm2cif SI AIDS, cause1(si 1) cause2(aids 1)

A plot of the two cumulative incidence functions for SI appearance and diagnosi > s of AIDS can be obtained as follows:

twoway (line CIF_SI _newt)(line CIF_AIDS _newt), xtitle(Years from HIV infection) ytitle(Cumulative Incidence Function) ylabel(, angle(0))

The variables

CIF_SIandCIF_AIDSare the cumulative incidence functions genera > ted by thestpm2cifcommand. Note that the curve is plotted against_newtwhich is the new time variable gen > erate bystpm2cifduring the predictions.

In order to plot a stacked graph of the cumulative incidence functions you need > to sum up the two functions.

gen tot1=CIF_SI gen tot2=CIF_SI+CIF_AIDS

Now the stacked cumulative incidence graph can be plotted as follows:

twoway (area tot2 _newt)(area tot1 _newt), xtitle(Years from HIV infection) ytitle(Cumulative Incidence Function) ylabel(, angle(0))

Note that the legend shows

tot1which representsCIF_SIandtot2which represen > tsCIF_AIDS.

Also seeOnline:

[ST] stpm2[ST] stpm2_postestimation;