rmsth | R Documentation |
A function to estimate the restricted mean survival time (RMST) and its variance from data
rmsth(y=c(1,2,3),d=c(1,1,0),tcut=2.0,eps=1.0e-08)
y |
observed times |
d |
non-censoring indicators |
tcut |
time point at which rmst is calculated |
eps |
A small number representing the error tolerance when comparing the event times |
More details
tcut |
time point at which rmst is calculated |
rmst |
estimated RMST |
var |
estimated variance of |
vadd |
estimated variance-covariance term of |
This estimates the restricted mean survival time and its asymptotic variance
Xiaodong Luo
Luo, et al. (2017)
lamt<-0.8
lamc<-0.4
n<-3000
tcut<-2.0
truermst<-(1-exp(-lamt*tcut))/lamt
tt<-rexp(n)/lamt
cc<-rexp(n)/lamc
yy<-pmin(tt,cc)
dd<-rep(1,n)
dd[tt>cc]<-0
aest<-rmsth(y=yy,d=dd,tcut=tcut)
aest
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.