Announcement

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

  • Event History Analysis

    Good Evening,
    I have a question related to Event History Analysis. I am trying to run this model for the first time therefore I shall be extremely grateful for any help regarding this. Here is a bit of background
    1. I am trying to see the association between climate induced migration. Since the area I am studying for does not have an exact lomgitudanl data I have created my own from a cross sectional data. I have data related to a persons birth per year and the time till the person migrated. I have used the following command to set the data
    stset Year if mig_dummy==1,id(id1) failure (mig_dummy==0)

    where Year is a repeated observarion for each individual identified by a uniqueid i.e. id1. For this I get the following results:
    id: id1
    failure event: mig_dummy == 0
    obs. time interval: (Year_Migrated[_n-1], Year_Migrated]
    exit on or before: failure
    if exp: mig_dummy==1
    36813 total observations
    36145 ignored at outset because of -if <exp>-
    668 observations remaining, representing
    668 subjects
    0 failures in single-failure-per-subject data
    1343882 total analysis time at risk and under observation
    at risk from t = 0
    earliest observed entry t = 0
    last observed exit t = 2014

    I try running the hazard function with the following command
    sts graph, tmax (2014) hazard ci kernel(rectangle) width(1)
    xlab (0(5) 2015) ylab(0 .05 .10 .15 .20 .25) xline(15 30 50 75)
    title (“Out Migration hazard in years”) note(“Out Migrant PDHS 2017-18”)
    saving (hazard_outmig, replace)
    However I get the error

    failure _d: mig_dummy == 0
    analysis time _t: Year_Migrated
    id: id1
    left and right boundary regions overlap;
    specify smaller bandwidth(s) in width()
    r(198);
    Could any one please tell me what am I doing wrong? My data on the dataex command is
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long id1 int Year_Migrated float mig_dummy
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 0
    1 2010 1
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
    2 2014 0
Working...
X