rsolr12 {rolr} | R Documentation |
Finding Optimal Cutpoints Using Simple Ordered Logrank (SOL) Tests
Description
Using two simple ordered logrank tests (SOL-1 and SOL-2), the
rsolr12
function finds two optimal cutpoints to divide the entire
dataset into three groups based on a continuous covariate and a survival
outcome. It is a fast procedure that makes use of the running logrank test
(rlr
) to improve on computing speed.
Usage
rsolr12(times, status, x, ns = 15, alt = "decrease",
method = "approximate")
Arguments
times |
Survival outcome. |
status |
Censoring indicator which takes 1 when an event occurs at end of study and 0 otherwise. |
x |
A continuous covariate. |
ns |
Minimum number of subjects in each group after dichotomizing the covariate. |
alt |
A character that takes either |
method |
A character that takes either |
Details
When the association is positive, that is, larger covariate
values leading to worse survival, and you enter alt = "decrease"
, the test
statistics will be positive, but if you enter trend = "increase"
the
test statistics will be negative. Opposite is true when the association
is negative. You want to make sure to enter the option so that the
resulting test statistics are positive.
Value
Returns a list with three elements, the first one being the test
statistics for all cutpoints considered (except the first and last ns
points), and the second and third elements being the best splits obtained
from using the SOL-1 and SOL-2 tests.
References
See main package help page.
See Also
Examples
library(rolr)
##### -------- Example 1
#simulate data with 2 underlying true cutpoints and hazard goes up as x goes up
d=simdata(nn = 150, hr = c(1, 2, 3), hazard.func = "step",
props=c(1/3, 1/3, 1/3), censoring.rate = 0)
#using alt = 'decrease', the test statistics are positive, so it is good
res=rsolr12(times=d$times, status=d$status, x=d$x, ns=15, alt='decrease')
names(res)
res[['best.splits.solr1']]
res[['best.splits.solr2']]
#do it again using alt = 'increase', now the test statistics are negative and
#so the results are not right. So you have to switch back to alt='decrease' to
#get positive statistics and the correct optimal cutpoints here.
res2=rsolr12(times=d$times, status=d$status, x=d$x, ns=15, alt='increase')
res2[['best.splits.solr1']]
res2[['best.splits.solr2']]
##### -------- Example 2
#simulate data with true cutpoints and hazard goes down as covariate goes up
d=simdata(nn = 150, hr = c(3, 2, 1), hazard.func = "step",
props=c(1/3, 1/3, 1/3), censoring.rate = 0)
#using alt = 'decrease', the test statistics are negative (so the results
#are not right).
res=rsolr12(times=d$times, status=d$status, x=d$x, ns=15, alt='decrease')
res[['best.splits.solr1']]
res[['best.splits.solr2']]
#do it again using alt = 'increase', now it is right
res2=rsolr12(times=d$times, status=d$status, x=d$x, ns=15, alt='increase')
res2[['best.splits.solr1']]
res2[['best.splits.solr2']]