require(rms)
require(survival)
# options(rmsdebug=TRUE)
x <- c(1, 3, 2, 4, 0)
y <- 1:5
y2 <- c(1:4, Inf)
Y <- Ocens(y, y2)
f <- orm.fit(y=Y, trace=1, family='loglog')
s <- Survival(f)
s(conf.int=.95)
s(times=c(1, 2, 2.1, 2.2, 2.99999, 3, 4, 4.1))
f <- orm(Y ~ x, family='loglog')
s <- Survival(f)
lp <- predict(f, data.frame(x=1:2))
lp
s(lp=lp)
s(lp=lp, time=3)
source('~/r/rms/r/survest.orm.r')
survest(f, times=2, conf.int=0)
predict(f, data.frame(x=1:2), type='fitted')
# For Y>=2
coef(f)[1] + coef(f)['x'] * (1:2)
s(times=c(1, 3), lp=lp)
X <- predict(f, data.frame(x=1:2), type='x')
s(X=X)
s(conf.int=0.95, X=X)
survest(f, x=X)
f <- survfit(Surv(y, y < 5) ~ 1, conf.type='log-log')
summary(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.