Skip to contents

RMST_1 - RMST_2 with standard error sqrt(V1 + V2), the two groups treated as independent.

Usage

Rmstdiff(time, event, group, tau = NULL, alpha = 0.05)

morie_survival_rmst_diff(time, event, group, tau = NULL, alpha = 0.05)

Arguments

time

observed follow-up times.

event

event indicator, 1 = event, 0 = censored.

group

two-level grouping vector.

tau

restriction horizon; defaults to the largest event time common to both groups.

alpha

significance level for the interval.

Value

list with the difference, its standard error, the confidence interval and each group's RMST.

References

Klein, J. P. and Moeschberger, M. L. (2003). Survival Analysis, 2nd ed., Springer.

Examples

ST <- c(5, 6, 6, 2.5, 4, 4, 3, 3, 1, 2, 2, 3, 7, 8, 9, 10)
SE <- c(1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1)
g <- c(rep(0, 8), rep(1, 8))
Rmstdiff(ST, SE, g)
#> $difference
#> [1] -0.02916667
#> 
#> $se
#> [1] 0.8747841
#> 
#> $z
#> [1] -0.03334156
#> 
#> $p_value
#> [1] 0.9734022
#> 
#> $lower
#> [1] -1.743712
#> 
#> $upper
#> [1] 1.685379
#> 
#> $tau
#> [1] 6
#> 
#> $tau_capped
#> [1] FALSE
#> 
#> $levels
#> [1] "0" "1"
#> 
#> $rmst
#> [1] 4.395833 4.425000
#> 
#> $ratio
#> [1] 0.9934087
#> 
#> $method
#> [1] "difference of restricted means over a COMMON horizon"
#>