Announcement

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

  • Clyde Schechter
    replied
    Well, Stata is already excluding those people for you: it's telling you about that in that warning message about observations entering on or before enter(). So if you just leave it the way you have it, you're automatically getting this.

    If it bothers you to see that message, you can change the -stset- command as follows:

    Code:
    stset endpoint if start_follow_date < endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id)
    The warning from -stset- will go away. But the results will be unchanged.

    Leave a comment:


  • Jonas Kristensen
    replied
    Yes of course. That is definitely the case. If i then have end of follow up at last admission date, would it then makes sense to include these patients if they did not have fracture or died, because then they would theoretically have zero risk time, because they have not registered admission AFTER their stroke.

    And how can one go about this, if this is the case?

    Leave a comment:


  • Clyde Schechter
    replied
    Could your data have some people in it whose final admission date precedes, or is the same as their first stroke date? These would also be people whose data ends on or before their enter date.

    Leave a comment:


  • Jonas Kristensen
    replied
    This is exactly what i would like to do: "On another interpretation, if you want to simply disregard fractures that occur before the first stroke and consider the incidence rate of new fractures that do occur after the stroke, but your data is contaminated with those old, pre-stroke fractures, then you could do this:"

    I used the above command, but there is still 19192 observations end on or before enter(). I have attached a comparison photo, with before and after the new code.

    Attached Files

    Leave a comment:


  • Clyde Schechter
    replied
    Yes, this means that they had a fracture before their first stroke. If your goal is to estimate the incidence of fracture after stroke, though, it would seem appropriate to exclude them, as Stata does. They would not be incident cases.

    On another interpretation, if you want to simply disregard fractures that occur before the first stroke and consider the incidence rate of new fractures that do occur after the stroke, but your data is contaminated with those old, pre-stroke fractures, then you could do this:

    Code:
    sort person_id stroke_date
    by person_id (stroke_date): gen start_follow_date = stroke_date[1]
    by person_id (admission_date), sort: egen first_post_stroke_fx_date = ///
        min(cond(has_fracture_now & admission_date > start_follow_date, admission_date, .))
    by person_id (admission_date): gen end_follow_date = min(admission_date[_N], death_date)
    by person_id: egen had_fracture = max(has_fracture_now) 
     
    gen dead = 1
    replace dead = 0 if missing(death_date)
    by person_id: egen died = max(dead) 
     
    by person_id: keep if _n == 1
    
     //  FOR FRACTURE OUTCOME ONLY
    gen outcome = had_fracture
    gen endpoint = min(first_post_stroke_fx_date, end_follow_date)
     
    // INCIDENCE-RATE OF FRACTURES
    stset endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id)
    stptime
    Changes to previous code are in italics. This code will give you the date of the first post-stroke fracture (if any), rather than the first stroke ever.

    Leave a comment:


  • Jonas Kristensen
    replied
    Thank you for helping me again Mr. Schechter. I really appreciate it. You are right

    In regards to the help you gave me with the command below. I am trying to estimate the incidence-rate of fractures:

    Code:
    sort person_id stroke_date
    by person_id (stroke_date): gen start_follow_date = stroke_date[1]
    by person_id (admission_date), sort: egen first_fracture_date = min(cond(has_fracture_now, admission_date, .))
    by person_id (admission_date): gen end_follow_date = min(admission_date[_N], death_date)
    by person_id: egen had_fracture = max(has_fracture_now) 
     
    gen dead = 1
    replace dead = 0 if missing(death_date)
    by person_id: egen died = max(dead) 
     
    by person_id: keep if _n == 1
    
     //  FOR FRACTURE OUTCOME ONLY
    gen outcome = had_fracture
    gen endpoint = min(first_fracture_date, end_follow_date)
     
    // INCIDENCE-RATE OF FRACTURES
    stset endpoint, failure(outcome = 1) scale(36525) origin(start_follow_date) id(person_id)
    stptime
    As you can see in the attached picture, the analysis of the incidence-rate has "36.682 observations end on or before enter()"
    Is that because some patients has had a fracture before their stroke date, which means that they are therefore not included when stata does the analysis?
    And if that is the case, how can i assure that if they actually also have a fracture after their stroke, that that is the facture that is included.
    Attached Files

    Leave a comment:


  • Clyde Schechter
    replied
    To use -stcompet- you must create a single variable with levels for all of the outcomes under consideration. You specify one of them as your failure outcome in the -stset- command, and you specify the others as a numerical list (Stata numlist) in the -compet()- option.

    Also I don't believe the syntax -stcompet = ,...- is allowed. I have very little experience with this command (I usually use -stcrreg-, which implements the Fine & Gray approach), but I believe you have to specify something like -stcompet cummort = ci, ...- And then you should be able to do the graphs the way you describe.

    Leave a comment:

Working...
X