Type: | Package |
Title: | The Short-Term and Long-Term Hazard Ratio Model for Survival Data |
Version: | 1.4 |
Date: | 2020-10-15 |
Author: | Junlong Sun and Song Yang |
Maintainer: | Junlong Sun <junlong.sun@gmail.com> |
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. |
License: | GPL (≥ 3) |
Depends: | R (≥ 3.5.0) |
NeedsCompilation: | no |
Packaged: | 2020-10-18 01:51:03 UTC; junlongsun |
Repository: | CRAN |
Date/Publication: | 2020-10-19 23:10:16 UTC |
The short-term and long-term hazard ratio model for survival data
Description
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.
Details
Package: | YPmodel |
Type: | Package |
Version: | 1.2 |
Date: | 2015-09-20 |
License: | GPL (>= 3) |
Author(s)
Junlong Sun and Song Yang
References
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.
See Also
Examples
library(YPmodel)
data(gastric)
YPmodel(gastric, repNum=100)
browseVignettes(package="YPmodel")
A main function of package of model of short-term and long-term hazard ratio for survival data
Description
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.
Usage
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, ...)
Arguments
... |
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). |
Value
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 |
Author(s)
Junlong Sun and Song Yang
References
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.
See Also
YPmodel.estimate
,
YPmodel.IntervalBands
,
YPmodel.lackfittest
,
YPmodel.adlgrk
Examples
library(YPmodel)
data(gastric)
result <- YPmodel(gastric, repNum=100)
summary(result)
plot(result)
Internal functions for Model of short-term and long-term hazard ratio for survival data
Description
Internal functions for the YPmodel package.
Author(s)
Junlong Sun and Song Yang
See Also
Beta confidential intervals & bands
Description
A function to calculate the confidential intervals and bands of the hazard ratio function.
Usage
## 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, ...)
Arguments
... |
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 |
Value
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 |
Author(s)
Junlong Sun and Song Yang
References
YANG, S. AND PRENTICE, R. L. (2011). Estimation of the 2-sample hazard ratio function using a semiparametric model. Biostatistics 12, 354-368.
See Also
Examples
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)
Adaptively weighted logrank test
Description
A function to calculate p-value of the adaptive weighted logrank test.
Usage
## S3 method for class 'adlgrk'
YPmodel(data, Estimate, ...)
## S3 method for class 'YPmodel.adlgrk'
summary(object, ...)
Arguments
... |
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 |
Value
An object of class YPmodel.adlgrk
, basically a list including elements
pval |
p-value from adaptively weighted logrank test. |
Author(s)
Junlong Sun and Song Yang
References
YANG, S. AND PRENTICE, R. L. (2010). Improved Logrank-Type Tests for Survival Data Using Adaptive Weights. Biometrics 66, 30-38.
See Also
Examples
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)
YPmodel Estimate Parameters.
Description
The main function to fit the short-term and long-term hazard ration model.
Usage
## 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, ...)
Arguments
... |
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 |
Value
beta |
Value of |
r |
Value of |
variance.beta1 |
Variance of the first variable of |
variance.beta2 |
Variance of the second variable of |
Author(s)
Junlong Sun and Song Yang
References
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.
See Also
Examples
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)
Martingale residual-based & contrast-based lack-of-fit tests
Description
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.
Usage
## 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, ...)
Arguments
... |
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 |
Value
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. |
Author(s)
Junlong Sun and Song Yang
References
YANG, S. AND ZHAO, Y. (2012). Checking the Short-Term and Long-Term Hazard Ratio Model for Survival Data. Scandinavian Journal of Statistics.
See Also
Examples
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)
Data from Gastrointestinal Tumor Study Group
Description
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.
Usage
data(gastric)
Format
A dataframe with 90 observations on the following 3 variables.
V1
Lifetime vector (unite: year), where
X = \min(T, C)
andT
is the pooled lifetimes of the two groupsV2
Censor indicator vector, where
\delta = I(T \leq C)
andI(\cdot)
is the indicator function.V3
Group indicator vector, where
Z = I(i > n_1)
,i = 1, ..., n
andn_1 < n
is the size of the control group.
References
GASTROINTESTINAL TUMOR STUDY GROUP (1982). A comparison of combination chemotherapy and combined modality therapy for locally advanced gastric carcinoma. Cancer.
See Also
Examples
library(YPmodel)
data(gastric)