Hello,
I need help figuring out how to implement step functions in both line and stacked area plots with the CI step function to graph competing event of death prior to the diagnosis of breast cancer. So far I have been able to set up the plot but without the requisite step function using the Aalen Johansen estimator. What I have discovered is the the "stepwise" or "J " option with the "twoway" or "graph tw" commands works well for the first of the requested CI in the combined line plots for the two CIs(attached as graph) but not at all for area plots (attached as graph 1). I need assistance in figuring this out. Instead of the step the plots have diagonal connections linking the points which makes it incorrect. See the code I am using below and the output. Please note that this possible with SAS but I am facile with it. The dataset is also attached.
use bccarecurrence.dta , clear
stset time, failure(status=1)
sts graph, failure
stcompet cif=ci, compet1(2)
gen CI1 = cif if status==1
gen CI2 = cif if status==2
gen ci_d=1-CI2
sort time
replace CI1=0 if _n==1 & CI1==.
replace CI2=0 if _n==1 & CI2==.
replace CI1 = CI1[_n-1] if CI1==.
replace CI2 = CI2[_n-1] if CI2==.
label variable CI "CI of death before Breast CA"
label variable CI1 "CI of Breast CA"
graph tw line CI CI1 time, connect(J) ylab(0 (0.2) 1) xlab(0 (5) 60) ( for graph)
graph tw area CI CI1 time, connect(J) ylab(0 (0.2) 1) xlab(0 (5) 60) ( for graph1)
Thanks
Related Posts with Step function for combined line and stacked area plots for competing risks CI functions in stata
xteurostat (SSC) to download Eurostat information not working (?)Dear all, I have worked with xteurostat in the past and I have a nice Do-File which I was hoping to…
No F-test valueHi, can anyone help me on how to deal with the problem of missing F-test value? Code: Multiple-i…
Estimating CES function three level (Borjas 2003) Hi, I look for thr means to build my database. Indeed in the context of my memory it will be quest…
asdoc commandHello everybody, I am using this formula "asdoc estimates table est1 est2 est3 est4 est5 est6 est7, …
Lincom result when the main var is not sig. but the interaction is sig.Hi members, Got a quick question about linear combination of coefficients (using lincom command). I…
Subscribe to:
Post Comments (Atom)
0 Response to Step function for combined line and stacked area plots for competing risks CI functions in stata
Post a Comment