Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > library(survival)
- > time = c(10, 15, 23, 30, 35, 52, 100)
- > dead = c(1, 1, 1, 1, 1, 1, 0)
- > fit = survfit(Surv(time, dead) ~ 1)
- > print(fit, print.rmean=TRUE)
- Call: survfit(formula = Surv(time, dead) ~ 1)
- records n.max n.start events *rmean *se(rmean) median 0.95LCL 0.95UCL
- 7.0 7.0 7.0 6.0 37.9 10.7 30.0 15.0 NA
- * restricted mean with upper limit = 100
- | no. of restricted
- | subjects mean Std. Err. [95% Conf. Interval]
- -------------+-------------------------------------------------------------
- total | 7 37.85714(*) 10.73888 16.8093 58.905
- (*) largest observed analysis time is censored, mean is underestimated
- fit.table = summary(fit, rmean=TRUE)$table # or, preferably, rmean=100
- rmean = fit.table[["*rmean"]] # Estimate restricted mean
- rmean.se = fit.table[["*se(rmean)"]] # Estimated standard error
- rmean + c(-1,1) * qnorm(.05/2, lower.tail=FALSE) * rmean.se # 95% CI
- [1] 16.80932 58.90497
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement