Learn R Programming

BGPhazard (version 1.2.3)

GaMRes: Markov Gamma Model

Description

Posterior inference for the Bayesian non-parametric Markov gamma model in survival analysis.

Usage

GaMRes(times, delta = rep(1, length(times)), type.t = 1, K = 5, 
alpha = rep(0.0001, K.aux), beta = rep(1e-04, K.aux),
c.r = rep(0, (K.aux - 1)), type.c = 4, epsilon = 1, iterations = 1000,
burn.in = floor(iterations * 0.2), thinning = TRUE, thpar = 5, printtime = TRUE)

Arguments

times

Numeric positive vector. Failure times.

delta

Logical vector. Status indicator. TRUE (1) indicates exact lifetime is known, FALSE (0) indicates that the corresponding failure time is right censored.

type.t

Integer. 1=uniformly-dense intervals; 2=unitary length intervals and 3=computes same length intervals.

K

Integer. Partition length for the hazard function if type.t=1 or type.t=3.

alpha

Nonnegative entry vector. Small entries are recommended in order to specify a non-informative prior distribution.

beta

Nonnegative entry vector. Small entries are recommended in order to specify a non-informative prior distribution.

c.r

Correlation vector. Its entries must be nonnegative integers.

type.c

1=defines c.r as a zero-entry vector; 2=lets the user define c.r feeely; 3=defines c.r by computing an exponential distribution with mean 1; 4=defines c.r by computing an exponential distribution with mean epsilon which has assigned a Ga(0.01, 0.01) distribution.

epsilon

Double. Mean of the exponential distribution assigned to c.r when type.c = 3. When type.c = 4, epsilon is assigned a Ga(0.01,0.01) distribution.

iterations

Integer. Number of iterations including the burn.in to be computed by the model.

burn.in

Integer. Length of the burn-in period for the Markov chain.

thinning

Logical. TRUE thins the Markov chain to reduce autocorrelation.

thpar

Integer. Factor by which the chain will be thinned if thinning=TRUE.

printtime

Logical. If TRUE, prints out the execution time.

Value

times

Numeric vector. Failure times.

delta

Numeric vector. Status indicator.

type.t

Integer.

tao

Numeric vector. Partition for hazard function's support.

K

Integer. Partition length.

t.unc

Numeric vector. Uncensored failure times sorted ascendingly.

iterations

Integer.

summary

Numeric matrix. Contains the resulting Markov chain for lambda, u, c.r and epsilon (if applicable).

S

Numeric matrix. Survival estimates for each state of the chain.

Details

Computes the Gibbs sampler given by the full conditional distributions of u and lambda (Nieto-Barajas & Walker, 2002) and arranges the resulting Markov chain into a matrix which can be used to obtain posterior summaries.

References

- Nieto-Barajas, L. E. & Walker, S. G. (2002). Markov beta and gamma processes for modelling hazard rates. Scandinavian Journal of Statistics 29: 413-424.

See Also

GaPlotDiag, GaPloth

Examples

Run this code
# NOT RUN {
## Simulations may be time intensive. Be patient.

## Example 1
#  data(gehan)
#  timesG <- gehan$time[gehan$treat == "6-MP"]
#  deltaG <- gehan$cens[gehan$treat == "6-MP"]
#  GEX1 <- GaMRes(timesG, deltaG, K = 8, iterations = 3000)

## Example 2
#  data(leukemiaFZ)
#  timesFZ <- leukemiaFZ$time
#  deltaFZ <- leukemiaFZ$delta
#  GEX2 <- GaMRes(timesFZ, deltaFZ, type.c = 4)
# }

Run the code above in your browser using DataLab