bayesGspline            package:bayesSurv            R Documentation

_S_u_m_m_a_r_y _f_o_r _t_h_e _d_e_n_s_i_t_y _e_s_t_i_m_a_t_e _b_a_s_e_d _o_n _t_h_e _m_o_d_e_l _w_i_t_h _B_a_y_e_s_i_a_n
_G-_s_p_l_i_n_e_s.

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

     Compute the estimate of the density function based on the values
     sampled using the MCMC (MCMC average evaluated in a grid of
     values) in a model where density is specified as a Bayesian
     G-spline.

     This function serves to summarize the MCMC chains related to the
     distributional parts  of the considered models obtained using the
     functions: 'bayesHistogram', 'bayesBisurvreg', 'bayessurvreg2',
     'bayessurvreg3'.

     If asked, this function returns also the values of the G-spline
     evaluated in a grid at each iteration of MCMC.

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

     bayesGspline(dir = getwd(), extens="", extens.adjust="_b",
        grid1, grid2, skip = 0, by = 1, last.iter, nwrite,
        only.aver = TRUE, standard = FALSE, version = 0)

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

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

  extens: an extension used to distinguish different sampled G-splines
          if more G-splines were used in one simulation (e.g. with
          doubly-censored data or in the model where both the error
          term and the random intercept were defined as the G-splines).
          According to which 'bayes*survreg*' function was used,
          specify the argument 'extens' in the following way.

          _b_a_y_e_s_H_i_s_t_o_g_r_a_m: always 'extens = ""'

                  *  to compute the bivariate distribution of the
                     _error_ term for the _onset_ time: 'extens = ""';

                  *  to compute the bivariate distribution of the
                     _error_ term for the _event_ time if there was
                     doubly-censoring: 'extens = "_2"';


                  *  to compute the distribution of the _error_ term
                     for the _onset_ time: 'extens = ""';

                  *  to compute the distribution of the _error_ term
                     for the _event_ time if there was
                     doubly-censoring: 'extens = "_2"';


                  *  to compute the distribution of the _error_ term
                     for the _onset_ time: 'extens = ""';

                  *  to compute the distribution of the _error_ term
                     for the _event_ time if there was
                     doubly-censoring: 'extens = "_2"';

                  *  to compute the distribution of the _random
                     intercept_ for the _onset_ time: 'extens = "_b"';

                  *  to compute the distribution of the _random
                     intercept_ term for the _event_ time if there was
                     doubly-censoring: 'extens = "_b2"';      


extens.adjust: this argument is applicable for the situation when the
          MCMC chains were created using the function 'bayessurvreg3',
          and when both the distribution of the error term and the
          random intercept was specified as the G-spline.

          In that case the location of the error term and the random
          intercept are separately not identifiable. Only the location
          of the sum epsilon + b can be estimated. For this reason, the
          function 'bayesGspline' always centers the distribution of
          the random intercept to have a zero mean and adds its
          original mean to the mean of the distribution of the error
          term.

          Argument 'extens.adjust' is used to match correctly the files
          containing the G-spline of the random intercept corresponding
          to the particular error term. 

          The following values of 'extens.adjust' should be used in the
          following situations:

             *  if there are no doubly-censored data or if we are
                computing the distribution of the error term/random
                intercept from the model for the _onset_ time then

               'extens.adjust = "_b"'

             *  if there are doubly-censored data and we are computing
                the distribution of the error term/random intercept
                from the model for the _event_ time then

               'extens.adjust = "_b2"'

   grid1: grid of values from the first dimension at which the sampled 
          densities are to be evaluated.

   grid2: grid of values from the second dimension (if the G-spline was
          bivariate) at which the sampled densities are to be
          evaluated. This item is 'missing' if the G-spline is
          univariate.

    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: 'TRUE/FALSE', if 'TRUE' only MCMC average is returned
          otherwise also values of the G-spline at each iteration are
          returned (which might ask for quite lots of memory).

standard: 'TRUE/FALSE', if 'TRUE', each G-spline is standardized to
          have zero mean and unit variance. Only applicable if
          'version' = 30 or 31, otherwise 'standard' is always set to
          'FALSE'.

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

          _b_a_y_e_s_H_i_s_t_o_g_r_a_m: 'version = 0';

          _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: 'version = 30 ' or ' 31'.

               Use 'version = 30' if you want to compute the density of
               the _error_ term.

               Use 'version = 31' if you want to compute the density of
               the _random intercept_.

               Use 'version = 32' if you want to compute the density of
               the _error_ term in the model with
               doubly-interval-censored data and bivariate normal
               distribution for random intercepts in the onset and
               time-to-event parts of the model.

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

     An object of class 'bayesGspline' is returned. This object is a
     list with components 'grid', 'average' for the univariate G-spline
     and components 'grid1', 'grid2', 'average' for the bivariate
     G-spline. 

    grid: this is a grid of values (vector) at which the McMC average
          of the G-spline was computed.

 average: these are McMC averages of the G-spline (vector) evaluated in
          'grid'.

   grid1: this is a grid of values (vector) for the first dimension at
          which the McMC average of the G-spline was computed.

   grid2: this is a grid of values (vector) for the second dimension at
          which the McMC average of the G-spline was computed.

 average: this is a matrix 'length(grid1)' times 'length(grid2)' with
          McMC averages of the G-spline evaluated in

            x1 =  ( grid1  ...  grid1 )

          and

                  (  grid2  )
            x2 =  (   ...   )
                  (  grid2  )


     There exists a method to plot objects of the class 'bayesGspline'.

_A_t_t_r_i_b_u_t_e_s:

     Additionally, the object of class 'bayesGspline' has the following
     attributes:

     '_s_a_m_p_l_e._s_i_z_e' a length of the McMC sample used to compute the McMC
          average.

     '_s_a_m_p_l_e' G-spline evaluated in a grid of values. This attribute is
          present only if 'only.aver = FALSE'.

          For a univariate G-spline this is a matrix with 'sample.size'
          columns and length(grid1) rows.

          For a bivariate G-spline this is a matrix with 'sample.size'
          columns and length(grid1)*length(grid2) rows.

_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. (2006). Bayesian semi-parametric
     accelerated failurew time model for paired doubly
     interval-censored data. _Statistical Modelling_, *6*, 3-22.

     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., 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.
     ##

