Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Issue with hazard function generated by sts graph


From   Masashi Miyairi <mmiyairi@uwo.ca>
To   statalist@hsphsun2.harvard.edu
Subject   st: Issue with hazard function generated by sts graph
Date   Mon, 05 Mar 2012 23:30:28 -0500

Hi everyone,

I see something strange when plotting hazard rates by "sts graph, hazard". For example,  when I apply the command to a set of simulated exponential random variables, I get a graph that has a upward sloping part in the very beginning. In theory, this shouldn't be the case because exponential random variables have constant hazards, so the graph shouldn't have a increasing pattern. I am wondering if this issue has been documented, or I am missing something using this command. The following is the code that generates my puzzle.

set obs 5000
* Generate exponential random variables
gen dur = -5*log( uniform() )
* Plot the hazard rates
stset dur
sts graph, hazard tmax(20)

Thank you,
Masashi Miyairi
Department of Economics
University of Western Ontario




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index