Learn R Programming

PWEALL (version 1.3.0.1)

rmsth: Estimate the restricted mean survival time (RMST) and its variance from data

Description

A function to estimate the restricted mean survival time (RMST) and its variance from data

Usage

rmsth(y=c(1,2,3),d=c(1,1,0),tcut=2.0,eps=1.0e-08)

Value

tcut

time point at which rmst is calculated

rmst

estimated RMST

var

estimated variance of rmst

vadd

estimated variance-covariance term of rmst

Arguments

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

Author

Xiaodong Luo

Details

More details

References

Luo, et al. (2017)

Examples

Run this code
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

Run the code above in your browser using DataLab