Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • stcompet: how to start line from zero?

    Dear statalister,
    I am doing an analysis from time from HIV seroconversion until ART (HIV medication) start among treatment-naive with all-cause mortality as a competing risk (so event=1 is ART start and event=2 death).

    I used the following code (by age group)

    stcompet CIF = ci, by(agecat2) compet(2)

    twoway (line CIF fu if agecat2== 1 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
    (line CIF fu if agecat2== 2 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
    (line CIF fu if agecat2== 3 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
    , legend(order(1 "<=25" 2 "26-34" 3 ">=35") ///
    ring(0) pos(5) cols(1)) ///
    xtitle("Time from HIV seroconversion(years)") ///
    ytitle("CIF")


    fu is my follow-up time and i'm selecting HIV seroconverters only and that is why hivsc==1 in the selection criteria after the statement " if".

    So I do obtain results which i might expect, but all lines do not start at zero.


    Does anyone have an idea how I can get all lines to start at zero instead of the lowest CIF?

    Thank you in advance for your help!

    P.S: i posted this already in "using the forum"..as I am new to this forum Im hope this is the right place to ask my questions.

  • #2
    On 20 May 2015 I posted in the 'sandbox' what I have done to this, with an example. In that program I use my own ado in PERSONAL:. (The 'sandbox' is not the right place to ask true questions: Home->Forums->Forums for Discussing Stata->General)
    Attached Files
    Last edited by Allen Buxton; 17 Sep 2015, 12:16.

    Comment


    • #3
      Dear Allen,

      Thank you for your answer. However I have never used an ado file and not very familiar with the use of it. I will google to see whether I can figure it out. If you have any tips or information though, I would be happy to get a look at it.

      Regards, Daniela
      P.S: I now realized that I was totally on the wrong forum, apologies!

      Comment


      • #4
        Originally posted by Daniela van Santen View Post
        I have never used an ado file and not very familiar with the use of it. I will google to see whether I can figure it out.
        Chapter 17 in the Stata User's Guide is about ado-files.

        Comment

        Working...
        X