Dear Stata Users,
I am using stata routines to do survival analysis. I am interested estimate expected and 
median survival time. 
By following Professor Stephen P. Jenkins notes and codes and using duration data I 
got the following results.
* Weibull model, PH, coeffients
streg drug age, dist(weibull) nolog nohr
predict xb, xb
su xb
di "WEIBULL MODEL"
* median duration for each person in sample
ge mediand = (ln(2)*exp(-xb))^(1/e(aux_p))
* expected (mean) duration for each person in sample
ge meand = exp(-xb/e(aux_p))*exp(lngamma(1+1/e(aux_p)))
 Variable |       Obs        Mean    
Std. Dev.       Min        Max
-------------+--------------------------------------------------------
          _d |        22    
.8181818     .394771          0          1
         _t0 |        22           
0           0          0          
0
          _t |        22    
12.77273    8.123639          1         32
     mediand |  22     13.0186    3.276344   
8.531759    19.7746
       meand |  22    14.97909    3.769734   
9.816569   22.75249
This makes sense to me because median and mean duration min and max values are 
within the range of actual max value. 
But when I am usually exactly these codes on my data I am getting some values which 
are quite extreme. Am I making some mistake? 
Here is the command I am using and results I am getting.
streg   variable list.........., dist(weibull) nolog nohr
predict xb, xb
di "WEIBULL MODEL"
* median duration for each person in sample
ge mediand = (ln(2)*exp(-xb))^(1/e(aux_p))
* expected (mean) duration for each person in sample
ge meand = exp(-xb/e(aux_p))*exp(lngamma(1+1/e(aux_p)))
    Variable |       Obs        
Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
          _d |    269512    .0049831     
.070415          0          1
         _t0 |    269512    10.33649    
6.762769          0   28.32854
          _t |    269512    10.41994    
6.762693   .0629706   28.41342
     mediand | 269512    40.65339     63.9578    
.142106   1261.704
       meand | 269512    69.90463    109.9772   
.2443553   2169.535
Yaseen Ghulam
Senior Lecturer in Banking and Finance
Department of Economics  
Portsmouth Business School
University of Portsmouth, Richmond Building
Portland Street, Portsmouth
*
*   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/