Learn R Programming

ppweibull (version 1.0)

fit.pweibull: Parameter Estimation for the Power Piecewise Weibull Model

Description

Fits the power piecewise Weibull model and returns parameter estimates, standard errors, likelihood measures, and the selected time partition.

Usage

fit.pweibull(formula, data, L = 1, t = NULL, prec = 1e-04, max.iter = 1000,
    lambda.identical = FALSE, alpha.identical = FALSE, alpha.fixed = FALSE)

Value

A list with components:

estimate

A matrix containing parameter estimates and corresponding standard errors.

logLik

Log-likelihood evaluated at the estimated parameters.

t

The time partition used.

AIC

Akaike Information Criterion.

BIC

Bayesian Information Criterion.

Arguments

formula

A model formula of class "formula" describing the survival model to be fitted. Details on model specification are given in Details.

data

An optional data frame, list, or environment containing the variables in the model. If not found in data, variables are taken from environment(formula).

L

Number of partitions to be used. Ignored if t is specified.

t

A fixed time partition. Ignored if L is supplied.

prec

Numerical tolerance used in the estimation procedure (default 1e-4).

max.iter

Maximum number of iterations allowed in the estimation algorithm (default 1000).

lambda.identical

Logical; should the \(\lambda\)'s be constrained to be equal? (default FALSE).

alpha.identical

Logical; should the \(\alpha\)'s be constrained to be equal? (default FALSE).

alpha.fixed

Should \(\alpha\) be fixed at a known value? If FALSE (default), \(\alpha\) is estimated. If a positive number is provided, all \(\alpha_\ell\) are fixed at that value.

Author

Diego I. Gallardo, Yolanda M. Gomez, Hector W. Gomez, and Barry C. Arnold.

Details

The hazard function of the power piecewise Weibull model is given by $$ h(t \mid \boldsymbol{\lambda}, \boldsymbol{\alpha}) = \lambda_\ell \alpha_\ell t^{\alpha_\ell - 1}, \qquad t \in (a_{\ell-1}, a_\ell),\; \ell = 1, \ldots, L, $$ where \(0 = a_0 < a_1 < \cdots < a_L < \infty\) defines the time partition, \(\boldsymbol{\lambda} = (\lambda_1, \ldots, \lambda_L)\) and \(\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_L)\).

Special cases include:

  • \(\alpha_1 = \cdots = \alpha_L = 1\): the piecewise exponential model (Feigl and Zelen, 1965; Friedman, 1982),

  • \(\alpha_1 = \cdots = \alpha_L = 2\): a piecewise Rayleigh model.

References

Feigl P., Zelen M. (1965). Estimation of exponential survival probabilities with concomitant information. Biometrics, 21, 826-838.

Friedman M. (1982). Piecewise exponential models for survival data with covariates. Annals of Statistics, 10, 101-113.

Gomez Y. M., Gallardo D. I., Arnold B. C. (2018). The power piecewise exponential model. Journal of Statistical Computation and Simulation, 88, 825-840.

Examples

Run this code
# \donttest{
library(survival)
set.seed(3100)

n  <- 200
x1 <- rnorm(n)
x2 <- rnorm(n)

## design matrix
x  <- model.matrix(~ x1 + x2)[, -1]

lambda <- c(0.05, 0.03)
rate   <- exp(cbind(x1, x2) %*% c(0.5, -0.5))

time <- numeric(n)
for (i in 1:n)
  time[i] <- rpweibull(1, rate = lambda * rate[i], alpha = c(1, 1), t = c(0, 10))

delta <- rep(1, n)

data <- data.frame(time = time, delta = delta, x1 = x1, x2 = x2)

fit.pweibull(survival::Surv(time, delta) ~ x1 + x2, data = data, L = 2)
# }

Run the code above in your browser using DataLab