Learn R Programming

spBayesSurv (version 1.1.8)

GetCurves: Density, Survival, and Hazard Estimates

Description

This function estimates density, survival, and hazard functions given covariates.

Usage

GetCurves(x, xnewdata, xtfnewdata, tgrid = NULL, ygrid = NULL, 
          frail = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for survregbayes
plot(x, xnewdata, tgrid = NULL, 
     frail = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for frailtyGAFT
plot(x, xnewdata, xtfnewdata, tgrid = NULL, 
     frail = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for SuperSurvRegBayes
plot(x, xnewdata, tgrid = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for indeptCoxph
plot(x, xnewdata, tgrid = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for anovaDDP
plot(x, xnewdata, tgrid = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for spCopulaCoxph
plot(x, xnewdata, tgrid = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for spCopulaDDP
plot(x, xnewdata, tgrid = NULL, CI = 0.95, PLOT = TRUE, ...)
# S3 method for SpatDensReg
plot(x, xnewdata, ygrid = NULL, CI = 0.95, PLOT = TRUE, ...)

Value

Use names to find out what they are, where fhat represents density, Shat represents survival, hhat represents hazard. The credible bands are also provided, e.g., Shatlow represents the lower band and Shatup represents the upper band.

Arguments

x

an object obtained from the functions survregbayes, frailtyGAFT, SuperSurvRegBayes, indeptCoxph, anovaDDP, spCopulaCoxph, spCopulaDDP and SpatDensReg.

xnewdata

A data frame in which to look for variables with which to obtain estimated curves.

xtfnewdata

A data frame in which to look for variables with which to obtain estimated curves, used only for frailtyGAFT.

tgrid

a vector of grid points indicating where the curves will be estimated.

ygrid

a vector of grid points indicating where the curves will be estimated, used only for SpatDensReg.

frail

an optional matrix of posterior frailty values for survregbayes and frailtyGAFT, where the rows refer to clusters/regions and the number of columns is the length of thined MCMC chain. The default is to set frailties to be zero.

CI

a numeric value indicating the level of credible interval.

PLOT

a logical value indicating whether the estimated survival curves will be plotted.

...

further arguments to be passed to or from other methods.

Author

Haiming Zhou and Timothy Hanson

Details

This function estimates density, survival, and hazard functions given covariates.

See Also

survregbayes, frailtyGAFT, SuperSurvRegBayes, indeptCoxph, anovaDDP, spCopulaCoxph, spCopulaDDP and SpatDensReg