Package 'YPmodel'

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

Help Index


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

YPmodel

Examples

library(YPmodel)
	data(gastric)
	YPmodel(gastric, repNum=100)
	browseVignettes(package="YPmodel")

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)X = \min(T, C) and TT is the pooled lifetimes of the two groups

V2

Censor indicator vector, where δ=I(TC)\delta = I(T \leq C) and I()I(\cdot) is the indicator function.

V3

Group indicator vector, where Z=I(i>n1)Z = I(i > n_1), i=1,...,ni = 1, ..., n and n1<nn_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

YPmodel

Examples

library(YPmodel)
data(gastric)

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 gastric for instance.

startPoint

Start point for estimating β^\hat{\beta}.

nm

Parameter for parameter estimation, to define the upper boundary for the absolute value of β^\hat{\beta}.

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 YPmodel.inputData.

Estimate

A dataframe of estimation results, including 1) estimation of β^\hat{\beta}, 2) its confidential intervals and 3) the odds function of the control group R^(t,β^)\hat{R}(t,\hat{\beta}), generated by YPmodel.estimate.

IntervalBands

A dataframe of hazard ratios and related confidential intervals and bands, generated by YPmodel.IntervalBands.

LackFitTest

A dataframe of the two lack-of-fit tests for the semi-parametric model, generated by YPmodel.lackfittest.

Adlgrk

A dataframe of the two lack-of-fit tests, to test the hypothesis of equal distribution function in the two groups, generated by YPmodel.adlgrk.

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

YPmodel


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 gastric for instance.

Estimate

A dataframe of estimation results, including 1) estimation of β^\hat{\beta}, 2) its confidential intervals and 3) the odds function of the control group R^(t,β^)\hat{R}(t,\hat{\beta}), generated by YPmodel.estimate.

object

A dataframe of the two lack-of-fit tests, to test the hypothesis of equal distribution function in the two groups, generated by YPmodel.adlgrk.

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

YPmodel, YPmodel.estimate,

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 gastric for instance.

startPoint

Start point for estimating β^\hat{\beta}.

nm

The upper boundary for the absolute value of β^\hat{\beta}, and the default value is log(100)\log(100).

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 β^\hat{\beta}, when it is set as 1, the interval estimation will be performed.

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 β^\hat{\beta} and and its confidential intervals and R^(t,β^)\hat{R}(t,\hat{\beta}), generated by YPmodel.estimate.

object

A dataframe of estimation results, including estimation of β^\hat{\beta} and and its confidential intervals and R^(t,β^)\hat{R}(t,\hat{\beta}), generated by YPmodel.estimate, equally to x (different symbol for S4 method only).

Value

beta

Value of β^\hat{\beta}.

r

Value of R^(t,β^)\hat{R}(t,\hat{\beta}).

variance.beta1

Variance of the first variable of β^\hat{\beta}.

variance.beta2

Variance of the second variable of β^\hat{\beta}.

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

YPmodel

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)

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 gastric for instance.

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 β^\hat{\beta}, 2) its confidential intervals and 3) the odds function of the control group R^(t,β^)\hat{R}(t,\hat{\beta}), generated by YPmodel.estimate.

x

A dataframe of hazard ratios and related confidential intervals and bands, generated by YPmodel.IntervalBands.

object

A dataframe of hazard ratios and related confidential intervals and bands, generated by YPmodel.IntervalBands, equally to x (different symbol for S4 method only).

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%\% point-wise conffidence intervals of the hazard ratio function.

low3

Lower bounds for the 95%\% point-wise conffidence intervals of the hazard ratio function.

upp22

Upper bounds for the 95%\% simultaneous conffidence bands of the hazard ratio function.

low22

Lower bounds for the 95%\% simultaneous conffidence bands of the hazard ratio function.

upp90

Upper bounds for the 90%\%simultaneous conffidence bands of the hazard ratio function.

low90

Lower bounds for the 90%\% simultaneous conffidence bands of the hazard ratio function.

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

YPmodel, YPmodel.estimate

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)

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 gastric for instance.

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 YPmodel.lackfittest.

object

A dataframe of the two lack-of-fit tests, generated by YPmodel.lackfittest, equally to x (different symbol for S4 method only).

Value

newBest

Value of β^\hat{\beta} used in the two tests.

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

YPmodel, YPmodel.setRandom

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)