Learn R Programming

ppweibull (version 1.0)

choose.pweibull: Choose a Partition for a Power Piecewise Weibull Model

Description

Selects a time partition for the power piecewise Weibull model, given a maximum number of allowed partitions. For choose.pweibull, the user may specify whether the \(\lambda\)'s are equal (default FALSE), whether the \(\alpha\)'s are equal (default FALSE), and whether \(\alpha\) is fixed (default FALSE). For choose2.pweibull, the procedure selects the best combination among:

  • \(\lambda\)'s different and \(\alpha\)'s different,

  • \(\lambda\)'s equal and \(\alpha\)'s different,

  • \(\lambda\)'s different and \(\alpha\)'s equal,

  • \(\lambda\)'s different and \(\alpha = 1\) (piecewise exponential distribution),

  • \(\lambda\)'s different and \(\alpha = 2\) (piecewise Rayleigh distribution).

Usage

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

choose2.pweibull(formula, data, criteria = "AIC", L.max = 5, t = NULL, prec = 1e-04, max.iter = 1000, alpha.fixed = c(1, 2))

Value

A list with components:

estimate

A matrix of parameter estimates and standard errors for the selected partition.

logLik

Log-likelihood evaluated at the parameter estimates.

t

Selected time partition.

AIC

Akaike Information Criterion.

BIC

Bayesian Information Criterion.

L.sel

Number of selected partitions.

AIC.L

AIC values for \(L = 1, \ldots, L.max\).

BIC.L

BIC values for \(L = 1, \ldots, L.max\).

Arguments

formula

A model formula of class "formula" describing the survival model to be fitted. Details about 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).

criteria

Model selection criterion: "AIC" (default) or "BIC".

L.max

Maximum number of partitions to consider (default 5).

t

Optional fixed time partition. If provided, both choose.pweibull and choose2.pweibull evaluate only the model combinations with the specified partition.

prec

Numerical tolerance for the estimation algorithm (default 1e-4).

max.iter

Maximum number of iterations for 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

If FALSE (default), \(\alpha\) is estimated. If a positive numeric value is supplied, all \(\alpha\)'s are fixed at that value. For choose2.pweibull, this may be a vector of fixed values.

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

$$ 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\) is the time partition, \(\boldsymbol{\lambda} = (\lambda_1,\ldots,\lambda_L)\) and \(\boldsymbol{\alpha} = (\alpha_1,\ldots,\alpha_L)\).

The 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)

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

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

delta <- rbinom(n, size = 1, prob = 0.75)
cc    <- runif(n, 0, max(time2))
time  <- ifelse(delta == 1, time2, cc)

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

choose.pweibull(survival::Surv(time, delta) ~ x1 + x2, data = data, L.max = 3)
# }

Run the code above in your browser using DataLab