Description Usage Arguments Value Examples
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
.
1 2 3 4 |
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 |
parameter |
one of three parameters of the mfsurv output. Indicate either "betas" or "rho". |
... |
additional parameter |
chain of the variables of interest.
list. Empirical mean, standard deviation and quantiles for each variable.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.