Learn R Programming

AHR (version 1.5.0)

rmeanDiff.ahr: rmeanDiff.ahr

Description

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

Usage

rmeanDiff.ahr(ahr.obj)

Arguments

ahr.obj

object of class '"ahr"'

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

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.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab