rstpm2 (version 1.5.1)

aft: Parametric accelerated failure time model with smooth time functions

Description

This implements the accelerated failure time models S_0(t exp(beta x)) and S_0(int_0^t exp(beta x(u)) du). The baseline function S_0(t*) is modelled as exp(-exp(eta_0(log(t*)))), where eta_0(log(t*)) is a linear predictor using natural splines.

Usage

aft(formula, data, smooth.formula = NULL, df = 3,
    tvc = NULL, control = list(parscale = 1, maxit = 1000),
    init = NULL, weights = NULL, timeVar = "", time0Var = "",
    log.time.transform = TRUE,
    reltol = 1e-08, trace = 0, contrasts = NULL, subset = NULL,
    use.gr = TRUE, ...)

Arguments

formula

a formula object, with the response on the left of a ~ operator, and the regression terms (excluding time) on the right. The response should be a survival object as returned by the Surv function. The terms can include linear effects for any time-varying coefficients. [required]

data

a data-frame in which to interpret the variables named in the formula argument. [at present: required]

smooth.formula

a formula for describing the time effects for the linear predictor, excluding the baseline S_0(t*), but including time-dependent acceleration factors. The time-dependent acceleration factors can be modelled with any smooth functions.

df

an integer that describes the degrees of freedom for the ns function for modelling the baseline log-cumulative hazards function (default=3).

tvc

a list with the names of the time-varying coefficients. This uses natural splines (e.g. tvc=list(hormon=3) is equivalent to smooth.formula=~...+hormon:nsx(log(time),df=3)), which by default does not include an intercept (or main effect) term.

control

control argument passed to optim.

init

init should either be FALSE, such that initial values will be determined using Cox regression, or a numeric vector of initial values.

weights

an optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector.

timeVar

string variable defining the time variable. By default, this is determined from the survival object, however this may be ambiguous if two variables define the time.

time0Var

string variable to determine the entry variable; useful for when more than one data variable is used in the entry time.

log.time.transform

logical for whether to log-transform time when calculating the design matrix for the derivative of S_0 with respect to time.

reltol

relative tolerance for the model convergence

trace

integer for whether to provide trace information from the optim procedure

contrasts

an optional list. See the contrasts.arg of model.matrix.default.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

use.gr

logical indicating whether to use gradients in the calculation

additional arguments to be passed to the mle2.

Value

An stpm2-class object that inherits from mle2-class.

Details

The implementation extends the mle2 object from the bbmle package. The model inherits all of the methods from the mle2 class.

See Also

survreg, coxph

Examples

Run this code
# NOT RUN {
summary(aft(Surv(rectime,censrec==1)~hormon,data=brcancer,df=4))
# }

Run the code above in your browser using DataLab