smoothSurvReg           package:smoothSurv           R Documentation

_R_e_g_r_e_s_s_i_o_n _f_o_r _a _S_u_r_v_i_v_a_l _M_o_d_e_l _w_i_t_h _S_m_o_o_t_h_e_d _E_r_r_o_r _D_i_s_t_r_i_b_u_t_i_o_n

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

     Regression for a survival model. These are all time-transformed
     location models, with the most useful case being the accelerated
     failure models that use a log transformation. Error distribution
     is assumed to be a mixture of G-splines. Parameters are estimated
     by the penalized maximum likelihood method.

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

     smoothSurvReg(formula = formula(data), logscale = ~1, 
        data = parent.frame(), subset, na.action = na.fail,
        init.beta, init.logscale, init.c, init.dist = "best",
        update.init = TRUE, aic = TRUE, lambda = exp(2:(-9)),
        model = FALSE, control = smoothSurvReg.control(), ...)

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

 formula: A formula expression as for other regression models. See the
          documentation for 'lm' and 'formula' for details. Use 'Surv'
          on the left hand side of the formula. 

logscale: A formula expression to determine a possible dependence of
          the log-scale on covariates. 

    data: Optional data frame in which to interpret the variables
          occurring in the formula. 

  subset: Subset of the observations to be used in the fit. 

na.action: Function to be used to handle any NAs in the data. It's
          default value is 'na.fail'. It is not recommended to change
          it in the case when 'logscale' depends on covariates. 

init.beta: Optional vector of the initial values of the regression
          parameter beta (intercept and regression itself). 

init.logscale: Optional value of the initial value of the parameters
          that determines the log-scale parameter log(sigma). 

  init.c: Optional vector of the initial values for the G-spline
          coefficients c, all values must lie between 0 and 1 and must
          sum up to 1. 

init.dist: A character string specifying the distribution used by
          'survreg' to find the initial values for parameters (if not
          given by the user). It is assumed to name '"best"' or an
          element from 'survreg.distributions'. These include
          '"weibull"', '"exponential"', '"gaussian"', '"logistic"',
          '"lognormal"' and '"loglogistic"'. If "best" is specified one
          of '"lognormal"', '"weibull"' and '"loglogistic"' giving the
          highest likelihood is used. 

update.init: If TRUE, the initial values are updated during the grid
          search for the lambda parameter giving the optimal AIC.
          Otherwise, fits with all lambdas during the grid search start
          with same initials determine at the beginning either from the
          values of 'init.beta, init.scale, init.c' or from the initial
          'survreg' fit as determined by the parameter 'init.dist'. 

     aic: If TRUE the optimal value of the tuning parameter lambda is
          determined via a grid search through the values specified by
          the parameter 'lambda'. If FALSE, only the model with lambda
          =  'lambda[1]' is fitted. 

  lambda: A grid of values of the tuning parameter lambda searched for
          the optimal value if 'aic' = TRUE. 

   model: If TRUE, the model frame is returned. 

 control: A list of control values, in the format producted by
          'smoothSurvReg.control'. 

     ...: Other arguments which will be passed to
          'smoothSurvReg.control'. See its help page for more options
          to control the fit and for the possibility to fix some values
          and not to estimate them. 

_D_e_t_a_i_l_s:

     Read the paper paper.pdf found in /inst/doc directory of this
     library.

     There is a slight difference in the definition of the penalty used
     by the R function compared to what is written in the paper. The
     penalized log-likelihood given in the paper has a form

 l_P(theta) = l(theta) - (lambda/2) * sum[j in (m+1):g] (Delta^m a[j])^2,

     while the penalized log-likelihood used in the R function
     multiplies the tuning parameter lambda given by 'lambda' by a
     sample size n to keep default values more or less useful for
     samples of different sizes. So that the penalized log-likelihood
     which is maximized by the R function has the form

 l_P(theta) = l(theta) - ((lambda*n)/2) * sum[j in (m+1):g] (Delta^m a[j])^2.

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

     An object of class 'smoothSurvReg' is returned. See
     'smoothSurvReg.object' for details.

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

     Arnost Komarek arnost.komarek@med.kuleuven.ac.be

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

     Komarek, A., Lesaffre, E., and Hilton, J. F. (2004) Accelerated
     Failure Time Model for Arbitrarily Censored Data with Smoothed
     Error Distribution. _?????_, *??*, ???-???.

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

     ### We generate interval censored data and fit a model with few artificial covariates
     x1 <- rbinom(50, 1, 0.4)                                         ## binary covariate
     x2 <- rnorm(50, 180, 10)                                         ## continuous covariate
     y1 <- 0.5*x1 - 0.01*x2 + 0.005 *x1*x2 + 1.5*rnorm(50, 0, 1)      ## generate log(T), left limit
     t1 <- exp(y1)                                                    ## left limit of the survival time
     t2 <- t1 + rgamma(50, 1, 1)                                      ## right limit of the survival time
     surv <- Surv(t1, t2, type = "interval2")                         ## survival object

     ## Fit the model with an interaction
     fit1 <- smoothSurvReg(surv ~ x1 * x2, logscale = ~1, info = FALSE, lambda = exp(2:(-1)))

     ## Print the summary information
     summary(fit1, spline = TRUE)

     ## Plot the fitted error distribution
     plot(fit1)

     ## Plot the fitted error distribution with its components
     plot(fit1, components = TRUE)

     ## Plot the cumulative distribution function corresponding to the error density
     survfit(fit1, cdf = TRUE)

     ## Plot predictive survivor curves for persons with (x1, x2) = (0, 180) and (1, 180)
     cov <- matrix(c(0, 180, 0,   1, 180, 180), ncol = 3, byrow = TRUE)
     survfit(fit1, cov = cov)

     ## Plot predictive hazard curves for persons with (x1, x2) = (0, 180) and (1, 180)
     cov <- matrix(c(0, 180, 0,   1, 180, 180), ncol = 3, byrow = TRUE)
     hazard(fit1, cov = cov)

     ## Plot predictive densities for persons with (x1, x2) = (0, 180) and (1, 180)
     cov <- matrix(c(0, 180, 0,   1, 180, 180), ncol = 3, byrow = TRUE)
     fdensity(fit1, cov = cov)

     ## More involved examples can be found in script files
     ## used to perform analyses  and draw pictures 
     ## presented in /doc/paper1.pdf and /doc/paper2.pdf of this library.
     ## These scripts can be found as *.tar.gz files in the same directory.
     ##
     ## I am not sure whether Windows precombiled binary distributions
     ## of contributed packages contain this directory.
     ## If not, download source version of the library from CRAN
     ## (tar.gz file), unpack it and you find it.

