Package 'YPmodelPhreg'

Title: The Short-Term and Long-Term Hazard Ratio Model with Proportional Adjustment
Description: Provides covariate-adjusted comparison of two groups of right censored data, where the binary group variable has separate short-term and long-term effects on the hazard function, while effects of covariates such as age, blood pressure, etc. are proportional on the hazard. The model was studied in Yang and Prentice (2015) <doi:10.1002/sim.6453> and it extends the two sample version of the short-term and long-term hazard ratio model proposed in Yang and Prentice (2005) <doi:10.1093/biomet/92.1.1>. The model extends the usual Cox proportional hazards model to allow more flexible hazard ratio patterns, such as gradual onset of effect, diminishing effect, and crossing hazard or survival functions. This package provides the following: 1) point estimates and confidence intervals for model parameters; 2) point estimate and confidence interval of the average hazard ratio; and 3) plots of estimated hazard ratio function with point-wise and simultaneous confidence bands.
Authors: Daewoo Pak [aut, cre], Song Yang [aut]
Maintainer: Daewoo Pak <[email protected]>
License: GPL (>= 2)
Version: 1.0.0
Built: 2025-03-10 02:32:17 UTC
Source: https://github.com/cran/YPmodelPhreg

Help Index


The Short-Term and Long-Term Hazard Ratio Model with Proportional Adjustment

Description

This package fits a semiparametric short term and long term hazard ratio model for the group variable, adjusted for proportional covariate effects. The model was studied in Yang and Prentice (2015), and it extends the two sample results in Yang and Prentice (2005). The model accommodates various non-proportional hazards scenarios including those with crossing hazards or survival functions. The main function of the package is ypreg, which provides the estimates and confidence intervals of the model parameters, the average hazard ratio, and the hazard ratios at user-specified time points. Plots of point-wise and simultaneous confidence bands are also given.

Details

Package: YPmodelPhreg
Type: Package
Version: 1.0.0
Date: 2023-04-21
License: GPL (>= 3)

Value

No return value, called for side effects

Author(s)

Daewoo Pak and Song Yang Maintainer: Daewoo Pak <[email protected]>

References

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.

See Also

ypreg

Examples

library(YPmodelPhreg)
data(colonexample)
head(colonexample)

res <- ypreg(colonexample, time.hr = c(1, 7))
res
plot(res)

An example from Chemotherapy for Stage B/C colon cancer

Description

The example colonexample in this package was created using data from one of the first successful trials of adjuvant chemotherapy for colon cancer. The original data set is available from colon in the survival library. The data set colonexample here uses only records with etype = 2 and rx = 1 or 3, and it includes three variables: extent, surg, and node4.

Usage

data("colonexample")

Format

A data frame with 619 observations on the following 6 variables.

time

time until event or censoring (in years)

event

censoring status (1 = event, 0 = censored)

group

group indicator (1 = Lev(amisole)+5-FU), 0 = Obs(ervation))

X1

a binary covariate for extent (1 = serosa or contiguous structures, 0 = submucosa or muscle)

X2

a binary covariate for surg (1=long, 0=short)

X3

a binary covariate for node4 (1 = more than 4 positive lymph nodes, 0 = otherwise)

See Also

ypreg

Examples

library(YPmodelPhreg)
data(colonexample)
head(colonexample)

Internal functions for the YPmodelPhreg package

Description

Internal functions for the YPmodelPhreg package.

Value

No return value, called for side effects


Fit a short-term and long-term hazard ratio model with proportional adjustment

Description

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).

Usage

## Default S3 method:
ypreg(data, alpha = 0.05, time.hr = NULL,
  L = NULL, U = NULL, repnum = 5000, tau = NULL, ...)

Arguments

...

for S4 method only.

data

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.

alpha

A numeric value for the significance level. The default is 0.050.05.

time.hr

A numeric vector of time points at which hazard ratios will be estimated along with confidence intervals.

L

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.

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.

repnum

The number of replications for the re-sampling method. The default is 50005000.

tau

A numeric value for the maximum follow-up time. The default is 0.9×0.9\timesthe maximum of all observations.

Details

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.

Value

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:

fit_coxph

estimation results from the Cox proportional hazards model

best_b0

the estimates from the short-term and long-term hazard ratio model without proportional adjustment

best_ypx

the estimates from the short-term and long-term hazard ratio model with proportional adjustment

res_summ

summary of estimation results with the covariate-adjusted short-term and long-term hazard ratio model

res_hrci

estimation results of hazard ratios at time.hr

References

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.

See Also

plot.ypreg

Examples

library(YPmodelPhreg)
data(colonexample)
head(colonexample)

res <- ypreg(colonexample, time.hr = c(1, 7))
res
plot(res)