streg: Fitting Parametric Proportional Hazards Survival Models

View source: R/streg.R

stregR Documentation

Fitting Parametric Proportional Hazards Survival Models

Description

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().

Details

A general parametric proportional hazards survival model is defined as

h(t | X, θ, β) = h_0(t | θ) \exp(X β)

where X represents model covariates, θ represents any ancillary parameter, and β represents regression coefficients; h_0(\cdot) is the baseline hazard function.

The exponential model assumes the following baseline hazard function:

h_0(t | θ) = λ

In practice, λ 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 | θ) = p λ t^{p - 1}

λ 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 | θ) = λ \exp(γ t)

λ is incorporated in the linear predictor and modelled on the log-scale (and reported as the (Intercept) of the model), γ is reported as gamma and not constrained to be strictly positive, as in Stata.

Value

An object of class streg.

Examples


library(streg)
data("kva")
fit <- streg(Surv(failtime, event) ~ load + bearings, data = kva, distribution = "exp", x = TRUE)
fit

ellessenne/streg documentation built on Sept. 19, 2022, 7:34 a.m.