multi_ts | R Documentation |
Performs a two-stage test for each pair of survival curves and apply a correction in case of several comparisons.
multi_ts(df, method = p.adjust.methods, eps = 0.1, nboot = 100)
df |
A dataframe with columns :
|
method |
The correction used for the p-values. Must be in p.adjust.methods. Default is the Holm correction. Unused if number of groups equals two. |
eps |
A number such that 0 < |
nboot |
A positive integer, number of bootstrap sample for the second stage; |
For a two-stage test, the first stage is a log-rank test. If the first test is significant, then the whole procedure stops and we conclude that the survival curves are different. If it is not significant, then the survival curves are either equal or crossing each other and the log-rank test can't conclude the difference. A second test is performed to distinguish these two cases.
For multiple curves comparison, the two-stage test is a pairwise test. A two-stage test is performed for each pair of curves.
An object of class multi_ts
containing:
results
: A matrix. Each row represents a comparison of two curves and contains
the p-values for both stage, the global p-value and the adjusted global p-value;
p
: The p-value for the global test;
nb_tests
: The number of performed Two-Stage tests;
the parameters eps
, method
and nboot
.
Qiu, P., & Sheng, J. (2008). A two-stage procedure for comparing hazard rate functions. Journal of the Royal Statistical Society Series B: Statistical Methodology, 70(1), 191-208. Chen, Zhongxue & Huang, Hanwen & Qiu, Peihua. (2017).
Chen, Z., Huang, H., & Qiu, P. (2017). An improved two-stage procedure to compare hazard curves. Journal of Statistical Computation and Simulation, 87(9), 1877-1886.
# test with a quarter of the data frame data_not_PH
ind = c(1:100, 401:500, 801:900)
multi_ts(data_not_PH[ind,], method = "BH", eps = 0.1, nboot = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.