rmeanDiff.ahr: rmeanDiff.ahr

Description Usage Arguments Details Value Examples

View source: R/rmean.R

Description

Estimate difference of restricted mean survival (based on ahr object as returned by ahr)

Usage

1
rmeanDiff.ahr(ahr.obj)

Arguments

ahr.obj

object of class '"ahr"'

Details

This function is usefull if the function 'ahr' has already been called, since the survival estimates in the object returned by 'ahr' can be reused.

Value

An object of class '"rmd"', i.e. a list containing:

L

time limit, i.e. restricted mean up to time L is calculated

rmean1

restricted mean in group 1

rmean2

restricted mean in group 2

rmean.diff

estimated restricted mean difference

var.rmean1

an estimate of the asymptotic variance of the restricted mean in group 1

var.rmean2

an estimate of the asymptotic variance of the restricted mean in group 2

var.rmean.diff

an estimate of the asymptotic variance of the restricted mean difference

Z.rmean

the standardized test statistic for testing rmean.diff=0

p.value

p-value corresponding to Z.rmean

Examples

1
2
3
4
5
6
7
T <- c(rexp(100, 1), rexp(100, 2))
C <- c(rexp(100, 1), rexp(100, 2))
Y <- pmin(T, C)
D <- T <= C
Z <- rep(c(0,1), c(100, 100))
fit <- avgHR(2, data.frame(Y=Y, D=D, Z=Z), formula=Surv(Y, D) ~ Z)
rmd <- rmeanDiff.ahr(fit)

AHR documentation built on May 2, 2019, 2:38 a.m.