predictive2            package:bayesSurv            R Documentation

_C_o_m_p_u_t_e _p_r_e_d_i_c_t_i_v_e _q_u_a_n_t_i_t_i_e_s _b_a_s_e_d _o_n _a _B_a_y_e_s_i_a_n _s_u_r_v_i_v_a_l _r_e_g_r_e_s_s_i_o_n
_m_o_d_e_l _f_i_t_t_e_d _u_s_i_n_g _b_a_y_e_s_B_i_s_u_r_v_r_e_g _o_r _b_a_y_e_s_s_u_r_v_r_e_g_2 _o_r _b_a_y_e_s_s_u_r_v_r_e_g_3 _f_u_n_c_t_i_o_n_s.

_D_e_s_c_r_i_p_t_i_o_n:

     This function computes predictive densities, survivor and hazard
     curves for specified combinations of covariates.

     Firstly, either the function 'bayesBisurvreg' or the function
     'bayessurvreg2' or the function 'bayessurvreg3' has to be used to
     obtain a sample from the posterior distribution of unknown
     quantities.

     Function 'predictive2.control' serves only to perform some input
     checks inside the main function 'predictive2'.

_U_s_a_g_e:

     predictive2(formula, random, obs.dim, time0, data = parent.frame(),
          grid, na.action = na.fail, Gspline,
          quantile = c(0, 0.025, 0.5, 0.975, 1),
          skip = 0, by = 1, last.iter, nwrite,
          only.aver = TRUE,
          predict = list(density=FALSE, Surv=TRUE,
                         hazard=FALSE, cum.hazard=FALSE),
          dir = getwd(), extens = "", extens.random="_b", version=0)

     predictive2.control(predict, only.aver, quantile, obs.dim,
          time0, Gspline, n)

_A_r_g_u_m_e_n_t_s:

 formula: the same formula as that one used to sample from the
          posterior distribution of unknown quantities by the function
          'bayesBisurvreg' or 'bayessurvreg2' or 'bayessurvreg3'. On
          the left hand side whichever 'Surv' object of a~proper length
          can be used (it is ignored anyway).

          REMARK: the prediction must be asked for at least two
          combinations of covariates. This is the restriction imposed
          by one of the internal functions I use. 

  random: the same 'random ' statement as that one used to sample from
          the posterior distribution of unknown quantities by the
          function 'bayessurvreg2' or 'bayessurvreg3', not applicable
          if 'bayesBisurvreg' was used to sample from the posterior
          distribution. 

 obs.dim: a vector that has to be supplied if bivariate data were used
          for estimation (using the function 'bayesBisurvreg'). This
          vector has to be of the same length as the number of
          covariate combinations for which the predictive quantities
          are to be computed. It determines to which dimension (1 or 2)
          each observation belong. 

   time0: a~vector of length 'Gspline$dim' giving the starting time for
          the survival model. It does not have to be supplied if equal
          to zero (usually). This option is used to get hazard and
          density functions on the original time scale in the case that
          the model was log(T - time0) = .... Note that 'time0' IS NOT
          the starting time of doubly censored observation since there
          after subtracting the onset time, the starting time is
          (usually) equal to zero. 

    data: optional data frame in which to interpret the variables
          occuring in the formulas. Usually, you create a new
          '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. 

    grid: a~vector giving the grid of values where predictive
          quantities are to be evaluated. The grid should normally
          start at some value slightly higher than 'time0'. 

na.action: function to be used to handle any 'NA's in the data. The
          user is discouraged to change a default value 'na.fail'. 

 Gspline: a~list specifying the G-spline used for the error
          distribution in the model. It is a~list with the following
          components:

          _d_i_m dimension of the G-spline, in the case when the function
               'bayesBisurvreg' was used to fit the model this will
               usually be equal to 2, in the case when the function
               'bayessurvreg2' was used to fit the model this MUST be
               equal to 1.

          _K a~vector of length 'Gspline$dim' specifying the number of
               knots at each side of the middle knot for each dimension
               of the G-spline.

quantile: a vector of quantiles that are to be computed for each
          predictive quantity. 

    skip: number of rows that should be skipped at the beginning of
          each *.sim file with the stored sample. 

      by: additional thinning of the sample. 

last.iter: index of the last row from *.sim files that should be used.
          If not specified than it is set to the maximum available
          determined according to the file 'mixmoment.sim'. 

  nwrite: frequency with which is the user informed about the progress
          of computation (every 'nwrite'th iteration count of
          iterations change). 

