rhier {rolr} | R Documentation |
Finding Optimal Cutpoints Using a Hierarchical Method
Description
Using a hierarchical method, rhier
is used to find two optimal
cutpoints to divide the entire dataset into three groups based on a
continuous covariate and a survival outcome. Making use of the running
logrank test (rlr
), the method first identifies an optimal
cutpoint that gives the largest logrank statistic to split into two groups,
and then repeats the process in each of the resulting groups to find
additional two cutpoints. It then takes the cutpoint that gives the larger
test statistic between the two as the second optimal cutpoint.
Usage
rhier(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 |
Value
Returns a list with one element being the two optimal cutpoints obtained.
References
See main package help page.
See Also
Examples
library(rolr)
#simulate data with true underlying 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)
#finding optimal cutpoints using alt = 'decrease' option
res=rhier(times=d$times, status=d$status, x=d$x, ns=15, alt='decrease')
#do it again using alt = 'increase', the results are the same as earlier
#because it doesn't matter what you choose for the alt option
res2=rhier(times=d$times, status=d$status, x=d$x, ns=15, alt='increase')