[R] Simulation from a model fitted by survreg.
sb at ihe.se
Wed Jul 28 14:58:28 CEST 2004
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.
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
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)
system i386, mingw32
More information about the R-help