Announcement

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

  • Set Age Ranges in Cohort Dataset

    Hello, everyone


    I'm in doubt about how to define age ranges to run regression models across age ranges in a cohort dataset. More specifically, my data comprises individuals who entered into a specific cohort between 2008-2018, and, furthermore, this dataset was used as a reference to merge with hospitalization information from another source of data by the id number.

    My data looks like this bellow
    id Year of Entry Age of Entry Year of Birth Hospitalization Year Age of Hospitalization
    1 2008 8 2000 2009 9
    2 2009 10 1999 . .
    3 2011 40 1971 2015 44
    4 2015 20 1995 2017 22
    5 2016 30 1986 . .
    This way, my next step is to calculate determinants of hospitalization among individuals in specific age ranges (i.e 0-10; 11-20; 21-30; 31-40; 41-50, etc), but I'm not so sure about how to do that regarding the fact that we have people who entered into the cohort in different periods, at different ages and was admitted in different periods of time. Additionally, as you can see in the example above, in my dataset I also have some individuals who have not been admitted.
    Does anyone help me to solve that?
    Last edited by Jose Albuquerque; 12 Oct 2022, 12:56.

  • #2
    Jose:
    welcome to this forum.
    Why not considering a survival analysis instead, setting the time at risk of the failure event hospitalization?
    See the -st- suite of commands in Stata .pdf manual.
    in addition, as different option, you may want to consider a logistic regression, that has hospitalization yes/no as the regressand and include age as a continuous prrdictor with both its linear and squared terms to search for possible turning points.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hey, Carlos. Thank you very much for your suggestion! I am considering the run a survival analysis, but before that, I need to analyze the determinants of admission firstly for all sample and then by age groups (0-10; 11-20; 21-30; 31-40; 41-50). Due to the dichotomic nature of my dependent variable, I'll be running a logistic regression of hospitalization (yes/no) against a wide set of controls individual controls (e.g. The point that I'm actually struggling with is how to set those age groups in Stata regarding that my cohort dataset has individuals who applied at different points in time (2008, 2009, 2011, 2015, 2016), different ages, and were admitted in different years. More specifically, is there any command in Stata that creates those age groups taking into consideration the specification of my dataset?

      Comment


      • #4
        Jose:
        I think that you've to create age classes by hand (class 1 example follows):
        Code:
        gen age_class_0_10=1 if age <=10
        and then -label- all the age classes.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X