mlreg                  package:eha                  R Documentation

_M_L _p_r_o_p_o_r_t_i_o_n_a_l _h_a_z_a_r_d_s _r_e_g_r_e_s_s_i_o_n

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

     Maximum Likelihood estimation of proportional hazards models.

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

     mlreg(formula = formula(data), data = parent.frame(),
     na.action = getOption("na.action"), init, method = c("ML", "MPPL"),
     control = list(eps = 1e-08, maxiter = 10, n.points = 12, trace = FALSE),
     singular.ok = TRUE, model = FALSE,
     x = FALSE, y = TRUE, boot = FALSE, geometric = FALSE,
     rs, frailty = NULL, max.survs)

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

 formula: a formula object, with the response on the left of a ~
          operator, and the terms on the right. The response must be a
          survival object as returned by the Surv function.

    data: a data.frame in which to interpret the variables named in the
          formula.

na.action: a missing-data filter function, applied to the model.frame,
          after any subset argument has been used. Default is
          'options()$na.action'.

    init: vector of initial values of the iteration. Default initial
          value is zero for all variables.

  method: Method of treating ties, "ML", the default, means pure
          maximum likelihood, i.e, data are treated as discrete. The
          choice "MPPL" implies that risk sets with no tied events are
          treated as in ordinary Cox regression. This is a cameleont
          that adapts to data, part discrete and part continuous.

 control: a list with components 'eps' (convergence criterion),
          'maxiter' (maximum number of iterations), and 'silent'
          (logical, controlling amount of output). You can change any
          component without mention the other(s).

singular.ok: Not used.

   model: Not used.

       x: Return the design matrix in the model object?

       y: return the response in the model object?

    boot: No. of bootstrap replicates. Defaults to FALSE, i.e., no
          bootstrapping.

geometric: If 'TRUE', the intensity is assumed constant within strata.

      rs: Risk set? If present, speeds up calculations considerably.

 frailty: A grouping variable for frailty analysis. Full name is
          needed.

max.survs: Sampling of risk sets?

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

     Method 'ML' performs a true discrete analysis, i.e., one parameter
     per observed event time. Method 'MPPL' is a compromize between the
     discrete and continuous time approaches; one parameter per
     observed event time with multiple events. With no ties in data, an
     ordinary Cox regression (as with 'coxreg') is performed.

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

     A list of class 'c("mlreg", "coxreg", "coxph")' with components 

coefficients: Fitted parameter estimates.

     var: Covariance matrix of the estimates.

  loglik: Vector of length two; first component is the value at the
          initial parameter values, the second componet is the
          maximized value.

   score: The score test statistic (at the initial value).

linear.predictors: The estimated linear predictors.

residuals: The martingale residuals.

  hazard: The estimated baseline hazard.

   means: Means of the columns of the design matrix.

 w.means: Weighted (against exposure time) means of covariates;
          weighted relative frequencies of levels of factors.

       n: Number of spells in indata (possibly after removal of cases
          with NA's).

  events: Number of events in data.

   terms: Used by extractor functions.

  assign: Used by extractor functions.

wald.test: The Walt test statistic (at the initial value).

       y: The Surv vector.

     isF: Logical vector indicating the covariates that are factors.

  covars: The covariates.

     ttr: Total Time at Risk.

  levels: List of levels of factors.

 formula: The calling formula.

    call: The call.

bootstrap: The bootstrap sample, if requested on input.

   sigma: Present if a frailty model is fitted. Equals the estimated
          frailty standard deviation.

sigma.sd: The standard error of the estimated frailty standard
          deviation.

  method: The method.

convergence: Did the optimization converge?

    fail: Did the optimization fail? (Is 'NULL' if not).

_W_a_r_n_i_n_g:

     The use of 'rs' is dangerous, see note above. It can however speed
     up computing time.

_N_o_t_e:

     This function starts by creating risksets, if no riskset is
     supplied via 'rs', with the aid of 'risksets'. This latter
     mechanism fails if there are any NA's in the data! Note also that
     it depends on stratification, so 'rs' contains information about
     stratification. Giving another strata variable in the formula is
     an error. The same is ok, for instance to supply stratum
     interactions.

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

     Gran Brostrm

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

     Brostrm, G. (2002). Cox regression; Ties without tears.
     _Communications in Statistics: Theory and Methods_ *31*, 285-297.

_S_e_e _A_l_s_o:

     'coxph', 'risksets'

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

      dat <- data.frame(time=  c(4, 3,1,1,2,2,3),
                     status=c(1,1,1,0,1,1,0),
                     x=     c(0, 2,1,1,1,0,0),
                     sex=   c(0, 0,0,0,1,1,1))
      mlreg( Surv(time, status) ~ x + strata(sex), data = dat) #stratified model
      # Same as:
      rs <- risksets(Surv(dat$time, dat$status), strata = dat$sex)
      mlreg( Surv(time, status) ~ x, data = dat, rs = rs) #stratified model
      

