Skip to contents

streg() is used to fit parametric proportional hazards survival models.

Usage

streg(
  formula,
  data,
  distribution = "exponential",
  x = FALSE,
  y = FALSE,
  init = NULL,
  control = list()
)

Arguments

formula

A formula describing the model to be fitted. The left-hand-side of the formula must be a survival::Surv() object, and (at the moment) only right censoring is supported.

data

A data frame containing the variables in the model (as described by the model formula).

distribution

A character string naming the distribution to be assumed for the baseline hazard function. Possible values are "exponential", "weibull", and "gompertz" for exponential, Weibull, and Gompertz parametric survival regression models, respectively. See 'Details' for more informations on each.

x

Logical value indicating whether the model matrix used in the fitting process should be returned as components of the fitted object.

y

Logical value indicating whether the response vector (the survival::Surv() object) used in the fitting process should be returned as components of the fitted object.

init

An optional vector of starting values for the fitting process. If NULL (the default), starting values will be obtained by (1) fitting the empty model for the parameters related to the distribution and (2) assuming all other coefficients start from a value of zero.

control

A list of parameters for controlling the fitting process, which are passed to stats::nlminb().

Value

An object of class streg.

Details

A general parametric proportional hazards survival model is defined as $$ h(t | X, \theta, \beta) = h_0(t | \theta) \exp(X \beta) $$ where \(X\) represents model covariates, \(\theta\) represents any ancillary parameter, and \(\beta\) represents regression coefficients; \(h_0(\cdot)\) is the baseline hazard function.

The exponential model assumes the following baseline hazard function: $$ h_0(t | \theta) = \lambda $$ In practice, \(\lambda\) is incorporated in the linear predictor and modelled on the log-scale (and reported as the (Intercept) of the model).

The Weibull model assumes the following baseline hazard function: $$ h_0(t | \theta) = p \lambda t^{p - 1} $$ \(\lambda\) is incorporated in the linear predictor and modelled on the log-scale (and reported as the (Intercept) of the model); \(p\) is also modelled on the log-scale and reported as ln_p.

Finally, the Gompertz model assumes the following baseline hazard function: $$ h_0(t | \theta) = \lambda \exp(\gamma t) $$ \(\lambda\) is incorporated in the linear predictor and modelled on the log-scale (and reported as the (Intercept) of the model), \(\gamma\) is reported as gamma and not constrained to be strictly positive, as in Stata.

Examples


library(streg)
data("kva")
fit <- streg(Surv(failtime, event) ~ load + bearings, data = kva, distribution = "exp", x = TRUE)
fit
#> Exponential regression -- log-relative hazard form
#> 
#> Coefficients:
#> (Intercept)         load     bearings  
#>    -5.75660      0.06112     -0.21948  
#>