Announcement

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

  • Need help with survival analysis

    Dear Stata specialist,

    I need help with survival analysis, here is the story. I am currently working on a project to use survival analysis to study the retention rate of new immigrants in rural areas.
    The time variable is the year (year 1, year 2, year 3..... etc), and the event is retention (0 if immigrants stay in a rural area in the year, 1 if immigrants leave a rural area in the year). The failure is event=1
    My question is I am trying to use marital status (it is a categorical variable that has 3 groups: married/common-law; single; separated/widowed/divorced) as one factor in my cox regression, however, one challenge is that it may be possible maybe some immigrants in year 1 is single, in year 2 is still single, but then in year 3, his status changed to married.

    In this case, how should I code the variable for marital status? Is there a way to do it?? Please advise.

    Thanks
    Yuchen

  • #2
    Yuchen:
    I would simply leave things as they are.
    In longitudinal studies it is perfectly legal that the marital status changes as time elapses.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      The situation here can be described as "time-varying covariates." If you are doing a discrete time model, as I'm guessing you are with years as the time unit, you will presumably be using the strategy of expanding the data set so that there is record per year for each individual. In that case, there is no difficulty in having different values for the marital status variable in different years for the same individual. There might be some useful discussion of this issue at Stephen Jenkins' helpful website: https://www.iser.essex.ac.uk/resourc...sis-with-stata

      Comment

      Working...
      X