### Friday, February 24, 2006

## RE: st: discrete time survival analysis and logit model

> Date: Thu, 23 Feb 2006 11:22:48 -0600 (CST) > From: Fen Lin <lin@galton.uchicago.edu> > Subject: st: discrete time survival analysis and logit model > > Dear all, > > I am using a discrete time survivial model to analyze > diffusion a policy > among 30 countries. My data is in a person-period structure, > so i have > 30 sequences but 1228 data points. In stata, i use logit command: > > logit y x1 x2 x3 ln(duration), cluster(country) > > so the standard errors will be adjusted by cluster. i am wondering:

"ln(duration)" looks like an illegal variable name to me. And I bet x1 x2 x3 were not your actual variable names.

As the Statalist FAQ advises, show us what you actually typed. If it is necessary to explain what your covariates are, then do so afterwards.

> 1) is the deviance adjusted by cluaster as well? in the > output, number of > observation is 1228, rather than 30. Is it correct?

The relevant # obs here is the number of country-period obs. (I presume you mean that you have a country-period data structure, not person-period, as you wrote.)

To understand why, look at the expression for the likelihood contributions. (See e.g. the pdf book at my survival analysis web pages cited below my signature.)

If I recall correctly the deviance is a transformation of the log-likelihood, and I don't think it is affected by cluster. (Why should it be? Please revisit the "theory", and documentation for the command telling you what cluster options do.) I also note that -logit- does not return the deviance in output nor in e() results.

> 2) since my time interval is each year, i have lots of zero > in certain > year, and a tie in others (that is why i use discrete time > model). but i > cannot use "dhaz" command due to those zeros. there is always > a message > "no variation in event occurence in period 1". in this case, > how can i > calculate hazard?

What is "dhaz" and what is it intended to do? -findit dhaz- returns nothing.

> 3) my predicted probablity is between 0.002 to 0.35. how come > the phat > never larger than 0.5? ( i think it might because i use > "country" as unit > of analysis, then i have omiting variable bias.??)

What is "phat"?

Use of -predict- after -logit- returns the predicted probability for the particular country-period, i.e. the interval hazard. For examples of how to derive (and graph) the discrete hazard against duration for a country with a particular set of characteristics, see Lesson 6 at my website. It also shows how to derive and graph the discrete survivor function.

Stephen ------------------------------------------------------------- Professor Stephen P. Jenkins <stephenj@essex.ac.uk> Institute for Social and Economic Research University of Essex, Colchester CO4 3SQ, U.K. Tel: +44 1206 873374. Fax: +44 1206 873151. http://www.iser.essex.ac.uk Survival Analysis using Stata: http://www.iser.essex.ac.uk/teaching/degree/stephenj/ec968/

* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

Tag: statalist