I might have asked this question before, but I didn't get an adequate answer, I might have asked the question in an unclear way.
I have an unbalanced dataset for the period extending from 2000-2012. Firms started to adopt a specific policy voluntarily in 2005 knowing that the adoption is not simultaneous. I mean firms adopted the policy in different years. For instance, a group of firms adopted in 2005, while others adopted in 2006, and so on. The main aim is to study what factor drives firms to implement these policies. I have applied the discrete hazard proportional odd regression “Multi-period logistic regression”. So, I had to delete all observations after the implementation. The dependent variable is the policy coded zero for all firm-year observations before the adoption and coded 1 in the year of adoption, where all observations after the adoption have been deleted. Also, I have built a calendar time variables. Then, I have applied the following code:
Code:
encode Companyname , gen (COMPID) global id COMPID lab var TIME "SPELL YEAR" lab var Event"Binary depvar for discrete hazard model" ta TIME, ge (d) ds d* ge e1 = TIME <=4 ge e2= TIME >=5 & TIME <=7 ge e3= TIME >=8 & TIME <=10 logit Event Var1 Var2 Var3 e2 e3, nolog cluster (COMPID)
Code:
xtlogit Dep X1 X2 X3 i.Year, re xtlogit Dep X1 X2 X3 i.Year, fe
Many thanks in advance.
0 Response to Survival Analysis (Discrete hazard proportional odd)
Post a Comment