rmolr {rolr} | R Documentation |
Finding Optimal Cutpoints Using Modified Ordered Logrank (MOL) Tests
Description
Using the modified ordered logrank test (MOL), the rmolr
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
rmolr(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 true association is positive, that is, larger covariate
values lead 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 true 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 two elements, with the first being the test statistics for all cutpoints considered and the second being the best splits from the MOL tests.
References
See main package help page.
See Also
Examples
library(rolr)
##### -------- Example 1
#simulate data with true cutpoints and hazard goes up as covariate 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 the results
#are correct.
res=rmolr(times=d$times, status=d$status, x=d$x, ns=15, alt='decrease')
names(res)
#do it again using alt = 'increase', now the test statistics are negative
#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=rmolr(times=d$times, status=d$status, x=d$x, ns=15, alt='increase')
names(res2)
##### -------- 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 and so the results
#are not right.
res=rmolr(times=d$times, status=d$status, x=d$x, ns=15, alt='decrease')
res[['best.splits.molr']]
#do it again using alt = 'increase', now the test statistics are positive
#and thus the results are correct.
res2=rmolr(times=d$times, status=d$status, x=d$x, ns=15, alt='increase')
res2[['best.splits.molr']]