[R] Simulation from a model fitted by survreg.

Sixten Borg sb at ihe.se
Wed Jul 28 14:58:28 CEST 2004


Dear list,

I would like to simulate individual survival times from a model that has been fitted using the survreg procedure (library survival). Output shown below.

My plan is to extract the shape and scale arguments for use with rweibull() since my error terms are assumed to be Weibull, but it does not make any sense. The mean survival time is easy to predict, but I would like to simulate individual survival times.

I am probably missing something completely obvious. Any hints or advice are appreciated.

Thanks
Sixten

> summary(mod1)

Call:
survreg(formula = Surv(tid, study$first.event.death) ~ regim + 
    age + stadium2, data = study, dist = "weibull")
              Value Std. Error      z        p
(Intercept) 11.6005     0.7539 15.387 2.01e-53
regimposto  -0.1350     0.1558 -0.867 3.86e-01
age         -0.0362     0.0102 -3.533 4.11e-04
stadium2ii  -0.0526     0.2794 -0.188 8.51e-01
Log(scale)  -0.5148     0.1116 -4.615 3.93e-06

Scale= 0.598 

Weibull distribution
Loglik(model)= -680.7   Loglik(intercept only)= -689.2
        Chisq= 16.87 on 3 degrees of freedom, p= 0.00075 
Number of Newton-Raphson Iterations: 8 
n=1183 (4 observations deleted due to missing)

> version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    8.1            
year     2003           
month    11             
day      21             
language R              
>




More information about the R-help mailing list