Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: stcompet cumulative incidence graphs with wrong time units
From
Austin Nichols <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: stcompet cumulative incidence graphs with wrong time units
Date
Fri, 11 Apr 2014 09:14:45 -0400
ROXANNE BEAUCLAIR <[email protected]>:
You should clarify what you mean by left truncation. I assume you
mean that people enter the study after having been at risk for some
time, but in that case you should not be specifying the enter and
origin dates using the same variable, right?
Dates on the x-axis are presumably a function of the format of your
x-axis variable; show us the results of the -describe- command applied
to your data.
Can you show an example of your problem using public data e.g.
webuse hypoxia, clear
set seed 1
g fakentry=dftime*uniform()
stset dftime, failure(failtype==1) enter(time fakentry)
stcrreg ifp tumsize pelnode, compete(failtype==2)
stcurve, cumhaz
stset dftime, failure(failtype==1) enter(time fakentry)
cap ssc inst stcompet
stcompet ci=ci, compet1(2)
sort _t
line ci _t if failtype==1, name(s1, replace)
stset dftime, failure(failtype==1) enter(time fakentry) origin(time fakentry)
stcompet ci=ci, compet1(2)
sort _t
line ci _t if failtype==1, name(s2, replace)
(in this data origin should be zero, and I made up data on observed entry).
On Fri, Apr 11, 2014 at 5:31 AM, ROXANNE BEAUCLAIR
<[email protected]> wrote:
> Greetings statalisters,
>
> I am trying to make a graph of cumulative incidence for my two
> competing events using stcompet. My data has left truncation so I have
> to specify the 'entry' date when I stset my data. This is an example
> of the code:
>
> stset spellend, failure(breakconcur==1) enter(time enterdate)
> stcompet ci=ci, compet1(2)
> twoway (line ci _t if breakconcur==1, sort lcolor(black)
> lpattern(solid))(line ci _t if breakconcur==2, sort lcolor(black)
> lpattern(dash))
>
> Whenever I do this, the x-axis produces stata dates. However, I would
> like it to be in days at risk.
>
> When I stset my data by also specifying an origin, e.g.:
>
> stset spellend, failure(breakconcur==1) origin(time enterdate)
> enter(time enterdate)]
>
> In this case, I get the days at risk on my x-axis, but the graph
> produces this weird upwards steep tail for my competing risk. I'm not
> sure why its doing this in this case, but not when there are dates on
> the x-axis.
>
> Can anyone tell me how I can fix this problem?
>
> Warm Regards,
> --
> Roxanne Beauclair MA, MPH, PhD Candidate
> International Centre for Reproductive Health (ICRH)
> Ghent University, Belgium
> www.icrh.org
>
> The South African Department of Science and Technology / National
> Research Foundation (DST/NRF)
> Centre of Excellence in Epidemiological Modelling and Analysis (SACEMA)
> Stellenbosch University, South Africa
> www.sacema.com
*
* 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/