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 area.
The time variable is the year (year 1, year 2, year 3..... etc), and the event is retention (0 if immigrants stay in rural area in the year, 1 if immigrants left rural area in the year). The failure is event=1
My questions is I am trying to use marital status (it is a categorical variable has 3 groups: married/common-law; single; seperated/widowed/divorced) as one factor in my cox regression, however, one challenge is it's possible that it is 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 maritial status? Is there a way to do it?? Please advise.
Thanks
Yuchen
Related Posts with Need help with survival analysis
Difficulty aggregating variables to the unit of analysis without losing or altering dataHello, I'm a first year grad student that is fairly new to Stata. I'm working on a project in which…
create a new var extracting part of string with varying lengthHi, How can I create a new var(var2) extracting part of string from var1 with varying length? The s…
Variability over time of positive and negative valuesHello, I'm interested in calculating the variability over time of a variable that can takes either …
create a new var extracting part of string with different lengthHi, How can I create a new var(var2) extracting part of string from var1 with different length? The…
bysort gen n = _n with if condition 1/2/3/4 is trueHello everybody, I have a hospital list (ik) doing several surgeries (haupt_op). Now I want create a…
Subscribe to:
Post Comments (Atom)
0 Response to Need help with survival analysis
Post a Comment