Two-stage procedure for comparing hazard rate functions, especially suited for situation where hazard rate functions cross.
twostage(time, delta, group, nboot, alpha = 0.05, eps = 0.1)
a vector of type "numeric"
. Must be nonnegative.
Failure time or censoring time.
a vector of type "numeric"
of the same length
as time
. Must be zero or one. One indicates failure,
zero indicates censored.
a vector of type "numeric"
of the same length
as time
. Must be zero or one. One indicates treatment group,
zero indicates control group.
number of bootstrap samples. Must be positive integer.
significance level, must be between zero and one.
small number used in defining the test statistic. Must be between zero and one. See cited paper for discussion.
vector of P-values. "LRPV"
: p-value of the log-rank test,
"MTPV"
: p-value of the suggested stage-II test,
"TSPV"
: p-value of the two-stage test.
This procedure compares two hazard rate functions in two stages. In the first stage, the conventional log-rank test is performed, which is powerful only when the two hazard rate functions do not cross each other. When the two hazard rate functions cross each other, positive differences and negative differences between the two functions would be canceled out in the log-rank test statistic, resulting in ineffective comparison. If the log-rank test gives a significant result, then the entire two-stage procedure stops and we conclude that the two hazard rate functions are significantly different. Otherwise, the stage-II test is performed, which is designed specifically for detecting crossing difference between the two hazard rate functions and has the property that its test statistic is independent of the log-rank test statistic. The independence property is used in properly defining the p-value of the two-stage procedure, based on the p-values of the two individual tests.
Qiu, P. and Sheng, J. (2008). A two-stage procedure for comparing hazard rate functions. Journal of the Royal Statistical Society: Series B, 70:191-208.
# NOT RUN {
library(TSHRC)
data(rats)
attach(rats)
twostage(time, delta, group, nboot = 100)
# }
Run the code above in your browser using DataLab