mcmcSurv: mcmcsurv

Description Usage Arguments Value Examples

Description

mcmcsurv estimates a Bayesian Exponential or Weibull survival model via Markov Chain Monte Carlo (MCMC). Slice samplig is employed to draw the posterior sample of the model's survival stage parameters.

Returns a summary of a mfsurv object via summary.mcmc.

Usage

1
2
3
4
mcmcsurv(Y, Y0, C, X, N, burn, thin, w = c(1, 1, 1), m = 10, form)

## S3 method for class 'mcmcsurv'
summary(object, parameter = c("betas", "rho"), ...)

Arguments

Y

response variable.

Y0

the elapsed time since inception until the beginning of time period (t-1).

C

censoring indicator.

X

covariates for betas.

N

number of MCMC iterations.

burn

burn-in to be discarded.

thin

thinning to prevent from autocorrelation.

w

size of the slice in the slice sampling for (betas, gammas, rho).

m

limit on steps in the slice sampling.

form

type of parametric model (Exponential or Weibull).

object

an object of class mfsurv, the output of mfsurv.

parameter

one of three parameters of the mfsurv output. Indicate either "betas" or "rho".

...

additional parameter

Value

chain of the variables of interest.

list. Empirical mean, standard deviation and quantiles for each variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(95)
bgl <- Buhaugetal_2009_JCR
bgl <- subset(bgl, coupx == 0)
bgl <- na.omit(bgl)
Y   <- bgl$Y
X   <- as.matrix(cbind(1, bgl[,1:7]))
C   <- bgl$C
Y0  <- bgl$Y0
model2 <- mcmcsurv(Y = Y, Y0 = Y0, C =  C,  X = X,
                   N = 50,
                   burn = 20,
                   thin = 15,
                   w = c(0.5, 0.5, 0.5),
                   m = 5,
                   form = "Weibull")

summary(model2, parameter = "betas")

Nicolas-Schmidt/BayesMFSurv documentation built on Sept. 12, 2020, 12:59 a.m.