Description Usage Arguments Value References See Also Examples
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.
1 |
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 |
Returns a list with one element being the two optimal cutpoints obtained.
See main package help page.
1 2 3 4 5 6 7 8 9 10 11 12 | 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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.