only.aver: if 'TRUE' only posterior predictive mean is computed for all
          quantities and no quantiles.

          The word of warning: with 'only.aver' set to 'FALSE', all
          quantities must be stored for all iterations of the MCMC to
          be able to compute the quantiles. This might require quite
          lots of memory. 

 predict: a list of logical values indicating which predictive
          quantities are to be computed. Components of the list:

          _d_e_n_s_i_t_y predictive density

          _S_u_r_v predictive survivor functions

          _h_a_z_a_r_d predictive hazard functions

          _c_u_m._h_a_z_a_r_d predictive cumulative hazard functions

     dir: directory where to search for files (`mixmoment.sim',
          `mweight.sim', mmean.sim', gspline.sim', 'beta.sim', 'D.sim',
          ...) with the McMC sample. 

  extens: an extension used to distinguish different sampled G-splines
          if more formulas were used in one MCMC simulation (e.g. with
          doubly-censored data).

             *  if the data were not doubly-censored or if you wish to
                compute predictive quantities for the _onset_ time of
                the doubly-censored data then

               'extens = ""'

             *  if the data were doubly-censored and you wish to
                compute predictive quantities for the _event_ time then

               'extens = "_2"'

extens.random: only applicable if the function 'bayessurvreg3' was used
          to generate the MCMC sample.

          This is an extension used to distinguish different sampled
          G-splines determining the distribution of the random
          intercept (under the presence of doubly-censored data).

             *  if the data were not doubly-censored or if you wish to
                compute predictive quantities for the _onset_ time of
                the doubly-censored data then

               'extens.random = "_b"'

             *  if the data were doubly-censored and you wish to
                compute predictive quantities for the _event_ time then

               'extens.random = "_b2"'

 version: this argument indicates by which 'bayes*survreg*' function
          the chains used by 'bayesGspline' were created. Use the
          following:

          _b_a_y_e_s_B_i_s_u_r_v_r_e_g: 'version = 0';

          _b_a_y_e_s_s_u_r_v_r_e_g_2: 'version = 0';

          _b_a_y_e_s_s_u_r_v_r_e_g_3: with all distributions specified as G-splines:
               'version = 3';

          _b_a_y_e_s_s_u_r_v_r_e_g_3: with error distributions specified as
               G-splines and bivariate normal random intercepts:
               'version = 32'.    

       n: number of covariate combinations for which the prediction
          will be performed. 

_V_a_l_u_e:

     A list with possibly the following components (what is included
     depends on the value of the arguments 'predict' and 'only.aver'):

    grid: a~vector with the grid values at which the survivor function,
          survivor density, hazard and cumulative hazard are computed.

    Surv: predictive survivor functions.

          A~matrix with as many columns as length(grid) and as many
          rows as the number of covariate combinations for which the
          predictive quantities were asked. One row per covariate
          combination. 

 density: predictive survivor densities.

          The same structure as 'Surv' component of the list. 

  hazard: predictive hazard functions.

          The same structure as 'Surv' component of the list.     

cum.hazard: predictive cumulative hazard functions.

          The same structure as 'Surv' component of the list.     

quant.Surv: pointwise quantiles for the predictive survivor functions.

          This is a list with as many components as the number of
          covariate combinations. One component per covariate
          combination.

          Each component of this list is a~matrix with as many columns
          as length(grid) and as many rows as the length of the
          argument 'quantile'. Each row of this matrix gives values of
          one quantile. The rows are also labeled by the probabilities
          (in %) of the quantiles. 

quant.density: pointwise quantiles for the predictive survivor
          densities.

          The same structure as 'quant.Surv' component of the list. 

quant.hazard: pointwise quantiles for the predictive hazard functions.

          The same structure as 'quant.Surv' component of the list.     

quant.cum.hazard: pointwise quantiles for the predictive cumulative
          hazard functions.

          The same structure as 'quant.Surv' component of the list. 

_A_u_t_h_o_r(_s):

     Arno&#353t Kom&#225rek komarek@karlin.mff.cuni.cz

_R_e_f_e_r_e_n_c_e_s:

     Kom&#225rek, A. (2006). _Accelerated Failure Time Models for
     Multivariate Interval-Censored Data with Flexible Distributional
     Assumptions_. PhD. Thesis, Katholieke Universiteit Leuven,
     Faculteit Wetenschappen.

     Kom&#225rek, A. and Lesaffre, E. (2007). Bayesian accelerated
     failure time model with multivariate doubly-interval-censored data
     and flexible distributional assumptions. _To appear in Journal of
     the American Statistical Association._

     Kom&#225rek, A. and Lesaffre, E. (2006). Bayesian semi-parametric
     accelerated failurew time model for paired doubly
     interval-censored data. _Statistical Modelling_, *6*, 3-22.

     Kom&#225rek, A.,  Lesaffre, E., and Legrand, C. (2007). Baseline
     and treatment effect heterogeneity for survival times between
     centers using a random effects accelerated failure time model with
     flexible error distribution. To appear in _Statistics in
     Medicine._

_E_x_a_m_p_l_e_s:

     ## See the description of R commands for
     ## the models described in
     ## Komarek (2006),
     ## Komarek and Lesaffre (2006),
     ## Komarek and Lesaffre (2007),
     ## Komarek, Lesaffre, and Legrand (2007).
     ##
     ## R commands available in the documentation
     ## directory of this package
     ## as tandmobPA.pdf, tandmobPA.R,
     ##    tandmobCS.pdf, tandmobCS.R,
     ##    eortc.pdf.

