Learn R Programming

YPmodel (version 1.2)

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

  • newBestValue of $\hat{\beta}$ used in the two tests.
  • pvalu1p-value from martingale residual-based test.
  • pvalu2p-value from contrast-based test.
  • mobs1Parameter used in plotting martingale residual-based test.
  • mobs2Parameter used inplotting contrast-based test.
  • obsParameter used in plotting martingale residual-based test.
  • obs2Parameter used in plotting contrast-based test.
  • wtildCount1Parameter used in plotting martingale residual-based test.
  • lineCount1Parameter used in plotting martingale residual-based test.
  • wtildCount2Parameter used in plotting contrast-based test.
  • lineCount2Parameter used in plotting contrast-based test.

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

Run this code
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)

Run the code above in your browser using DataLab