|
DATA MINING
Desktop Survival Guide by Graham Williams |
|
|||
Simple |
> s.survreg <- survreg(s.Surv ~ age, data=simple) > summary(s.survreg) |
Call:
survreg(formula = s.Surv ~ age, data = simple)
Value Std. Error z p
(Intercept) 10.928 1.2622 8.66 4.81e-18
age -0.145 0.0201 -7.22 5.35e-13
Log(scale) -1.979 0.4541 -4.36 1.31e-05
Scale= 0.138
Weibull distribution
Loglik(model)= -5.9 Loglik(intercept only)= -12.7
Chisq= 13.64 on 1 degrees of freedom, p= 0.00022
Number of Newton-Raphson Iterations: 11
n= 10
|
> s.pred <- predict(s.survreg, simple)
> s.pred.q <- predict(s.survreg, simple, type="quantile")
> result <- cbind(data.frame(simple$time, s.pred), s.pred.q)
> names(result) <- c("Actual", "Predicted", "Lower", "Upper")
> head(result)
|
Actual Predicted Lower Upper 1 1 38.797001 28.424796 43.538082 2 2 2.118099 1.551835 2.376935 3 3 80.262215 58.804471 90.070438 4 5 343.508197 251.672817 385.485671 5 7 6.777773 4.965765 7.606032 6 11 38.797001 28.424796 43.538082 |