BayesPiecewiseHazardCOV: Samples from the PEH Cox model with a patient covariate...

View source: R/RcppExports.R

BayesPiecewiseHazardCOVR Documentation

Samples from the PEH Cox model with a patient covariate vector.

Description

Samples from the Piecewise Exponential Hazard (PEH) Cox model with a patient covariate vector and returns a list containing posterior parameters and posterior restricted mean survival.

Usage

BayesPiecewiseHazardCOV(Y, I1, COV, Poi, B)

Arguments

Y

Vector of event or censoring times.

I1

Vector of event indicators.

COV

Matrix of size nxp containing p patient covariates.

Poi

Prior mean number of split points.

B

Number of iterations for MCMC.

Value

Returns a list containing posterior samples of (1) the split point locations, (2) the log-hazards at each split point, (3) the number of split points, (4) the variance parameter for the log-hazard values, (5) the coefficients in the Cox model.

Examples

##Generate Data
Y=rweibull(20,4,1)
I=rbinom(20,1,.5)
COV = matrix(rnorm(40,0,1),ncol=2)
##Hyperparameter for number of split points
Poi=5
##Number of iterations for MCMC
B=200
BayesPiecewiseHazardCOV( Y, I,COV, Poi,  B)

BayesReversePLLH documentation built on Oct. 20, 2022, 5:05 p.m.