The main results of the function are the estimations of:
parameters in the covariate-adjusted short-term and long-term hazard ratio model with confidence intervals;
the average hazard ratio with the confidence interval; and
the hazard ratio function along with point-wise and simultaneous confidence bands (confidence intervals for the hazard ratios at specific user input time points are also given).
# S3 method for default
ypreg(data, alpha = 0.05, time.hr = NULL,
L = NULL, U = NULL, repnum = 5000, tau = NULL, ...)an object of S3 ypreg class representing the fit. The object also includes the results of the Cox proportional hazards model, implemented by using the coxph function in the survival library.
A list with at least the following elements:
estimation results from the Cox proportional hazards model
the estimates from the short-term and long-term hazard ratio model without proportional adjustment
the estimates from the short-term and long-term hazard ratio model with proportional adjustment
summary of estimation results with the covariate-adjusted short-term and long-term hazard ratio model
estimation results of hazard ratios at time.hr
for S4 method only.
A numeric matrix containing all variables in the data set. The columns must follow this order: 1) time until event or censoring, 2) censoring status (1 = event, 0 = censored), 3) binary group indicator taking values of 0 and 1 (e.g., 1 = treatment, 0 = control for a randomized trial), and 4) a set of numeric vectors of covariates. See the data structure of colonexample.
A numeric value for the significance level. The default is \(0.05\).
A numeric vector of time points at which hazard ratios will be estimated along with confidence intervals.
A numeric value for the lower bound of the range [L, U] over which the simultaneous confidence bands for the hazard function are calculated. There must be at least one uncensored observation after the value of L and L < U.
A numeric value for the upper bound of the range [L, U] over which the simultaneous confidence bands for the hazard function are calculated. There must be at least one uncensored observation before the value of U and U > L.
The number of replications for the re-sampling method. The default is \(5000\).
A numeric value for the maximum follow-up time. The default is \(0.9\times\)the maximum of all observations.
The confidence intervals for the hazard ratios are obtained using the logarithmic transformation. When the user input interval [L, U] is different from the default interval, the intersection of the user input interval and the default interval is used. The point-wise confidence intervals and the simultaneous confidence bands can be plotted by supplying the object being returned by the function ypreg to the function plot.ypreg.
Yang, S., & Prentice, R. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika, 92(1), 1-17.
Yang, S., & Prentice, R. L. (2015). Assessing potentially time-dependent treatment effect from clinical trials and observational studies for survival data, with applications to the Women's Health Initiative combined hormone therapy trial. Statistics in medicine, 34(11), 1801-1817.
plot.ypreg
library(YPmodelPhreg)
data(colonexample)
head(colonexample)
res <- ypreg(colonexample, time.hr = c(1, 7))
res
plot(res)
Run the code above in your browser using DataLab