Firstly, the function bayessurvreg1
has to be used to
obtain a sample from the posterior distribution of unknown quantities.
Directly, posterior predictive quantiles and means of asked quantities
are computed and stored in files.
Function predictive.control
serves only to perform some input
checks inside the main function predictive
.
predictive(formula, random, time0 = 0, data = parent.frame(), grid, type = "mixture", subset, na.action = na.fail, quantile = c(0, 0.025, 0.5, 0.975, 1), skip = 0, by = 1, last.iter, nwrite, only.aver = FALSE, predict = list(Et=TRUE, t=FALSE, Surv=TRUE, hazard=FALSE, cum.hazard=FALSE), store = list(Et=TRUE, t = FALSE, Surv = FALSE, hazard = FALSE, cum.hazard=FALSE), Eb0.depend.mix = FALSE, dir = getwd(), toler.chol = 1e-10, toler.qr = 1e-10)
predictive.control(predict, store, only.aver, quantile)
bayessurvreg1
.random
statement as that one used to sample from the
posterior distribution of unknown quantities by the function
bayessurvreg1
.data.frame
similar to that one used to obtain a sample from
the posterior distribution. In this new data.frame
, put
covariate values equal to these for which predictive quantities are
to be obtained. If cluster
statement was used, assign a
unique cluster identification to each observation. Response variable
and a censoring indicator may be set to arbitrary values. They are
only used in formula
but are ignored for computation.data
or a vector
giving grids of values where predictive survivor functions, hazards, cumulative
hazards are to be evaluated. If it is a vector, same grid is used for all
observations from data
. Not needed if only predict$t
or predict$Et
are TRUE
. If time0
is different
from zero your grid should start at time0
and not at zero.data
to be
used. This option will normally not be needed.NA
s in the
data. The user is discouraged to change a default value
na.fail
.mixmoment.sim
.nwrite
th iteration count of
iterations change).TRUE
only posterior predictive mean is
computed for all quantities and no quantiles.
FALSE
(default) you have the same model as that
one described in an accompanying paper. An ordinary user is
discouraged from setting this to TRUE
.Komárek, A. and Lesaffre, E. (2007). Bayesian accelerated failure time model for correlated interval-censored data with a normal mixture as an error distribution. Statistica Sinica, 17, 549--569.
## See the description of R commands for
## the models described in
## Komarek (2006),
## Komarek and Lesaffre (2007).
##
## R commands available
## in the documentation
## directory of this package as
## - ex-cgd.R and
## http://www.karlin.mff.cuni.cz/~komarek/software/bayesSurv/ex-cgd.pdf
##
## - ex-tandmobMixture.R and
## http://www.karlin.mff.cuni.cz/~komarek/software/bayesSurv/ex-tandmobMixture.pdf
##
Run the code above in your browser using DataLab