Announcement

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

  • Cox proportional hazard model with late entry

    Hello,

    I need some help to figure out how to handle late entry for my analysis.
    Respondents become at risk of the event (moving out of their current neighborhood) in 2005, and all censored in 2014.
    However, there are some respondents who started being at risk after 2005 (e.g. 2007). For example,
    ID Yearid Moved
    A100 2005 0
    A100 2006 0
    A100 2007 0
    A100 2008 0
    A100 2009 1
    B200 2007 0
    B200 2008 0
    B200 2009 1
    ... ... ...
    Here is my code to handle late entry.

    Code:
    stset yearid, failure(moved==1) id(hh_id) origin(fyear) enter(fyear)
    "fyear" is the first year a respondent showed up in the data. For example, for A100, fyear=2005 and for B200, fyear=2007.

    So a respondent becomes at risk in "fyear" and first entered in "fyear".

    Then I run a cox regression.
    Code:
    stcox lag_incensus, nohr
    "lag_incensus" is one of the main predictors. I don't have any covariates yet.

    I just wonder if my code is correctly handling late entry.
    I would appreciate any of your advice.

    Thanks!













  • #2
    Your post is somewhat confusing. The variables you mention in your -stset- and -stcox- commands appear nowhere in your example data. So we are left to guess what you mean here. Evidently we just have to ignore that example data. Well, good thing, because if we did want or need to bring it into Stata to experiment with, you have provided it in a table that does not import easily into Stata. Please read FAQ #12 about how to post example data with -dataex-. and follow that advice consistently in the future. Fortunately, it seems we don't need to see your example data to answer your question.

    Your -stset- command is not correct in this situation. You need different specifications for -origin()- and -entry()-. You have -entry(fyear)- correct: fyear is, you say, the year that people come under observation in your study. That's exactly what -entry()- is for. But your -origin(fyear)- is wrong. You state that everybody becomes at risk in 2005, even if they weren't under observation in your study until later. So you need to specify -origin(time 2005)-

    Comment


    • #3
      Dr. Schechter,

      Thank you for your response and sorry for the confusion. I just wanted to simplify my explanation by not explaining all the variables in the data.
      And you answered my question!

      I did some further research and figured that "origin(fyear)" part was wrong, but I was not sure about how to fix it.
      I really appreciate your time and advice!





      Comment

      Working...
      X