Announcement

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

  • Data structure for Cox regression (spatial and lagged effects)

    Dear Stata users,

    I am working with a large administrative dataset, covering a period of 9 years. My DV is mortality; currently, my data is organised as the time to event (max. 108 months or time to failure/death).
    My IVs are both time-varying (e.g. income) and time-invariant. My main IV is county/district-level inequality measures.

    I've researched through the different survival analysis options in Stata, but unfortunately, I don't have anyone to consult with about the right model and data structure.

    Meanwhile, I've tried using the stcox and the following model with weibull distribution:

    stset t_months death
    streg gini2003_quint x2 x3..xn, dist(weib) frailty(gamma) shared(county) nolog


    However, I'm not sure I take into account the multilevel structure of my data and the time-varying variables. What I did so far is generating new variable with county-level value for each individual (so for example, all individuals living in county 1 have the same GDP per capita value in year 1, different value in year 2 and so on.)

    I would appreciate it if you could help me to define the data structure for both options while accounting for the random effects (county/district), and the etiology of the research question (individuals started the observation period in different ages). I'm still reading about the margins command in Cox proportional hazards model..

    While looking for an example, I saw the following data structure (attached) but I don't understand how to combine it with the aforementioned Stata commands.


    Thank you in advance,
    Shir


Working...
X