Title: | The Short-Term and Long-Term Hazard Ratio Model for Survival Data |
---|---|
Description: | Inference procedures accommodate a flexible range of hazard ratio patterns with a two-sample semi-parametric model. This model contains the proportional hazards model and the proportional odds model as sub-models, and accommodates non-proportional hazards situations to the extreme of having crossing hazards and crossing survivor functions. Overall, this package has four major functions: 1) the parameter estimation, namely short-term and long-term hazard ratio parameters; 2) 95 percent and 90 percent point-wise confidence intervals and simultaneous confidence bands for the hazard ratio function; 3) p-value of the adaptive weighted log-rank test; 4) p-values of two lack-of-fit tests for the model. See the included "read_me_first.pdf" for brief instructions. In this version (1.1), there is no need to sort the data before applying this package. |
Authors: | Junlong Sun and Song Yang |
Maintainer: | Junlong Sun <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.4 |
Built: | 2024-10-25 05:47:07 UTC |
Source: | https://github.com/junlongsun/ypmodel |
This package has four major functions related to the short-term and long-term hazard ratio model (Yang and Prentice, 2005): 1) YPmodel.estimate
es
timates short-term and long-term hazard ratio parameters and their confidence intervals, and the odds function of the control group; 2) YPmodel.IntervalBands
provides 95% pointwise confidence intervals and 95% and 90% simultaneous confidence bands for the hazard ratio function; 3) YPmodel.adlgrk
estimates p-value of the adaptive weighted log-rank test, to test for treatment effects with time to event data; 4) YPmodel.lackfittest
estimates p-values of two lack-of-fit tests for the model, to test for checking this semi-parametric model. See the included "read_me_first.pdf" for brief instructions.
Package: | YPmodel |
Type: | Package |
Version: | 1.2 |
Date: | 2015-09-20 |
License: | GPL (>= 3) |
Junlong Sun and Song Yang
1) YANG, S. AND PRENTICE, R. L. (2011). Estimation of the 2-sample hazard ratio function using a semiparametric model. Biostatistics 12, 354-368. 2) YANG, S. AND PRENTICE, R. L. (2010). Improved Logrank-Type Tests for Survival Data Using Adaptive Weights. Biometrics 66, 30-38. 3) YANG, S. AND PRENTICE, R. L. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika 92, 1-17. 4) YANG, S. AND ZHAO, Y. (2012). Checking the Short-Term and Long-Term Hazard Ratio Model for Survival Data. Scandinavian Journal of Statistics. 5) GASTROINTESTINAL TUMOR STUDY GROUP (1982). A comparison of combination chemotherapy and combined modality therapy for locally advanced gastric carcinoma. Cancer.
library(YPmodel) data(gastric) YPmodel(gastric, repNum=100) browseVignettes(package="YPmodel")
library(YPmodel) data(gastric) YPmodel(gastric, repNum=100) browseVignettes(package="YPmodel")
A sample data set from the Gastrointestinal Tumor Study Group (1982),on comparing chemotherapy with combined chemotherapy and radiation therapy, in the treatment of locally unresectable gastric cancer. Each treatment arm had 45 patients, with two observations of the chemotherapy group and six of the combination group censored. Kaplan-Meier plots of the two estimated survival curves cross at around 1000 days.
data(gastric)
data(gastric)
A dataframe with 90 observations on the following 3 variables.
V1
Lifetime vector (unite: year), where and
is the pooled lifetimes of the two groups
V2
Censor indicator vector, where and
is the indicator function.
V3
Group indicator vector, where ,
and
is the size of the control group.
GASTROINTESTINAL TUMOR STUDY GROUP (1982). A comparison of combination chemotherapy and combined modality therapy for locally advanced gastric carcinoma. Cancer.
library(YPmodel) data(gastric)
library(YPmodel) data(gastric)
The main function to perform parameter estimation and hypothesis testing. The corresponding S4 functions, plot.Y Pmodel
and print.Y Pmodel
, are also included to demonstrate the results.
YPmodel(...) ## Default S3 method: YPmodel(data, startPoint, nm, maxIter1, maxIter2, repNum, ...) ## S3 method for class 'YPmodel' print(x, ...) ## S3 method for class 'YPmodel' summary(object, ...) ## S3 method for class 'YPmodel' plot(x, ...)
YPmodel(...) ## Default S3 method: YPmodel(data, startPoint, nm, maxIter1, maxIter2, repNum, ...) ## S3 method for class 'YPmodel' print(x, ...) ## S3 method for class 'YPmodel' summary(object, ...) ## S3 method for class 'YPmodel' plot(x, ...)
... |
For S4 method only. |
data |
A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set |
startPoint |
Start point for estimating |
nm |
Parameter for parameter estimation, to define the upper boundary for the absolute value of |
maxIter1 |
Parameter of out-cycle iteration numbers. |
maxIter2 |
Parameter of inner-cycle iteration numbers. |
repNum |
Number of iterations, to be used in the two lack-of-fit tests. |
x |
A dataframe of results from an YPmodel default process. |
object |
A dataframe of results from an YPmodel default process, equally to x (different symbol for S4 method only). |
An object of class YPmodel
, basically a list including elements
Data |
A dataframe of source data, generated from input data by |
Estimate |
A dataframe of estimation results, including 1) estimation of |
IntervalBands |
A dataframe of hazard ratios and related confidential intervals and bands,
generated by |
LackFitTest |
A dataframe of the two lack-of-fit tests for the semi-parametric model, generated by |
Adlgrk |
A dataframe of the two lack-of-fit tests, to test the hypothesis of equal distribution function in the two groups, generated by |
Junlong Sun and Song Yang
1) YANG, S. AND PRENTICE, R. L. (2010). Improved Logrank-Type Tests for Survival Data Using Adaptive Weights. Biometrics 66, 30-38. 2) YANG, S. AND PRENTICE, R. L. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika 92, 1-17. 3) YANG, S. AND ZHAO, Y. (2012). Checking the Short-Term and Long-Term Hazard Ratio Model for Survival Data. Scandinavian Journal of Statistics.
YPmodel.estimate
,
YPmodel.IntervalBands
,
YPmodel.lackfittest
,
YPmodel.adlgrk
library(YPmodel) data(gastric) result <- YPmodel(gastric, repNum=100) summary(result) plot(result)
library(YPmodel) data(gastric) result <- YPmodel(gastric, repNum=100) summary(result) plot(result)
Internal functions for the YPmodel package.
Junlong Sun and Song Yang
A function to calculate p-value of the adaptive weighted logrank test.
## S3 method for class 'adlgrk' YPmodel(data, Estimate, ...) ## S3 method for class 'YPmodel.adlgrk' summary(object, ...)
## S3 method for class 'adlgrk' YPmodel(data, Estimate, ...) ## S3 method for class 'YPmodel.adlgrk' summary(object, ...)
... |
For S4 method only. |
data |
A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set |
Estimate |
A dataframe of estimation results, including 1) estimation of |
object |
A dataframe of the two lack-of-fit tests, to test the hypothesis of equal distribution function in the two groups, generated by |
An object of class YPmodel.adlgrk
, basically a list including elements
pval |
p-value from adaptively weighted logrank test. |
Junlong Sun and Song Yang
YANG, S. AND PRENTICE, R. L. (2010). Improved Logrank-Type Tests for Survival Data Using Adaptive Weights. Biometrics 66, 30-38.
library(YPmodel) data(gastric) Adlgrk <- YPmodel.adlgrk(data=gastric) summary(Adlgrk) Estimate <- YPmodel.estimate(data=gastric, interval=0) Adlgrk <- YPmodel.adlgrk(data=gastric, Estimate=Estimate)
library(YPmodel) data(gastric) Adlgrk <- YPmodel.adlgrk(data=gastric) summary(Adlgrk) Estimate <- YPmodel.estimate(data=gastric, interval=0) Adlgrk <- YPmodel.adlgrk(data=gastric, Estimate=Estimate)
The main function to fit the short-term and long-term hazard ration model.
## S3 method for class 'estimate' YPmodel(data, startPoint, nm, maxIter1, maxIter2, interval, Internal, ...) ## S3 method for class 'YPmodel.estimate' summary(object,...) ## S3 method for class 'YPmodel.survivor' plot(x, Internal, ...)
## S3 method for class 'estimate' YPmodel(data, startPoint, nm, maxIter1, maxIter2, interval, Internal, ...) ## S3 method for class 'YPmodel.estimate' summary(object,...) ## S3 method for class 'YPmodel.survivor' plot(x, Internal, ...)
... |
For S4 method only. |
data |
A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set |
startPoint |
Start point for estimating |
nm |
The upper boundary for the absolute value of |
maxIter1 |
Parameter of out-cycle iteration numbers. |
maxIter2 |
Parameter of inner-cycle iteration numbers. |
interval |
A binary parameter to control whether or not to perform interval estimation of |
Internal |
A dataframe of internal parameters, used only to perform hypothesis tests and plot (and to accelerate the speed). |
x |
A dataframe of estimation results, including estimation of |
object |
A dataframe of estimation results, including estimation of |
beta |
Value of |
r |
Value of |
variance.beta1 |
Variance of the first variable of |
variance.beta2 |
Variance of the second variable of |
Junlong Sun and Song Yang
YANG, S. AND PRENTICE, R. L. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika 92, 1-17.
library(YPmodel) data(gastric) Estimate <- YPmodel.estimate(data=gastric, interval=1) Estimate <- YPmodel.estimate(data=gastric, startPoint=c(0,0), nm=log(100)) Estimate <- YPmodel.estimate(data=gastric, maxIter1=50, maxIter2=20) summary(Estimate) plot(Estimate)
library(YPmodel) data(gastric) Estimate <- YPmodel.estimate(data=gastric, interval=1) Estimate <- YPmodel.estimate(data=gastric, startPoint=c(0,0), nm=log(100)) Estimate <- YPmodel.estimate(data=gastric, maxIter1=50, maxIter2=20) summary(Estimate) plot(Estimate)
A function to calculate the confidential intervals and bands of the hazard ratio function.
## S3 method for class 'IntervalBands' YPmodel(data, Internal, Estimate, ...) ## S3 method for class 'YPmodel.IntervalBands' summary(object, Internal, ...) ## S3 method for class 'YPmodel.IntervalBands' plot(x, Internal, ...)
## S3 method for class 'IntervalBands' YPmodel(data, Internal, Estimate, ...) ## S3 method for class 'YPmodel.IntervalBands' summary(object, Internal, ...) ## S3 method for class 'YPmodel.IntervalBands' plot(x, Internal, ...)
... |
For S4 method only. |
data |
A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set |
Internal |
A dataframe of internal parameters, used only to perform hypothesis tests and plot (and to accelerate the speed). |
Estimate |
A dataframe of estimation results, including 1) estimation of |
x |
A dataframe of hazard ratios and related confidential intervals and bands,
generated by |
object |
A dataframe of hazard ratios and related confidential intervals and bands,
generated by |
hr |
Estimation of the hazard ratio function. |
ld2 |
Lower bound of the time frame. |
ud2 |
Upper bound of the time frame. |
upp3 |
Upper bounds for the 95 |
low3 |
Lower bounds for the 95 |
upp22 |
Upper bounds for the 95 |
low22 |
Lower bounds for the 95 |
upp90 |
Upper bounds for the 90 |
low90 |
Lower bounds for the 90 |
Junlong Sun and Song Yang
YANG, S. AND PRENTICE, R. L. (2011). Estimation of the 2-sample hazard ratio function using a semiparametric model. Biostatistics 12, 354-368.
library(YPmodel) data(gastric) IntervalBands <- YPmodel.IntervalBands(data=gastric) summary(IntervalBands) plot(IntervalBands) Estimate <- YPmodel.estimate(data=gastric, interval=0) IntervalBands <- YPmodel.IntervalBands(data=gastric, Estimate=Estimate)
library(YPmodel) data(gastric) IntervalBands <- YPmodel.IntervalBands(data=gastric) summary(IntervalBands) plot(IntervalBands) Estimate <- YPmodel.estimate(data=gastric, interval=0) IntervalBands <- YPmodel.IntervalBands(data=gastric, Estimate=Estimate)
Four functions to perform the two lack-of-fit tests (martingale residual-based & contrast-based), to print results, and to draw randomly selected realizations of the process.
## S3 method for class 'lackfittest' YPmodel(data, repNum, Internal, ...) ## S3 method for class 'YPmodel.lackfittest' summary(object, ...) ## S3 method for class 'YPmodel.martint' plot(x, Internal, ...) ## S3 method for class 'YPmodel.survf' plot(x, Internal, ...)
## S3 method for class 'lackfittest' YPmodel(data, repNum, Internal, ...) ## S3 method for class 'YPmodel.lackfittest' summary(object, ...) ## S3 method for class 'YPmodel.martint' plot(x, Internal, ...) ## S3 method for class 'YPmodel.survf' plot(x, Internal, ...)
... |
For S4 method only. |
data |
A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set |
repNum |
Number of times the resampling simulations are done. |
Internal |
A dataframe of internal parameters, used only to perform hypothesis tests and plot (and to accelerate the speed). |
x |
A dataframe of the two lack-of-fit tests, generated by |
object |
A dataframe of the two lack-of-fit tests, generated by |
newBest |
Value of |
pvalu1 |
p-value from martingale residual-based test. |
pvalu2 |
p-value from contrast-based test. |
mobs1 |
Parameter used in plotting martingale residual-based test. |
mobs2 |
Parameter used inplotting contrast-based test. |
obs |
Parameter used in plotting martingale residual-based test. |
obs2 |
Parameter used in plotting contrast-based test. |
wtildCount1 |
Parameter used in plotting martingale residual-based test. |
lineCount1 |
Parameter used in plotting martingale residual-based test. |
wtildCount2 |
Parameter used in plotting contrast-based test. |
lineCount2 |
Parameter used in plotting contrast-based test. |
Junlong Sun and Song Yang
YANG, S. AND ZHAO, Y. (2012). Checking the Short-Term and Long-Term Hazard Ratio Model for Survival Data. Scandinavian Journal of Statistics.
library(YPmodel) data(gastric) LackFitTest <- YPmodel.lackfittest(data=gastric, repNum=100) summary.YPmodel.lackfittest(LackFitTest) plot(LackFitTest) plot.YPmodel.martint(LackFitTest) plot.YPmodel.survf(LackFitTest)
library(YPmodel) data(gastric) LackFitTest <- YPmodel.lackfittest(data=gastric, repNum=100) summary.YPmodel.lackfittest(LackFitTest) plot(LackFitTest) plot.YPmodel.martint(LackFitTest) plot.YPmodel.survf(LackFitTest)