
Difference in restricted mean survival time between two groups
Source:R/survival_more.R
Rmstdiff.RdRMST_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)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"
#>