rmsth: Estimate the restricted mean survival time (RMST) and its...

Description Usage Arguments Details Value Note Author(s) References Examples

Description

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

Usage

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

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

Details

More details

Value

tcut

time point at which rmst is calculated

rmst

estimated RMST

var

estimated variance of rmst

vadd

estimated variance-covariance term of rmst

Note

This estimates the restricted mean survival time and its asymptotic variance

Author(s)

Xiaodong Luo

References

Luo, et al. (2017)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

Example output

$tcut
[1] 2

$rmst
[1] 1.00104

$var
[1] 0.6096751

$vadd
[1] 1.377253

PWEALL documentation built on May 2, 2019, 4:16 a.m.

Related to rmsth in PWEALL...